diff --git a/FCL/src/main/assets/app_runtime/lwjgl/lwjgl.jar b/FCL/src/main/assets/app_runtime/lwjgl/lwjgl.jar index 29352f90..0d1ff678 100644 Binary files a/FCL/src/main/assets/app_runtime/lwjgl/lwjgl.jar and b/FCL/src/main/assets/app_runtime/lwjgl/lwjgl.jar differ diff --git a/FCL/src/main/assets/app_runtime/lwjgl/version b/FCL/src/main/assets/app_runtime/lwjgl/version index 73512805..60418407 100644 --- a/FCL/src/main/assets/app_runtime/lwjgl/version +++ b/FCL/src/main/assets/app_runtime/lwjgl/version @@ -1 +1 @@ -1709635789759 \ No newline at end of file +1712051464002 \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/BDF_Property.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/BDF_Property.java new file mode 100644 index 00000000..4ff56604 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/BDF_Property.java @@ -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. + * + *
+ * struct BDF_PropertyRec {
+ * BDF_PropertyType type;
+ * union {
+ * char const * atom;
+ * FT_Int32 integer;
+ * FT_UInt32 cardinal;
+ * } u;
+ * }
+ */
+@NativeType("struct BDF_PropertyRec")
+public class BDF_Property extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/CID_FaceDict.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/CID_FaceDict.java new file mode 100644 index 00000000..97280f40 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/CID_FaceDict.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+@NativeType("struct CID_FaceDictRec")
+public class CID_FaceDict extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/CID_FaceInfo.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/CID_FaceInfo.java new file mode 100644 index 00000000..98703847 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/CID_FaceInfo.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+@NativeType("struct CID_FaceInfoRec")
+public class CID_FaceInfo extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Face_Requester.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Face_Requester.java new file mode 100644 index 00000000..4c0c968f --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Face_Requester.java @@ -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.*; + +/** + *
+ * FT_Error (*{@link #invoke}) (
+ * FTC_FaceID face_id,
+ * FT_Library library,
+ * FT_Pointer req_data,
+ * FT_Face *aface
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Face_RequesterI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Face_RequesterI.java
new file mode 100644
index 00000000..2176716c
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Face_RequesterI.java
@@ -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.*;
+
+/**
+ *
+ * FT_Error (*{@link #invoke}) (
+ * FTC_FaceID face_id,
+ * FT_Library library,
+ * FT_Pointer req_data,
+ * FT_Face *aface
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_ImageType.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_ImageType.java
new file mode 100644
index 00000000..64156f10
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_ImageType.java
@@ -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.
+ *
+ *
+ * struct FTC_ImageTypeRec {
+ * FTC_FaceID face_id;
+ * FT_UInt width;
+ * FT_UInt height;
+ * FT_Int32 flags;
+ * }
+ */
+@NativeType("struct FTC_ImageTypeRec")
+public class FTC_ImageType extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_SBit.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_SBit.java new file mode 100644 index 00000000..d8b32a49 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_SBit.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+@NativeType("struct FTC_SBitRec")
+public class FTC_SBit extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Scaler.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Scaler.java new file mode 100644 index 00000000..563f5dd3 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FTC_Scaler.java @@ -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}. + * + *
+ * struct FTC_ScalerRec {
+ * FTC_FaceID face_id;
+ * FT_UInt width;
+ * FT_UInt height;
+ * FT_Int pixel;
+ * FT_UInt x_res;
+ * FT_UInt y_res;
+ * }
+ */
+@NativeType("struct FTC_ScalerRec")
+public class FTC_Scaler extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Affine23.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Affine23.java new file mode 100644 index 00000000..fdf9fdd4 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Affine23.java @@ -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. + * + *
+ * struct FT_Affine23 {
+ * FT_Fixed xx;
+ * FT_Fixed xy;
+ * FT_Fixed dx;
+ * FT_Fixed yx;
+ * FT_Fixed yy;
+ * FT_Fixed dy;
+ * }
+ */
+public class FT_Affine23 extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Alloc_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Alloc_Func.java new file mode 100644 index 00000000..c712461b --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Alloc_Func.java @@ -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.*; + +/** + *
+ * void * (*{@link #invoke}) (
+ * FT_Memory memory,
+ * long size
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Alloc_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Alloc_FuncI.java
new file mode 100644
index 00000000..e5dea4c4
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Alloc_FuncI.java
@@ -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.*;
+
+/**
+ *
+ * void * (*{@link #invoke}) (
+ * FT_Memory memory,
+ * long size
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_BBox.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_BBox.java
new file mode 100644
index 00000000..138ccff7
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_BBox.java
@@ -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.
+ *
+ *
+ * struct FT_BBox {
+ * FT_Pos xMin;
+ * FT_Pos yMin;
+ * FT_Pos xMax;
+ * FT_Pos yMax;
+ * }
+ */
+public class FT_BBox extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Bitmap.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Bitmap.java new file mode 100644 index 00000000..0f0c365c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Bitmap.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+public class FT_Bitmap extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_BitmapGlyph.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_BitmapGlyph.java new file mode 100644 index 00000000..0fc8efe5 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_BitmapGlyph.java @@ -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}. + * + *
+ * struct FT_BitmapGlyphRec {
+ * {@link FT_Glyph FT_GlyphRec} root;
+ * FT_Int left;
+ * FT_Int top;
+ * {@link FT_Bitmap FT_Bitmap} bitmap;
+ * }
+ */
+@NativeType("struct FT_BitmapGlyphRec")
+public class FT_BitmapGlyph extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Bitmap_Size.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Bitmap_Size.java new file mode 100644 index 00000000..ca0a5f08 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Bitmap_Size.java @@ -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}. + * + *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.
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.
+ * 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};
+ * }
+ */
+public class FT_Bitmap_Size extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_COLR_Paint.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_COLR_Paint.java new file mode 100644 index 00000000..97fca11b --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_COLR_Paint.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+public class FT_COLR_Paint extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_CharMap.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_CharMap.java new file mode 100644 index 00000000..f6d543a3 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_CharMap.java @@ -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. + * + *
+ * struct FT_CharMapRec {
+ * {@link FT_Face FT_Face} {@link #face};
+ * FT_Encoding {@link #encoding};
+ * FT_UShort {@link #platform_id};
+ * FT_UShort {@link #encoding_id};
+ * }
+ */
+@NativeType("struct FT_CharMapRec")
+public class FT_CharMap extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ClipBox.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ClipBox.java new file mode 100644 index 00000000..c1411a9a --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ClipBox.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+public class FT_ClipBox extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Color.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Color.java new file mode 100644 index 00000000..50a33d60 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Color.java @@ -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. + * + *
+ * struct FT_Color {
+ * FT_Byte blue;
+ * FT_Byte green;
+ * FT_Byte red;
+ * FT_Byte alpha;
+ * }
+ */
+public class FT_Color extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorIndex.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorIndex.java new file mode 100644 index 00000000..48c23923 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorIndex.java @@ -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. + * + *
+ * struct FT_ColorIndex {
+ * FT_UInt16 palette_index;
+ * FT_F2Dot14 alpha;
+ * }
+ */
+public class FT_ColorIndex extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorLine.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorLine.java new file mode 100644 index 00000000..c0b3712a --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorLine.java @@ -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. + * + *
+ * struct FT_ColorLine {
+ * FT_PaintExtend extend;
+ * {@link FT_ColorStopIterator FT_ColorStopIterator} color_stop_iterator;
+ * }
+ */
+public class FT_ColorLine extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorStop.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorStop.java new file mode 100644 index 00000000..3b3b8399 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorStop.java @@ -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. + * + *
+ * struct FT_ColorStop {
+ * FT_Fixed stop_offset;
+ * {@link FT_ColorIndex FT_ColorIndex} color;
+ * }
+ */
+public class FT_ColorStop extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorStopIterator.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorStopIterator.java new file mode 100644 index 00000000..b6a852b2 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ColorStopIterator.java @@ -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}. + * + *
+ * struct FT_ColorStopIterator {
+ * FT_UInt num_color_stops;
+ * FT_UInt current_color_stop;
+ * FT_Byte * p;
+ * FT_Bool read_variable;
+ * }
+ */
+public class FT_ColorStopIterator extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Data.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Data.java new file mode 100644 index 00000000..3484e6a6 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Data.java @@ -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. + * + *
+ * struct FT_Data {
+ * FT_Byte const * pointer;
+ * FT_UInt length;
+ * }
+ */
+public class FT_Data extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_DebugHook_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_DebugHook_Func.java new file mode 100644 index 00000000..4e755a4d --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_DebugHook_Func.java @@ -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.*; + +/** + *
+ * FT_Error (*{@link #invoke}) (
+ * void *arg
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_DebugHook_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_DebugHook_FuncI.java
new file mode 100644
index 00000000..c4518d08
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_DebugHook_FuncI.java
@@ -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.*;
+
+/**
+ *
+ * FT_Error (*{@link #invoke}) (
+ * void *arg
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Face.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Face.java
new file mode 100644
index 00000000..23c30bf9
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Face.java
@@ -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.
+ *
+ *
+ * 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;
+ * }
+ */
+@NativeType("struct FT_FaceRec")
+public class FT_Face extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Free_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Free_Func.java new file mode 100644 index 00000000..dc0a5e03 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Free_Func.java @@ -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.*; + +/** + *
+ * void (*{@link #invoke}) (
+ * FT_Memory memory,
+ * void *block
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Free_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Free_FuncI.java
new file mode 100644
index 00000000..a018838c
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Free_FuncI.java
@@ -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.*;
+
+/**
+ *
+ * void (*{@link #invoke}) (
+ * FT_Memory memory,
+ * void *block
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic.java
new file mode 100644
index 00000000..2124f7f9
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic.java
@@ -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.
+ *
+ *
+ * struct FT_Generic {
+ * void * data;
+ * {@link FT_Generic_FinalizerI FT_Generic_Finalizer} finalizer;
+ * }
+ */
+public class FT_Generic extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic_Finalizer.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic_Finalizer.java new file mode 100644 index 00000000..e7a98696 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic_Finalizer.java @@ -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.*; + +/** + *
+ * void (*{@link #invoke}) (
+ * void *object
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic_FinalizerI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic_FinalizerI.java
new file mode 100644
index 00000000..dd032ace
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Generic_FinalizerI.java
@@ -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.*;
+
+/**
+ *
+ * void (*{@link #invoke}) (
+ * void *object
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Glyph.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Glyph.java
new file mode 100644
index 00000000..77fbbcff
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Glyph.java
@@ -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.
+ *
+ *
+ * struct FT_GlyphRec {
+ * FT_Library library;
+ * FT_Glyph_Class const * clazz;
+ * FT_Glyph_Format format;
+ * {@link FT_Vector FT_Vector} advance;
+ * }
+ */
+@NativeType("struct FT_GlyphRec")
+public class FT_Glyph extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_GlyphSlot.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_GlyphSlot.java new file mode 100644 index 00000000..cf0f922d --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_GlyphSlot.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+@NativeType("struct FT_GlyphSlotRec")
+public class FT_GlyphSlot extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Glyph_Metrics.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Glyph_Metrics.java new file mode 100644 index 00000000..6642ed8d --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Glyph_Metrics.java @@ -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. + * + *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.
+ * + *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).
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.
+ * + *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.
+ * + *
+ * 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};
+ * }
+ */
+public class FT_Glyph_Metrics extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_FreeGlyphDataFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_FreeGlyphDataFunc.java new file mode 100644 index 00000000..94dfe4ed --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_FreeGlyphDataFunc.java @@ -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.*; + +/** + *
+ * void (*{@link #invoke}) (
+ * FT_Incremental incremental,
+ * FT_Data *data
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_FreeGlyphDataFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_FreeGlyphDataFuncI.java
new file mode 100644
index 00000000..e70c4bd3
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_FreeGlyphDataFuncI.java
@@ -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.*;
+
+/**
+ *
+ * void (*{@link #invoke}) (
+ * FT_Incremental incremental,
+ * FT_Data *data
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Funcs.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Funcs.java
new file mode 100644
index 00000000..30df7fed
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Funcs.java
@@ -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}.
+ *
+ *
+ * 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;
+ * }
+ */
+@NativeType("struct FT_Incremental_FuncsRec")
+public class FT_Incremental_Funcs extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphDataFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphDataFunc.java new file mode 100644 index 00000000..74ae8b85 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphDataFunc.java @@ -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.*; + +/** + *
+ * FT_Error (*{@link #invoke}) (
+ * FT_Incremental incremental,
+ * FT_UInt glyph_index,
+ * FT_Data *adata
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphDataFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphDataFuncI.java
new file mode 100644
index 00000000..1fa3ad8e
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphDataFuncI.java
@@ -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.*;
+
+/**
+ *
+ * FT_Error (*{@link #invoke}) (
+ * FT_Incremental incremental,
+ * FT_UInt glyph_index,
+ * FT_Data *adata
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphMetricsFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphMetricsFunc.java
new file mode 100644
index 00000000..ad6b6ab3
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphMetricsFunc.java
@@ -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.*;
+
+/**
+ *
+ * FT_Error (*{@link #invoke}) (
+ * FT_Incremental incremental,
+ * FT_UInt glyph_index,
+ * FT_Bool vertical,
+ * FT_Incremental_MetricsRec *ametrics
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphMetricsFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphMetricsFuncI.java
new file mode 100644
index 00000000..b0d0ed1a
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_GetGlyphMetricsFuncI.java
@@ -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.*;
+
+/**
+ *
+ * FT_Error (*{@link #invoke}) (
+ * FT_Incremental incremental,
+ * FT_UInt glyph_index,
+ * FT_Bool vertical,
+ * FT_Incremental_MetricsRec *ametrics
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Interface.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Interface.java
new file mode 100644
index 00000000..e993128a
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Interface.java
@@ -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.
+ *
+ *
+ * struct FT_Incremental_InterfaceRec {
+ * {@link FT_Incremental_Funcs FT_Incremental_FuncsRec} const * funcs;
+ * FT_Incremental object;
+ * }
+ */
+@NativeType("struct FT_Incremental_InterfaceRec")
+public class FT_Incremental_Interface extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Metrics.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Metrics.java new file mode 100644 index 00000000..700d8851 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Incremental_Metrics.java @@ -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. + * + *
+ * struct FT_Incremental_MetricsRec {
+ * FT_Long bearing_x;
+ * FT_Long bearing_y;
+ * FT_Long advance;
+ * FT_Long advance_v;
+ * }
+ */
+@NativeType("struct FT_Incremental_MetricsRec")
+public class FT_Incremental_Metrics extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_LayerIterator.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_LayerIterator.java new file mode 100644 index 00000000..465c8245 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_LayerIterator.java @@ -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}. + * + *
+ * struct FT_LayerIterator {
+ * FT_UInt num_layers;
+ * FT_UInt layer;
+ * FT_Byte * p;
+ * }
+ */
+public class FT_LayerIterator extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List.java new file mode 100644 index 00000000..1ffee56b --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List.java @@ -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. + * + *
+ * struct FT_ListRec {
+ * {@link FT_ListNode FT_ListNode} head;
+ * {@link FT_ListNode FT_ListNode} tail;
+ * }
+ */
+@NativeType("struct FT_ListRec")
+public class FT_List extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ListNode.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ListNode.java new file mode 100644 index 00000000..d43d5e2c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_ListNode.java @@ -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. + * + *
+ * struct FT_ListNodeRec {
+ * {@link FT_ListNode FT_ListNode} prev;
+ * {@link FT_ListNode FT_ListNode} next;
+ * void * data;
+ * }
+ */
+@NativeType("struct FT_ListNodeRec")
+public class FT_ListNode extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_Destructor.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_Destructor.java new file mode 100644 index 00000000..a71a7ab2 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_Destructor.java @@ -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.*; + +/** + *
+ * void (*{@link #invoke}) (
+ * FT_Memory memory,
+ * void *data,
+ * void *user
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_DestructorI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_DestructorI.java
new file mode 100644
index 00000000..30361d64
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_DestructorI.java
@@ -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.*;
+
+/**
+ *
+ * void (*{@link #invoke}) (
+ * FT_Memory memory,
+ * void *data,
+ * void *user
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_Iterator.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_Iterator.java
new file mode 100644
index 00000000..15679d7c
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_Iterator.java
@@ -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.*;
+
+/**
+ *
+ * FT_Error (*{@link #invoke}) (
+ * FT_ListNode node,
+ * void *user
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_IteratorI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_IteratorI.java
new file mode 100644
index 00000000..86ed1a1f
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_List_IteratorI.java
@@ -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.*;
+
+/**
+ *
+ * FT_Error (*{@link #invoke}) (
+ * FT_ListNode node,
+ * void *user
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_MM_Axis.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_MM_Axis.java
new file mode 100644
index 00000000..262d05dd
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_MM_Axis.java
@@ -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.
+ *
+ *
+ * struct FT_MM_Axis {
+ * FT_String * name;
+ * FT_Long minimum;
+ * FT_Long maximum;
+ * }
+ */
+public class FT_MM_Axis extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_MM_Var.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_MM_Var.java new file mode 100644 index 00000000..1d392209 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_MM_Var.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+public class FT_MM_Var extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Matrix.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Matrix.java new file mode 100644 index 00000000..a3102191 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Matrix.java @@ -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. + * + *
+ * struct FT_Matrix {
+ * FT_Fixed xx;
+ * FT_Fixed xy;
+ * FT_Fixed yx;
+ * FT_Fixed yy;
+ * }
+ */
+public class FT_Matrix extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Memory.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Memory.java new file mode 100644 index 00000000..b22dc128 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Memory.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+@NativeType("struct FT_MemoryRec_")
+public class FT_Memory extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Class.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Class.java new file mode 100644 index 00000000..a634970e --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Class.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+public class FT_Module_Class extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Constructor.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Constructor.java new file mode 100644 index 00000000..9a688163 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Constructor.java @@ -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.*; + +/** + *
+ * FT_Error (*{@link #invoke}) (
+ * FT_Module module
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_ConstructorI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_ConstructorI.java
new file mode 100644
index 00000000..bcf5e91f
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_ConstructorI.java
@@ -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.*;
+
+/**
+ *
+ * FT_Error (*{@link #invoke}) (
+ * FT_Module module
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Destructor.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Destructor.java
new file mode 100644
index 00000000..c19f5ac3
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Destructor.java
@@ -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.*;
+
+/**
+ *
+ * void (*{@link #invoke}) (
+ * FT_Module module
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_DestructorI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_DestructorI.java
new file mode 100644
index 00000000..96a5b185
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_DestructorI.java
@@ -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.*;
+
+/**
+ *
+ * void (*{@link #invoke}) (
+ * FT_Module module
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Requester.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Requester.java
new file mode 100644
index 00000000..2aed1f41
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_Requester.java
@@ -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.*;
+
+/**
+ *
+ * FT_Module_Interface (*{@link #invoke}) (
+ * FT_Module module,
+ * char const *name
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_RequesterI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_RequesterI.java
new file mode 100644
index 00000000..f11dae5d
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Module_RequesterI.java
@@ -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.*;
+
+/**
+ *
+ * FT_Module_Interface (*{@link #invoke}) (
+ * FT_Module module,
+ * char const *name
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Multi_Master.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Multi_Master.java
new file mode 100644
index 00000000..28b4d0dc
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Multi_Master.java
@@ -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.
+ *
+ *
+ * struct FT_Multi_Master {
+ * FT_UInt num_axis;
+ * FT_UInt num_designs;
+ * {@link FT_MM_Axis FT_MM_Axis} axis[T1_MAX_MM_AXIS];
+ * }
+ */
+public class FT_Multi_Master extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_OpaquePaint.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_OpaquePaint.java new file mode 100644 index 00000000..8f321de8 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_OpaquePaint.java @@ -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. + * + *
+ * struct FT_OpaquePaintRec {
+ * FT_Byte * p;
+ * FT_Bool insert_root_transform;
+ * }
+ */
+@NativeType("struct FT_OpaquePaintRec")
+public class FT_OpaquePaint extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Open_Args.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Open_Args.java new file mode 100644 index 00000000..952e2b70 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Open_Args.java @@ -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}. + * + *
+ * 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;
+ * }
+ */
+public class FT_Open_Args extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline.java new file mode 100644 index 00000000..76f53300 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline.java @@ -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. + * + *
+ * 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};
+ * }
+ */
+public class FT_Outline extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_OutlineGlyph.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_OutlineGlyph.java new file mode 100644 index 00000000..5a314bef --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_OutlineGlyph.java @@ -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}. + * + *
+ * struct FT_OutlineGlyphRec {
+ * {@link FT_Glyph FT_GlyphRec} root;
+ * {@link FT_Outline FT_Outline} outline;
+ * }
+ */
+@NativeType("struct FT_OutlineGlyphRec")
+public class FT_OutlineGlyph extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_ConicToFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_ConicToFunc.java new file mode 100644 index 00000000..324fe0c7 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_ConicToFunc.java @@ -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.*; + +/** + *
+ * int (*{@link #invoke}) (
+ * FT_Vector const *control,
+ * FT_Vector const *to,
+ * void *user
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_ConicToFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_ConicToFuncI.java
new file mode 100644
index 00000000..2f708327
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_ConicToFuncI.java
@@ -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.*;
+
+/**
+ *
+ * int (*{@link #invoke}) (
+ * FT_Vector const *control,
+ * FT_Vector const *to,
+ * void *user
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_CubicToFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_CubicToFunc.java
new file mode 100644
index 00000000..964b8658
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_CubicToFunc.java
@@ -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.*;
+
+/**
+ *
+ * int (*{@link #invoke}) (
+ * FT_Vector const *control1,
+ * FT_Vector const *control2,
+ * FT_Vector const *to,
+ * void *user
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_CubicToFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_CubicToFuncI.java
new file mode 100644
index 00000000..b5eeb9db
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_CubicToFuncI.java
@@ -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.*;
+
+/**
+ *
+ * int (*{@link #invoke}) (
+ * FT_Vector const *control1,
+ * FT_Vector const *control2,
+ * FT_Vector const *to,
+ * void *user
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_Funcs.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_Funcs.java
new file mode 100644
index 00000000..be744ffa
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_Funcs.java
@@ -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.
+ *
+ *
+ * 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;
+ * }
+ */
+public class FT_Outline_Funcs extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_LineToFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_LineToFunc.java new file mode 100644 index 00000000..8b215288 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_LineToFunc.java @@ -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.*; + +/** + *
+ * int (*{@link #invoke}) (
+ * FT_Vector const *to,
+ * void *user
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_LineToFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_LineToFuncI.java
new file mode 100644
index 00000000..7043291d
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_LineToFuncI.java
@@ -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.*;
+
+/**
+ *
+ * int (*{@link #invoke}) (
+ * FT_Vector const *to,
+ * void *user
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_MoveToFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_MoveToFunc.java
new file mode 100644
index 00000000..dbf091d1
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_MoveToFunc.java
@@ -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.*;
+
+/**
+ *
+ * int (*{@link #invoke}) (
+ * FT_Vector const *to,
+ * void *user
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_MoveToFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_MoveToFuncI.java
new file mode 100644
index 00000000..b6019594
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Outline_MoveToFuncI.java
@@ -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.*;
+
+/**
+ *
+ * int (*{@link #invoke}) (
+ * FT_Vector const *to,
+ * void *user
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintColrGlyph.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintColrGlyph.java
new file mode 100644
index 00000000..8ae8f5bf
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintColrGlyph.java
@@ -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.
+ *
+ *
+ * struct FT_PaintColrGlyph {
+ * FT_UInt glyphID;
+ * }
+ */
+public class FT_PaintColrGlyph extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintColrLayers.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintColrLayers.java new file mode 100644 index 00000000..ed941bb5 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintColrLayers.java @@ -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. + * + *
+ * struct FT_PaintColrLayers {
+ * {@link FT_LayerIterator FT_LayerIterator} layer_iterator;
+ * }
+ */
+public class FT_PaintColrLayers extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintComposite.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintComposite.java new file mode 100644 index 00000000..f3ec4ba1 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintComposite.java @@ -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. + * + *
+ * struct FT_PaintComposite {
+ * {@link FT_OpaquePaint FT_OpaquePaintRec} source_paint;
+ * FT_Composite_Mode composite_mode;
+ * {@link FT_OpaquePaint FT_OpaquePaintRec} backdrop_paint;
+ * }
+ */
+public class FT_PaintComposite extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintGlyph.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintGlyph.java new file mode 100644 index 00000000..397c0009 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintGlyph.java @@ -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. + * + *
+ * struct FT_PaintGlyph {
+ * {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
+ * FT_UInt glyphID;
+ * }
+ */
+public class FT_PaintGlyph extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintLinearGradient.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintLinearGradient.java new file mode 100644 index 00000000..55a94298 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintLinearGradient.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+public class FT_PaintLinearGradient extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintRadialGradient.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintRadialGradient.java new file mode 100644 index 00000000..e251bfd1 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintRadialGradient.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+public class FT_PaintRadialGradient extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintRotate.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintRotate.java new file mode 100644 index 00000000..3458d154 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintRotate.java @@ -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. + * + *
+ * struct FT_PaintRotate {
+ * {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
+ * FT_Fixed angle;
+ * FT_Fixed center_x;
+ * FT_Fixed center_y;
+ * }
+ */
+public class FT_PaintRotate extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintScale.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintScale.java new file mode 100644 index 00000000..c8b59995 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintScale.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+public class FT_PaintScale extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSkew.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSkew.java new file mode 100644 index 00000000..cd8f4424 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSkew.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+public class FT_PaintSkew extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSolid.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSolid.java new file mode 100644 index 00000000..16fc4126 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSolid.java @@ -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. + * + *
+ * struct FT_PaintSolid {
+ * {@link FT_ColorIndex FT_ColorIndex} color;
+ * }
+ */
+public class FT_PaintSolid extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSweepGradient.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSweepGradient.java new file mode 100644 index 00000000..b95f6b1c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintSweepGradient.java @@ -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. + * + *
+ * struct FT_PaintSweepGradient {
+ * {@link FT_ColorLine FT_ColorLine} colorline;
+ * {@link FT_Vector FT_Vector} center;
+ * FT_Fixed start_angle;
+ * FT_Fixed end_angle;
+ * }
+ */
+public class FT_PaintSweepGradient extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintTransform.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintTransform.java new file mode 100644 index 00000000..bfffeacf --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintTransform.java @@ -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. + * + *
+ * struct FT_PaintTransform {
+ * {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
+ * {@link FT_Affine23 FT_Affine23} affine;
+ * }
+ */
+public class FT_PaintTransform extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintTranslate.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintTranslate.java new file mode 100644 index 00000000..f68064c3 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_PaintTranslate.java @@ -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. + * + *
+ * struct FT_PaintTranslate {
+ * {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
+ * FT_Fixed dx;
+ * FT_Fixed dy;
+ * }
+ */
+public class FT_PaintTranslate extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Palette_Data.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Palette_Data.java new file mode 100644 index 00000000..399f30bb --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Palette_Data.java @@ -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. + * + *
+ * 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;
+ * }
+ */
+public class FT_Palette_Data extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Parameter.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Parameter.java new file mode 100644 index 00000000..153604a4 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Parameter.java @@ -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}. + * + *
+ * struct FT_Parameter {
+ * FT_ULong tag;
+ * FT_Pointer data;
+ * }
+ */
+public class FT_Parameter extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Prop_GlyphToScriptMap.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Prop_GlyphToScriptMap.java new file mode 100644 index 00000000..f497b363 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Prop_GlyphToScriptMap.java @@ -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. + * + *
+ * struct FT_Prop_GlyphToScriptMap {
+ * {@link FT_Face FT_Face} face;
+ * FT_UShort * map;
+ * }
+ */
+public class FT_Prop_GlyphToScriptMap extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Prop_IncreaseXHeight.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Prop_IncreaseXHeight.java new file mode 100644 index 00000000..a024bb78 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Prop_IncreaseXHeight.java @@ -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. + * + *
+ * struct FT_Prop_IncreaseXHeight {
+ * {@link FT_Face FT_Face} face;
+ * FT_UInt limit;
+ * }
+ */
+public class FT_Prop_IncreaseXHeight extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_DoneFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_DoneFunc.java new file mode 100644 index 00000000..8b51a7ad --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_DoneFunc.java @@ -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.*; + +/** + *
+ * void (*{@link #invoke}) (
+ * FT_Raster raster
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_DoneFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_DoneFuncI.java
new file mode 100644
index 00000000..830d3109
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_DoneFuncI.java
@@ -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.*;
+
+/**
+ *
+ * void (*{@link #invoke}) (
+ * FT_Raster raster
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_Funcs.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_Funcs.java
new file mode 100644
index 00000000..e4881cad
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_Funcs.java
@@ -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.
+ *
+ *
+ * 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;
+ * }
+ */
+public class FT_Raster_Funcs extends StructThe created instance holds a strong reference to the container object.
+ */ + 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 StructBufferChanges 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.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_NewFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_NewFunc.java new file mode 100644 index 00000000..d033ff5a --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_NewFunc.java @@ -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.*; + +/** + *
+ * int (*{@link #invoke}) (
+ * void *memory,
+ * FT_Raster *raster
+ * )
+ */
+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);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_NewFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_NewFuncI.java
new file mode 100644
index 00000000..7b89f11c
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_NewFuncI.java
@@ -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.*;
+
+/**
+ *
+ * int (*{@link #invoke}) (
+ * void *memory,
+ * FT_Raster *raster
+ * )
+ */
+@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);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_Params.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_Params.java
new file mode 100644
index 00000000..2f918945
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_Params.java
@@ -0,0 +1,397 @@
+/*
+ * 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 the parameters used by a raster's render function, passed as an argument to {@link FreeType#FT_Outline_Render Outline_Render}.
+ *
+ *
+ * struct FT_Raster_Params {
+ * {@link FT_Bitmap FT_Bitmap} const * target;
+ * void const * source;
+ * int flags;
+ * {@link FT_SpanFuncI FT_SpanFunc} gray_spans;
+ * {@link FT_SpanFuncI FT_SpanFunc} black_spans;
+ * FT_Raster_BitTest_Func bit_test;
+ * FT_Raster_BitTest_Func bit_set;
+ * void * user;
+ * {@link FT_BBox FT_BBox} clip_box;
+ * }
+ */
+public class FT_Raster_Params extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_Raster_Params(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return a {@link FT_Bitmap} view of the struct pointed to by the {@code target} field. */ + @Nullable + @NativeType("FT_Bitmap const *") + public FT_Bitmap target() { return ntarget(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code source} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void const *") + public ByteBuffer source(int capacity) { return nsource(address(), capacity); } + /** @return the value of the {@code flags} field. */ + public int flags() { return nflags(address()); } + /** @return the value of the {@code gray_spans} field. */ + @Nullable + public FT_SpanFunc gray_spans() { return ngray_spans(address()); } + /** @return the value of the {@code user} field. */ + @NativeType("void *") + public long user() { return nuser(address()); } + /** @return a {@link FT_BBox} view of the {@code clip_box} field. */ + public FT_BBox clip_box() { return nclip_box(address()); } + + /** Sets the address of the specified {@link FT_Bitmap} to the {@code target} field. */ + public FT_Raster_Params target(@Nullable @NativeType("FT_Bitmap const *") FT_Bitmap value) { ntarget(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code source} field. */ + public FT_Raster_Params source(@Nullable @NativeType("void const *") ByteBuffer value) { nsource(address(), value); return this; } + /** Sets the specified value to the {@code flags} field. */ + public FT_Raster_Params flags(int value) { nflags(address(), value); return this; } + /** Sets the specified value to the {@code gray_spans} field. */ + public FT_Raster_Params gray_spans(@Nullable @NativeType("FT_SpanFunc") FT_SpanFuncI value) { ngray_spans(address(), value); return this; } + /** Sets the specified value to the {@code user} field. */ + public FT_Raster_Params user(@NativeType("void *") long value) { nuser(address(), value); return this; } + /** Copies the specified {@link FT_BBox} to the {@code clip_box} field. */ + public FT_Raster_Params clip_box(FT_BBox value) { nclip_box(address(), value); return this; } + /** Passes the {@code clip_box} field to the specified {@link java.util.function.Consumer Consumer}. */ + public FT_Raster_Params clip_box(java.util.function.ConsumerChanges 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_Params#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_Params getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_Bitmap} view of the struct pointed to by the {@code target} field. */ + @Nullable + @NativeType("FT_Bitmap const *") + public FT_Bitmap target() { return FT_Raster_Params.ntarget(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code source} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void const *") + public ByteBuffer source(int capacity) { return FT_Raster_Params.nsource(address(), capacity); } + /** @return the value of the {@code flags} field. */ + public int flags() { return FT_Raster_Params.nflags(address()); } + /** @return the value of the {@code gray_spans} field. */ + @Nullable + public FT_SpanFunc gray_spans() { return FT_Raster_Params.ngray_spans(address()); } + /** @return the value of the {@code user} field. */ + @NativeType("void *") + public long user() { return FT_Raster_Params.nuser(address()); } + /** @return a {@link FT_BBox} view of the {@code clip_box} field. */ + public FT_BBox clip_box() { return FT_Raster_Params.nclip_box(address()); } + + /** Sets the address of the specified {@link FT_Bitmap} to the {@code target} field. */ + public Buffer target(@Nullable @NativeType("FT_Bitmap const *") FT_Bitmap value) { FT_Raster_Params.ntarget(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code source} field. */ + public Buffer source(@Nullable @NativeType("void const *") ByteBuffer value) { FT_Raster_Params.nsource(address(), value); return this; } + /** Sets the specified value to the {@code flags} field. */ + public Buffer flags(int value) { FT_Raster_Params.nflags(address(), value); return this; } + /** Sets the specified value to the {@code gray_spans} field. */ + public Buffer gray_spans(@Nullable @NativeType("FT_SpanFunc") FT_SpanFuncI value) { FT_Raster_Params.ngray_spans(address(), value); return this; } + /** Sets the specified value to the {@code user} field. */ + public Buffer user(@NativeType("void *") long value) { FT_Raster_Params.nuser(address(), value); return this; } + /** Copies the specified {@link FT_BBox} to the {@code clip_box} field. */ + public Buffer clip_box(FT_BBox value) { FT_Raster_Params.nclip_box(address(), value); return this; } + /** Passes the {@code clip_box} field to the specified {@link java.util.function.Consumer Consumer}. */ + public Buffer clip_box(java.util.function.Consumer
+ * int (*{@link #invoke}) (
+ * FT_Raster raster,
+ * FT_Raster_Params const *params
+ * )
+ */
+public abstract class FT_Raster_RenderFunc extends Callback implements FT_Raster_RenderFuncI {
+
+ /**
+ * Creates a {@code FT_Raster_RenderFunc} instance from the specified function pointer.
+ *
+ * @return the new {@code FT_Raster_RenderFunc}
+ */
+ public static FT_Raster_RenderFunc create(long functionPointer) {
+ FT_Raster_RenderFuncI instance = Callback.get(functionPointer);
+ return instance instanceof FT_Raster_RenderFunc
+ ? (FT_Raster_RenderFunc)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_RenderFunc createSafe(long functionPointer) {
+ return functionPointer == NULL ? null : create(functionPointer);
+ }
+
+ /** Creates a {@code FT_Raster_RenderFunc} instance that delegates to the specified {@code FT_Raster_RenderFuncI} instance. */
+ public static FT_Raster_RenderFunc create(FT_Raster_RenderFuncI instance) {
+ return instance instanceof FT_Raster_RenderFunc
+ ? (FT_Raster_RenderFunc)instance
+ : new Container(instance.address(), instance);
+ }
+
+ protected FT_Raster_RenderFunc() {
+ super(CIF);
+ }
+
+ FT_Raster_RenderFunc(long functionPointer) {
+ super(functionPointer);
+ }
+
+ private static final class Container extends FT_Raster_RenderFunc {
+
+ private final FT_Raster_RenderFuncI delegate;
+
+ Container(long functionPointer, FT_Raster_RenderFuncI delegate) {
+ super(functionPointer);
+ this.delegate = delegate;
+ }
+
+ @Override
+ public int invoke(long raster, long params) {
+ return delegate.invoke(raster, params);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_RenderFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_RenderFuncI.java
new file mode 100644
index 00000000..144db4fa
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_RenderFuncI.java
@@ -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.*;
+
+/**
+ *
+ * int (*{@link #invoke}) (
+ * FT_Raster raster,
+ * FT_Raster_Params const *params
+ * )
+ */
+@FunctionalInterface
+@NativeType("FT_Raster_RenderFunc")
+public interface FT_Raster_RenderFuncI 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);
+ }
+
+ /** Invoke a given raster to scan-convert a given glyph image into a target bitmap. */
+ int invoke(@NativeType("FT_Raster") long raster, @NativeType("FT_Raster_Params const *") long params);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_ResetFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_ResetFunc.java
new file mode 100644
index 00000000..59d7dc3e
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_ResetFunc.java
@@ -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.*;
+
+/**
+ *
+ * void (*{@link #invoke}) (
+ * FT_Raster raster,
+ * unsigned char *pool_base,
+ * unsigned long pool_size
+ * )
+ */
+public abstract class FT_Raster_ResetFunc extends Callback implements FT_Raster_ResetFuncI {
+
+ /**
+ * Creates a {@code FT_Raster_ResetFunc} instance from the specified function pointer.
+ *
+ * @return the new {@code FT_Raster_ResetFunc}
+ */
+ public static FT_Raster_ResetFunc create(long functionPointer) {
+ FT_Raster_ResetFuncI instance = Callback.get(functionPointer);
+ return instance instanceof FT_Raster_ResetFunc
+ ? (FT_Raster_ResetFunc)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_ResetFunc createSafe(long functionPointer) {
+ return functionPointer == NULL ? null : create(functionPointer);
+ }
+
+ /** Creates a {@code FT_Raster_ResetFunc} instance that delegates to the specified {@code FT_Raster_ResetFuncI} instance. */
+ public static FT_Raster_ResetFunc create(FT_Raster_ResetFuncI instance) {
+ return instance instanceof FT_Raster_ResetFunc
+ ? (FT_Raster_ResetFunc)instance
+ : new Container(instance.address(), instance);
+ }
+
+ protected FT_Raster_ResetFunc() {
+ super(CIF);
+ }
+
+ FT_Raster_ResetFunc(long functionPointer) {
+ super(functionPointer);
+ }
+
+ private static final class Container extends FT_Raster_ResetFunc {
+
+ private final FT_Raster_ResetFuncI delegate;
+
+ Container(long functionPointer, FT_Raster_ResetFuncI delegate) {
+ super(functionPointer);
+ this.delegate = delegate;
+ }
+
+ @Override
+ public void invoke(long raster, long pool_base, long pool_size) {
+ delegate.invoke(raster, pool_base, pool_size);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_ResetFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_ResetFuncI.java
new file mode 100644
index 00000000..ff0ab45d
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_ResetFuncI.java
@@ -0,0 +1,55 @@
+/*
+ * 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.*;
+
+/**
+ *
+ * void (*{@link #invoke}) (
+ * FT_Raster raster,
+ * unsigned char *pool_base,
+ * unsigned long pool_size
+ * )
+ */
+@FunctionalInterface
+@NativeType("FT_Raster_ResetFunc")
+public interface FT_Raster_ResetFuncI extends CallbackI {
+
+ FFICIF CIF = apiCreateCIF(
+ FFI_DEFAULT_ABI,
+ ffi_type_void,
+ ffi_type_pointer, ffi_type_pointer, ffi_type_ulong
+ );
+
+ @Override
+ default FFICIF getCallInterface() { return CIF; }
+
+ @Override
+ default void callback(long ret, long args) {
+ invoke(
+ memGetAddress(memGetAddress(args)),
+ memGetAddress(memGetAddress(args + POINTER_SIZE)),
+ memGetCLong(memGetAddress(args + 2 * POINTER_SIZE))
+ );
+ }
+
+ /**
+ * FreeType used to provide an area of memory called the 'render pool' available to all registered rasterizers. This was not thread safe, however, and now
+ * FreeType never allocates this pool.
+ *
+ * This function is called after a new raster object is created.
+ */ + void invoke(@NativeType("FT_Raster") long raster, @NativeType("unsigned char *") long pool_base, @NativeType("unsigned long") long pool_size); + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_SetModeFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_SetModeFunc.java new file mode 100644 index 00000000..f987583c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_SetModeFunc.java @@ -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.*; + +/** + *
+ * int (*{@link #invoke}) (
+ * FT_Raster raster,
+ * unsigned long mode,
+ * void *args
+ * )
+ */
+public abstract class FT_Raster_SetModeFunc extends Callback implements FT_Raster_SetModeFuncI {
+
+ /**
+ * Creates a {@code FT_Raster_SetModeFunc} instance from the specified function pointer.
+ *
+ * @return the new {@code FT_Raster_SetModeFunc}
+ */
+ public static FT_Raster_SetModeFunc create(long functionPointer) {
+ FT_Raster_SetModeFuncI instance = Callback.get(functionPointer);
+ return instance instanceof FT_Raster_SetModeFunc
+ ? (FT_Raster_SetModeFunc)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_SetModeFunc createSafe(long functionPointer) {
+ return functionPointer == NULL ? null : create(functionPointer);
+ }
+
+ /** Creates a {@code FT_Raster_SetModeFunc} instance that delegates to the specified {@code FT_Raster_SetModeFuncI} instance. */
+ public static FT_Raster_SetModeFunc create(FT_Raster_SetModeFuncI instance) {
+ return instance instanceof FT_Raster_SetModeFunc
+ ? (FT_Raster_SetModeFunc)instance
+ : new Container(instance.address(), instance);
+ }
+
+ protected FT_Raster_SetModeFunc() {
+ super(CIF);
+ }
+
+ FT_Raster_SetModeFunc(long functionPointer) {
+ super(functionPointer);
+ }
+
+ private static final class Container extends FT_Raster_SetModeFunc {
+
+ private final FT_Raster_SetModeFuncI delegate;
+
+ Container(long functionPointer, FT_Raster_SetModeFuncI delegate) {
+ super(functionPointer);
+ this.delegate = delegate;
+ }
+
+ @Override
+ public int invoke(long raster, long mode, long args) {
+ return delegate.invoke(raster, mode, args);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_SetModeFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_SetModeFuncI.java
new file mode 100644
index 00000000..d8a031c7
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Raster_SetModeFuncI.java
@@ -0,0 +1,54 @@
+/*
+ * 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.*;
+
+/**
+ *
+ * int (*{@link #invoke}) (
+ * FT_Raster raster,
+ * unsigned long mode,
+ * void *args
+ * )
+ */
+@FunctionalInterface
+@NativeType("FT_Raster_SetModeFunc")
+public interface FT_Raster_SetModeFuncI extends CallbackI {
+
+ FFICIF CIF = apiCreateCIF(
+ FFI_DEFAULT_ABI,
+ ffi_type_sint32,
+ ffi_type_pointer, ffi_type_ulong, ffi_type_pointer
+ );
+
+ @Override
+ default FFICIF getCallInterface() { return CIF; }
+
+ @Override
+ default void callback(long ret, long args) {
+ int __result = invoke(
+ memGetAddress(memGetAddress(args)),
+ memGetCLong(memGetAddress(args + POINTER_SIZE)),
+ memGetAddress(memGetAddress(args + 2 * POINTER_SIZE))
+ );
+ apiClosureRet(ret, __result);
+ }
+
+ /**
+ * This function is a generic facility to change modes or attributes in a given raster. This can be used for debugging purposes, or simply
+ * to allow implementation-specific 'features' in a given raster module.
+ */
+ int invoke(@NativeType("FT_Raster") long raster, @NativeType("unsigned long") long mode, @NativeType("void *") long args);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Realloc_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Realloc_Func.java
new file mode 100644
index 00000000..dc4ed70f
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Realloc_Func.java
@@ -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.*;
+
+/**
+ *
+ * void * (*{@link #invoke}) (
+ * FT_Memory memory,
+ * long cur_size,
+ * long new_size,
+ * void *block
+ * )
+ */
+public abstract class FT_Realloc_Func extends Callback implements FT_Realloc_FuncI {
+
+ /**
+ * Creates a {@code FT_Realloc_Func} instance from the specified function pointer.
+ *
+ * @return the new {@code FT_Realloc_Func}
+ */
+ public static FT_Realloc_Func create(long functionPointer) {
+ FT_Realloc_FuncI instance = Callback.get(functionPointer);
+ return instance instanceof FT_Realloc_Func
+ ? (FT_Realloc_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_Realloc_Func createSafe(long functionPointer) {
+ return functionPointer == NULL ? null : create(functionPointer);
+ }
+
+ /** Creates a {@code FT_Realloc_Func} instance that delegates to the specified {@code FT_Realloc_FuncI} instance. */
+ public static FT_Realloc_Func create(FT_Realloc_FuncI instance) {
+ return instance instanceof FT_Realloc_Func
+ ? (FT_Realloc_Func)instance
+ : new Container(instance.address(), instance);
+ }
+
+ protected FT_Realloc_Func() {
+ super(CIF);
+ }
+
+ FT_Realloc_Func(long functionPointer) {
+ super(functionPointer);
+ }
+
+ private static final class Container extends FT_Realloc_Func {
+
+ private final FT_Realloc_FuncI delegate;
+
+ Container(long functionPointer, FT_Realloc_FuncI delegate) {
+ super(functionPointer);
+ this.delegate = delegate;
+ }
+
+ @Override
+ public long invoke(long memory, long cur_size, long new_size, long block) {
+ return delegate.invoke(memory, cur_size, new_size, block);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Realloc_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Realloc_FuncI.java
new file mode 100644
index 00000000..ae94e191
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Realloc_FuncI.java
@@ -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.*;
+
+/**
+ *
+ * void * (*{@link #invoke}) (
+ * FT_Memory memory,
+ * long cur_size,
+ * long new_size,
+ * void *block
+ * )
+ */
+@FunctionalInterface
+@NativeType("FT_Realloc_Func")
+public interface FT_Realloc_FuncI extends CallbackI {
+
+ FFICIF CIF = apiCreateCIF(
+ FFI_DEFAULT_ABI,
+ ffi_type_pointer,
+ ffi_type_pointer, ffi_type_slong, ffi_type_slong, ffi_type_pointer
+ );
+
+ @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)),
+ memGetCLong(memGetAddress(args + 2 * POINTER_SIZE)),
+ memGetAddress(memGetAddress(args + 3 * POINTER_SIZE))
+ );
+ apiClosureRetP(ret, __result);
+ }
+
+ /** A function used to re-allocate a given block of memory. */
+ @NativeType("void *") long invoke(@NativeType("FT_Memory") long memory, long cur_size, long new_size, @NativeType("void *") long block);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SVG_Document.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SVG_Document.java
new file mode 100644
index 00000000..c4f22acf
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SVG_Document.java
@@ -0,0 +1,232 @@
+/*
+ * 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 that models one SVG document.
+ *
+ *
+ * struct FT_SVG_DocumentRec {
+ * FT_Byte * svg_document;
+ * FT_ULong svg_document_length;
+ * {@link FT_Size_Metrics FT_Size_Metrics} metrics;
+ * FT_UShort units_per_EM;
+ * FT_UShort start_glyph_id;
+ * FT_UShort end_glyph_id;
+ * {@link FT_Matrix FT_Matrix} transform;
+ * {@link FT_Vector FT_Vector} delta;
+ * }
+ */
+@NativeType("struct FT_SVG_DocumentRec")
+public class FT_SVG_Document extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_SVG_Document(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 svg_document} field. */ + @NativeType("FT_Byte *") + public ByteBuffer svg_document() { return nsvg_document(address()); } + /** @return the value of the {@code svg_document_length} field. */ + @NativeType("FT_ULong") + public long svg_document_length() { return nsvg_document_length(address()); } + /** @return a {@link FT_Size_Metrics} view of the {@code metrics} field. */ + public FT_Size_Metrics metrics() { return nmetrics(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 start_glyph_id} field. */ + @NativeType("FT_UShort") + public short start_glyph_id() { return nstart_glyph_id(address()); } + /** @return the value of the {@code end_glyph_id} field. */ + @NativeType("FT_UShort") + public short end_glyph_id() { return nend_glyph_id(address()); } + /** @return a {@link FT_Matrix} view of the {@code transform} field. */ + public FT_Matrix transform() { return ntransform(address()); } + /** @return a {@link FT_Vector} view of the {@code delta} field. */ + public FT_Vector delta() { return ndelta(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_SVG_Document} instance for the specified memory address. */ + public static FT_SVG_Document create(long address) { + return new FT_SVG_Document(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_SVG_Document createSafe(long address) { + return address == NULL ? null : new FT_SVG_Document(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 #svg_document() svg_document}. */ + public static ByteBuffer nsvg_document(long struct) { return memByteBuffer(memGetAddress(struct + FT_SVG_Document.SVG_DOCUMENT), (int)nsvg_document_length(struct)); } + /** Unsafe version of {@link #svg_document_length}. */ + public static long nsvg_document_length(long struct) { return memGetCLong(struct + FT_SVG_Document.SVG_DOCUMENT_LENGTH); } + /** Unsafe version of {@link #metrics}. */ + public static FT_Size_Metrics nmetrics(long struct) { return FT_Size_Metrics.create(struct + FT_SVG_Document.METRICS); } + /** Unsafe version of {@link #units_per_EM}. */ + public static short nunits_per_EM(long struct) { return UNSAFE.getShort(null, struct + FT_SVG_Document.UNITS_PER_EM); } + /** Unsafe version of {@link #start_glyph_id}. */ + public static short nstart_glyph_id(long struct) { return UNSAFE.getShort(null, struct + FT_SVG_Document.START_GLYPH_ID); } + /** Unsafe version of {@link #end_glyph_id}. */ + public static short nend_glyph_id(long struct) { return UNSAFE.getShort(null, struct + FT_SVG_Document.END_GLYPH_ID); } + /** Unsafe version of {@link #transform}. */ + public static FT_Matrix ntransform(long struct) { return FT_Matrix.create(struct + FT_SVG_Document.TRANSFORM); } + /** Unsafe version of {@link #delta}. */ + public static FT_Vector ndelta(long struct) { return FT_Vector.create(struct + FT_SVG_Document.DELTA); } + + // ----------------------------------- + + /** An array of {@link FT_SVG_Document} structs. */ + public static class Buffer extends StructBufferChanges 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_SVG_Document#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_SVG_Document getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code svg_document} field. */ + @NativeType("FT_Byte *") + public ByteBuffer svg_document() { return FT_SVG_Document.nsvg_document(address()); } + /** @return the value of the {@code svg_document_length} field. */ + @NativeType("FT_ULong") + public long svg_document_length() { return FT_SVG_Document.nsvg_document_length(address()); } + /** @return a {@link FT_Size_Metrics} view of the {@code metrics} field. */ + public FT_Size_Metrics metrics() { return FT_SVG_Document.nmetrics(address()); } + /** @return the value of the {@code units_per_EM} field. */ + @NativeType("FT_UShort") + public short units_per_EM() { return FT_SVG_Document.nunits_per_EM(address()); } + /** @return the value of the {@code start_glyph_id} field. */ + @NativeType("FT_UShort") + public short start_glyph_id() { return FT_SVG_Document.nstart_glyph_id(address()); } + /** @return the value of the {@code end_glyph_id} field. */ + @NativeType("FT_UShort") + public short end_glyph_id() { return FT_SVG_Document.nend_glyph_id(address()); } + /** @return a {@link FT_Matrix} view of the {@code transform} field. */ + public FT_Matrix transform() { return FT_SVG_Document.ntransform(address()); } + /** @return a {@link FT_Vector} view of the {@code delta} field. */ + public FT_Vector delta() { return FT_SVG_Document.ndelta(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SfntLangTag.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SfntLangTag.java new file mode 100644 index 00000000..636bc77a --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SfntLangTag.java @@ -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.*; + +/** + *
+ * struct FT_SfntLangTag {
+ * FT_Byte * string;
+ * FT_UInt string_len;
+ * }
+ */
+public class FT_SfntLangTag extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_SfntLangTag(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 string} field. */ + @NativeType("FT_Byte *") + public ByteBuffer string() { return nstring(address()); } + /** @return the value of the {@code string_len} field. */ + @NativeType("FT_UInt") + public int string_len() { return nstring_len(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_SfntLangTag} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_SfntLangTag malloc() { + return new FT_SfntLangTag(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_SfntLangTag} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_SfntLangTag calloc() { + return new FT_SfntLangTag(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_SfntLangTag} instance allocated with {@link BufferUtils}. */ + public static FT_SfntLangTag create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_SfntLangTag(memAddress(container), container); + } + + /** Returns a new {@code FT_SfntLangTag} instance for the specified memory address. */ + public static FT_SfntLangTag create(long address) { + return new FT_SfntLangTag(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_SfntLangTag createSafe(long address) { + return address == NULL ? null : new FT_SfntLangTag(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_SfntLangTag} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_SfntLangTag malloc(MemoryStack stack) { + return new FT_SfntLangTag(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_SfntLangTag} 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_SfntLangTag calloc(MemoryStack stack) { + return new FT_SfntLangTag(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 #string() string}. */ + public static ByteBuffer nstring(long struct) { return memByteBuffer(memGetAddress(struct + FT_SfntLangTag.STRING), nstring_len(struct)); } + /** Unsafe version of {@link #string_len}. */ + public static int nstring_len(long struct) { return UNSAFE.getInt(null, struct + FT_SfntLangTag.STRING_LEN); } + + // ----------------------------------- + + /** An array of {@link FT_SfntLangTag} structs. */ + public static class Buffer extends StructBufferChanges 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_SfntLangTag#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_SfntLangTag getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code string} field. */ + @NativeType("FT_Byte *") + public ByteBuffer string() { return FT_SfntLangTag.nstring(address()); } + /** @return the value of the {@code string_len} field. */ + @NativeType("FT_UInt") + public int string_len() { return FT_SfntLangTag.nstring_len(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SfntName.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SfntName.java new file mode 100644 index 00000000..eb26b887 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SfntName.java @@ -0,0 +1,295 @@ +/* + * 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.*; + +/** + *
+ * struct FT_SfntName {
+ * FT_UShort platform_id;
+ * FT_UShort encoding_id;
+ * FT_UShort language_id;
+ * FT_UShort name_id;
+ * FT_Byte * string;
+ * FT_UInt string_len;
+ * }
+ */
+public class FT_SfntName extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_SfntName(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code platform_id} field. */ + @NativeType("FT_UShort") + public short platform_id() { return nplatform_id(address()); } + /** @return the value of the {@code encoding_id} field. */ + @NativeType("FT_UShort") + public short encoding_id() { return nencoding_id(address()); } + /** @return the value of the {@code language_id} field. */ + @NativeType("FT_UShort") + public short language_id() { return nlanguage_id(address()); } + /** @return the value of the {@code name_id} field. */ + @NativeType("FT_UShort") + public short name_id() { return nname_id(address()); } + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code string} field. */ + @NativeType("FT_Byte *") + public ByteBuffer string() { return nstring(address()); } + /** @return the value of the {@code string_len} field. */ + @NativeType("FT_UInt") + public int string_len() { return nstring_len(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_SfntName} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_SfntName malloc() { + return new FT_SfntName(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_SfntName} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_SfntName calloc() { + return new FT_SfntName(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_SfntName} instance allocated with {@link BufferUtils}. */ + public static FT_SfntName create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_SfntName(memAddress(container), container); + } + + /** Returns a new {@code FT_SfntName} instance for the specified memory address. */ + public static FT_SfntName create(long address) { + return new FT_SfntName(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_SfntName createSafe(long address) { + return address == NULL ? null : new FT_SfntName(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_SfntName} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_SfntName malloc(MemoryStack stack) { + return new FT_SfntName(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_SfntName} 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_SfntName calloc(MemoryStack stack) { + return new FT_SfntName(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 #platform_id}. */ + public static short nplatform_id(long struct) { return UNSAFE.getShort(null, struct + FT_SfntName.PLATFORM_ID); } + /** Unsafe version of {@link #encoding_id}. */ + public static short nencoding_id(long struct) { return UNSAFE.getShort(null, struct + FT_SfntName.ENCODING_ID); } + /** Unsafe version of {@link #language_id}. */ + public static short nlanguage_id(long struct) { return UNSAFE.getShort(null, struct + FT_SfntName.LANGUAGE_ID); } + /** Unsafe version of {@link #name_id}. */ + public static short nname_id(long struct) { return UNSAFE.getShort(null, struct + FT_SfntName.NAME_ID); } + /** Unsafe version of {@link #string() string}. */ + public static ByteBuffer nstring(long struct) { return memByteBuffer(memGetAddress(struct + FT_SfntName.STRING), nstring_len(struct)); } + /** Unsafe version of {@link #string_len}. */ + public static int nstring_len(long struct) { return UNSAFE.getInt(null, struct + FT_SfntName.STRING_LEN); } + + // ----------------------------------- + + /** An array of {@link FT_SfntName} structs. */ + public static class Buffer extends StructBufferChanges 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_SfntName#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_SfntName getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code platform_id} field. */ + @NativeType("FT_UShort") + public short platform_id() { return FT_SfntName.nplatform_id(address()); } + /** @return the value of the {@code encoding_id} field. */ + @NativeType("FT_UShort") + public short encoding_id() { return FT_SfntName.nencoding_id(address()); } + /** @return the value of the {@code language_id} field. */ + @NativeType("FT_UShort") + public short language_id() { return FT_SfntName.nlanguage_id(address()); } + /** @return the value of the {@code name_id} field. */ + @NativeType("FT_UShort") + public short name_id() { return FT_SfntName.nname_id(address()); } + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code string} field. */ + @NativeType("FT_Byte *") + public ByteBuffer string() { return FT_SfntName.nstring(address()); } + /** @return the value of the {@code string_len} field. */ + @NativeType("FT_UInt") + public int string_len() { return FT_SfntName.nstring_len(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size.java new file mode 100644 index 00000000..bc76589c --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size.java @@ -0,0 +1,323 @@ +/* + * 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.*; + +/** + * FreeType root size class structure. A size object models a face object at a given size. + * + *
+ * struct FT_SizeRec {
+ * {@link FT_Face FT_Face} {@link #face};
+ * {@link FT_Generic FT_Generic} {@link #generic};
+ * {@link FT_Size_Metrics FT_Size_Metrics} {@link #metrics};
+ * {@link FT_Size_Internal FT_Size_Internal} * internal;
+ * }
+ */
+@NativeType("struct FT_SizeRec")
+public class FT_Size extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_Size(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** parent face object */ + public FT_Face face() { return nface(address()); } + /** generic pointer for client uses */ + public FT_Generic generic() { return ngeneric(address()); } + /** size metrics */ + public FT_Size_Metrics metrics() { return nmetrics(address()); } + + /** Sets the address of the specified {@link FT_Face} to the {@link #face} field. */ + public FT_Size face(FT_Face value) { nface(address(), value); return this; } + /** Copies the specified {@link FT_Generic} to the {@link #generic} field. */ + public FT_Size generic(FT_Generic value) { ngeneric(address(), value); return this; } + /** Passes the {@link #generic} field to the specified {@link java.util.function.Consumer Consumer}. */ + public FT_Size generic(java.util.function.ConsumerChanges 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_Size#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_Size getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_Face} view of the struct pointed to by the {@link FT_Size#face} field. */ + public FT_Face face() { return FT_Size.nface(address()); } + /** @return a {@link FT_Generic} view of the {@link FT_Size#generic} field. */ + public FT_Generic generic() { return FT_Size.ngeneric(address()); } + /** @return a {@link FT_Size_Metrics} view of the {@link FT_Size#metrics} field. */ + public FT_Size_Metrics metrics() { return FT_Size.nmetrics(address()); } + + /** Sets the address of the specified {@link FT_Face} to the {@link FT_Size#face} field. */ + public Buffer face(FT_Face value) { FT_Size.nface(address(), value); return this; } + /** Copies the specified {@link FT_Generic} to the {@link FT_Size#generic} field. */ + public Buffer generic(FT_Generic value) { FT_Size.ngeneric(address(), value); return this; } + /** Passes the {@link FT_Size#generic} field to the specified {@link java.util.function.Consumer Consumer}. */ + public Buffer generic(java.util.function.Consumer
+ * struct FT_Size_Internal {
+ * void * module_data;
+ * FT_Render_Mode autohint_mode;
+ * {@link FT_Size_Metrics FT_Size_Metrics} autohint_metrics;
+ * }
+ */
+public class FT_Size_Internal extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_Size_Internal(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code module_data} field. */ + @NativeType("void *") + public long module_data() { return nmodule_data(address()); } + /** @return the value of the {@code autohint_mode} field. */ + @NativeType("FT_Render_Mode") + public int autohint_mode() { return nautohint_mode(address()); } + /** @return a {@link FT_Size_Metrics} view of the {@code autohint_metrics} field. */ + public FT_Size_Metrics autohint_metrics() { return nautohint_metrics(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Size_Internal} instance for the specified memory address. */ + public static FT_Size_Internal create(long address) { + return new FT_Size_Internal(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Size_Internal createSafe(long address) { + return address == NULL ? null : new FT_Size_Internal(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 #module_data}. */ + public static long nmodule_data(long struct) { return memGetAddress(struct + FT_Size_Internal.MODULE_DATA); } + /** Unsafe version of {@link #autohint_mode}. */ + public static int nautohint_mode(long struct) { return UNSAFE.getInt(null, struct + FT_Size_Internal.AUTOHINT_MODE); } + /** Unsafe version of {@link #autohint_metrics}. */ + public static FT_Size_Metrics nautohint_metrics(long struct) { return FT_Size_Metrics.create(struct + FT_Size_Internal.AUTOHINT_METRICS); } + + // ----------------------------------- + + /** An array of {@link FT_Size_Internal} structs. */ + public static class Buffer extends StructBufferChanges 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_Size_Internal#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_Size_Internal getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code module_data} field. */ + @NativeType("void *") + public long module_data() { return FT_Size_Internal.nmodule_data(address()); } + /** @return the value of the {@code autohint_mode} field. */ + @NativeType("FT_Render_Mode") + public int autohint_mode() { return FT_Size_Internal.nautohint_mode(address()); } + /** @return a {@link FT_Size_Metrics} view of the {@code autohint_metrics} field. */ + public FT_Size_Metrics autohint_metrics() { return FT_Size_Internal.nautohint_metrics(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Metrics.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Metrics.java new file mode 100644 index 00000000..5317bf62 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Metrics.java @@ -0,0 +1,237 @@ +/* + * 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 size metrics structure gives the metrics of a size object. + * + *
+ * struct FT_Size_Metrics {
+ * FT_UShort {@link #x_ppem};
+ * FT_UShort {@link #y_ppem};
+ * FT_Fixed {@link #x_scale};
+ * FT_Fixed {@link #y_scale};
+ * FT_Pos {@link #ascender};
+ * FT_Pos {@link #descender};
+ * FT_Pos {@link #height};
+ * FT_Pos {@link #max_advance};
+ * }
+ */
+public class FT_Size_Metrics extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_Size_Metrics(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** horizontal pixels per EM */ + @NativeType("FT_UShort") + public short x_ppem() { return nx_ppem(address()); } + /** vertical pixels per EM */ + @NativeType("FT_UShort") + public short y_ppem() { return ny_ppem(address()); } + /** scaling values used to convert font */ + @NativeType("FT_Fixed") + public long x_scale() { return nx_scale(address()); } + /** units to 26.6 fractional pixels */ + @NativeType("FT_Fixed") + public long y_scale() { return ny_scale(address()); } + /** ascender in 26.6 frac. pixels */ + @NativeType("FT_Pos") + public long ascender() { return nascender(address()); } + /** descender in 26.6 frac. pixels */ + @NativeType("FT_Pos") + public long descender() { return ndescender(address()); } + /** text height in 26.6 frac. pixels */ + @NativeType("FT_Pos") + public long height() { return nheight(address()); } + /** max horizontal advance, in 26.6 pixels */ + @NativeType("FT_Pos") + public long max_advance() { return nmax_advance(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Size_Metrics} instance for the specified memory address. */ + public static FT_Size_Metrics create(long address) { + return new FT_Size_Metrics(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Size_Metrics createSafe(long address) { + return address == NULL ? null : new FT_Size_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 #x_ppem}. */ + public static short nx_ppem(long struct) { return UNSAFE.getShort(null, struct + FT_Size_Metrics.X_PPEM); } + /** Unsafe version of {@link #y_ppem}. */ + public static short ny_ppem(long struct) { return UNSAFE.getShort(null, struct + FT_Size_Metrics.Y_PPEM); } + /** Unsafe version of {@link #x_scale}. */ + public static long nx_scale(long struct) { return memGetCLong(struct + FT_Size_Metrics.X_SCALE); } + /** Unsafe version of {@link #y_scale}. */ + public static long ny_scale(long struct) { return memGetCLong(struct + FT_Size_Metrics.Y_SCALE); } + /** Unsafe version of {@link #ascender}. */ + public static long nascender(long struct) { return memGetCLong(struct + FT_Size_Metrics.ASCENDER); } + /** Unsafe version of {@link #descender}. */ + public static long ndescender(long struct) { return memGetCLong(struct + FT_Size_Metrics.DESCENDER); } + /** Unsafe version of {@link #height}. */ + public static long nheight(long struct) { return memGetCLong(struct + FT_Size_Metrics.HEIGHT); } + /** Unsafe version of {@link #max_advance}. */ + public static long nmax_advance(long struct) { return memGetCLong(struct + FT_Size_Metrics.MAX_ADVANCE); } + + // ----------------------------------- + + /** An array of {@link FT_Size_Metrics} structs. */ + public static class Buffer extends StructBufferChanges 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_Size_Metrics#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_Size_Metrics getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@link FT_Size_Metrics#x_ppem} field. */ + @NativeType("FT_UShort") + public short x_ppem() { return FT_Size_Metrics.nx_ppem(address()); } + /** @return the value of the {@link FT_Size_Metrics#y_ppem} field. */ + @NativeType("FT_UShort") + public short y_ppem() { return FT_Size_Metrics.ny_ppem(address()); } + /** @return the value of the {@link FT_Size_Metrics#x_scale} field. */ + @NativeType("FT_Fixed") + public long x_scale() { return FT_Size_Metrics.nx_scale(address()); } + /** @return the value of the {@link FT_Size_Metrics#y_scale} field. */ + @NativeType("FT_Fixed") + public long y_scale() { return FT_Size_Metrics.ny_scale(address()); } + /** @return the value of the {@link FT_Size_Metrics#ascender} field. */ + @NativeType("FT_Pos") + public long ascender() { return FT_Size_Metrics.nascender(address()); } + /** @return the value of the {@link FT_Size_Metrics#descender} field. */ + @NativeType("FT_Pos") + public long descender() { return FT_Size_Metrics.ndescender(address()); } + /** @return the value of the {@link FT_Size_Metrics#height} field. */ + @NativeType("FT_Pos") + public long height() { return FT_Size_Metrics.nheight(address()); } + /** @return the value of the {@link FT_Size_Metrics#max_advance} field. */ + @NativeType("FT_Pos") + public long max_advance() { return FT_Size_Metrics.nmax_advance(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Request.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Request.java new file mode 100644 index 00000000..6b98a129 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Size_Request.java @@ -0,0 +1,348 @@ +/* + * 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 a size request. + * + *
+ * struct FT_Size_RequestRec {
+ * FT_Size_Request_Type type;
+ * FT_Long width;
+ * FT_Long height;
+ * FT_UInt horiResolution;
+ * FT_UInt vertResolution;
+ * }
+ */
+@NativeType("struct FT_Size_RequestRec")
+public class FT_Size_Request extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_Size_Request(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code type} field. */ + @NativeType("FT_Size_Request_Type") + public int type() { return ntype(address()); } + /** @return the value of the {@code width} field. */ + @NativeType("FT_Long") + public long width() { return nwidth(address()); } + /** @return the value of the {@code height} field. */ + @NativeType("FT_Long") + public long height() { return nheight(address()); } + /** @return the value of the {@code horiResolution} field. */ + @NativeType("FT_UInt") + public int horiResolution() { return nhoriResolution(address()); } + /** @return the value of the {@code vertResolution} field. */ + @NativeType("FT_UInt") + public int vertResolution() { return nvertResolution(address()); } + + /** Sets the specified value to the {@code type} field. */ + public FT_Size_Request type(@NativeType("FT_Size_Request_Type") int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public FT_Size_Request width(@NativeType("FT_Long") long value) { nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public FT_Size_Request height(@NativeType("FT_Long") long value) { nheight(address(), value); return this; } + /** Sets the specified value to the {@code horiResolution} field. */ + public FT_Size_Request horiResolution(@NativeType("FT_UInt") int value) { nhoriResolution(address(), value); return this; } + /** Sets the specified value to the {@code vertResolution} field. */ + public FT_Size_Request vertResolution(@NativeType("FT_UInt") int value) { nvertResolution(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Size_Request set( + int type, + long width, + long height, + int horiResolution, + int vertResolution + ) { + type(type); + width(width); + height(height); + horiResolution(horiResolution); + vertResolution(vertResolution); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Size_Request set(FT_Size_Request src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Size_Request} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Size_Request malloc() { + return new FT_Size_Request(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Size_Request} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Size_Request calloc() { + return new FT_Size_Request(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Size_Request} instance allocated with {@link BufferUtils}. */ + public static FT_Size_Request create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Size_Request(memAddress(container), container); + } + + /** Returns a new {@code FT_Size_Request} instance for the specified memory address. */ + public static FT_Size_Request create(long address) { + return new FT_Size_Request(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Size_Request createSafe(long address) { + return address == NULL ? null : new FT_Size_Request(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_Size_Request} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Size_Request malloc(MemoryStack stack) { + return new FT_Size_Request(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Size_Request} 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_Size_Request calloc(MemoryStack stack) { + return new FT_Size_Request(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 + FT_Size_Request.TYPE); } + /** Unsafe version of {@link #width}. */ + public static long nwidth(long struct) { return memGetCLong(struct + FT_Size_Request.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static long nheight(long struct) { return memGetCLong(struct + FT_Size_Request.HEIGHT); } + /** Unsafe version of {@link #horiResolution}. */ + public static int nhoriResolution(long struct) { return UNSAFE.getInt(null, struct + FT_Size_Request.HORIRESOLUTION); } + /** Unsafe version of {@link #vertResolution}. */ + public static int nvertResolution(long struct) { return UNSAFE.getInt(null, struct + FT_Size_Request.VERTRESOLUTION); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + FT_Size_Request.TYPE, value); } + /** Unsafe version of {@link #width(long) width}. */ + public static void nwidth(long struct, long value) { memPutCLong(struct + FT_Size_Request.WIDTH, value); } + /** Unsafe version of {@link #height(long) height}. */ + public static void nheight(long struct, long value) { memPutCLong(struct + FT_Size_Request.HEIGHT, value); } + /** Unsafe version of {@link #horiResolution(int) horiResolution}. */ + public static void nhoriResolution(long struct, int value) { UNSAFE.putInt(null, struct + FT_Size_Request.HORIRESOLUTION, value); } + /** Unsafe version of {@link #vertResolution(int) vertResolution}. */ + public static void nvertResolution(long struct, int value) { UNSAFE.putInt(null, struct + FT_Size_Request.VERTRESOLUTION, value); } + + // ----------------------------------- + + /** An array of {@link FT_Size_Request} structs. */ + public static class Buffer extends StructBufferChanges 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_Size_Request#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_Size_Request getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code type} field. */ + @NativeType("FT_Size_Request_Type") + public int type() { return FT_Size_Request.ntype(address()); } + /** @return the value of the {@code width} field. */ + @NativeType("FT_Long") + public long width() { return FT_Size_Request.nwidth(address()); } + /** @return the value of the {@code height} field. */ + @NativeType("FT_Long") + public long height() { return FT_Size_Request.nheight(address()); } + /** @return the value of the {@code horiResolution} field. */ + @NativeType("FT_UInt") + public int horiResolution() { return FT_Size_Request.nhoriResolution(address()); } + /** @return the value of the {@code vertResolution} field. */ + @NativeType("FT_UInt") + public int vertResolution() { return FT_Size_Request.nvertResolution(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(@NativeType("FT_Size_Request_Type") int value) { FT_Size_Request.ntype(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public Buffer width(@NativeType("FT_Long") long value) { FT_Size_Request.nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public Buffer height(@NativeType("FT_Long") long value) { FT_Size_Request.nheight(address(), value); return this; } + /** Sets the specified value to the {@code horiResolution} field. */ + public Buffer horiResolution(@NativeType("FT_UInt") int value) { FT_Size_Request.nhoriResolution(address(), value); return this; } + /** Sets the specified value to the {@code vertResolution} field. */ + public Buffer vertResolution(@NativeType("FT_UInt") int value) { FT_Size_Request.nvertResolution(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Span.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Span.java new file mode 100644 index 00000000..625e57e8 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Span.java @@ -0,0 +1,175 @@ +/* + * 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 single span of consecutive pixels when rendering an anti-aliased bitmap. + * + *
+ * struct FT_Span {
+ * short x;
+ * unsigned short len;
+ * unsigned char coverage;
+ * }
+ */
+public class FT_Span extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_Span(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code x} field. */ + public short x() { return nx(address()); } + /** @return the value of the {@code len} field. */ + @NativeType("unsigned short") + public short len() { return nlen(address()); } + /** @return the value of the {@code coverage} field. */ + @NativeType("unsigned char") + public byte coverage() { return ncoverage(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Span} instance for the specified memory address. */ + public static FT_Span create(long address) { + return new FT_Span(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Span createSafe(long address) { + return address == NULL ? null : new FT_Span(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 #x}. */ + public static short nx(long struct) { return UNSAFE.getShort(null, struct + FT_Span.X); } + /** Unsafe version of {@link #len}. */ + public static short nlen(long struct) { return UNSAFE.getShort(null, struct + FT_Span.LEN); } + /** Unsafe version of {@link #coverage}. */ + public static byte ncoverage(long struct) { return UNSAFE.getByte(null, struct + FT_Span.COVERAGE); } + + // ----------------------------------- + + /** An array of {@link FT_Span} structs. */ + public static class Buffer extends StructBufferChanges 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_Span#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_Span getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code x} field. */ + public short x() { return FT_Span.nx(address()); } + /** @return the value of the {@code len} field. */ + @NativeType("unsigned short") + public short len() { return FT_Span.nlen(address()); } + /** @return the value of the {@code coverage} field. */ + @NativeType("unsigned char") + public byte coverage() { return FT_Span.ncoverage(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SpanFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SpanFunc.java new file mode 100644 index 00000000..708a1dea --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SpanFunc.java @@ -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.*; + +/** + *
+ * void (*{@link #invoke}) (
+ * int y,
+ * int count,
+ * FT_Span const *spans,
+ * void *user
+ * )
+ */
+public abstract class FT_SpanFunc extends Callback implements FT_SpanFuncI {
+
+ /**
+ * Creates a {@code FT_SpanFunc} instance from the specified function pointer.
+ *
+ * @return the new {@code FT_SpanFunc}
+ */
+ public static FT_SpanFunc create(long functionPointer) {
+ FT_SpanFuncI instance = Callback.get(functionPointer);
+ return instance instanceof FT_SpanFunc
+ ? (FT_SpanFunc)instance
+ : new Container(functionPointer, instance);
+ }
+
+ /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
+ @Nullable
+ public static FT_SpanFunc createSafe(long functionPointer) {
+ return functionPointer == NULL ? null : create(functionPointer);
+ }
+
+ /** Creates a {@code FT_SpanFunc} instance that delegates to the specified {@code FT_SpanFuncI} instance. */
+ public static FT_SpanFunc create(FT_SpanFuncI instance) {
+ return instance instanceof FT_SpanFunc
+ ? (FT_SpanFunc)instance
+ : new Container(instance.address(), instance);
+ }
+
+ protected FT_SpanFunc() {
+ super(CIF);
+ }
+
+ FT_SpanFunc(long functionPointer) {
+ super(functionPointer);
+ }
+
+ private static final class Container extends FT_SpanFunc {
+
+ private final FT_SpanFuncI delegate;
+
+ Container(long functionPointer, FT_SpanFuncI delegate) {
+ super(functionPointer);
+ this.delegate = delegate;
+ }
+
+ @Override
+ public void invoke(int y, int count, long spans, long user) {
+ delegate.invoke(y, count, spans, user);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SpanFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SpanFuncI.java
new file mode 100644
index 00000000..37a84bf6
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SpanFuncI.java
@@ -0,0 +1,52 @@
+/*
+ * 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.*;
+
+/**
+ *
+ * void (*{@link #invoke}) (
+ * int y,
+ * int count,
+ * FT_Span const *spans,
+ * void *user
+ * )
+ */
+@FunctionalInterface
+@NativeType("FT_SpanFunc")
+public interface FT_SpanFuncI extends CallbackI {
+
+ FFICIF CIF = apiCreateCIF(
+ FFI_DEFAULT_ABI,
+ ffi_type_void,
+ ffi_type_sint32, ffi_type_sint32, ffi_type_pointer, ffi_type_pointer
+ );
+
+ @Override
+ default FFICIF getCallInterface() { return CIF; }
+
+ @Override
+ default void callback(long ret, long args) {
+ invoke(
+ memGetInt(memGetAddress(args)),
+ memGetInt(memGetAddress(args + POINTER_SIZE)),
+ memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)),
+ memGetAddress(memGetAddress(args + 3 * POINTER_SIZE))
+ );
+ }
+
+ /** A function used as a call-back by the anti-aliased renderer in order to let client applications draw themselves the pixel spans on each scan line. */
+ void invoke(int y, int count, @NativeType("FT_Span const *") long spans, @NativeType("void *") long user);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream.java
new file mode 100644
index 00000000..3ca7208b
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream.java
@@ -0,0 +1,412 @@
+/*
+ * 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 an input stream.
+ *
+ *
+ * struct FT_StreamRec {
+ * unsigned char * base;
+ * unsigned long size;
+ * unsigned long pos;
+ * {@link FT_StreamDesc FT_StreamDesc} descriptor;
+ * {@link FT_StreamDesc FT_StreamDesc} pathname;
+ * {@link FT_Stream_IoFuncI FT_Stream_IoFunc} read;
+ * {@link FT_Stream_CloseFuncI FT_Stream_CloseFunc} close;
+ * FT_Memory memory;
+ * unsigned char * cursor;
+ * unsigned char * limit;
+ * }
+ */
+@NativeType("struct FT_StreamRec")
+public class FT_Stream extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_Stream(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 base} field. */ + @Nullable + @NativeType("unsigned char *") + public ByteBuffer base() { return nbase(address()); } + /** @return the value of the {@code size} field. */ + @NativeType("unsigned long") + public long size() { return nsize(address()); } + /** @return the value of the {@code pos} field. */ + @NativeType("unsigned long") + public long pos() { return npos(address()); } + /** @return a {@link FT_StreamDesc} view of the {@code descriptor} field. */ + public FT_StreamDesc descriptor() { return ndescriptor(address()); } + /** @return a {@link FT_StreamDesc} view of the {@code pathname} field. */ + public FT_StreamDesc pathname() { return npathname(address()); } + /** @return the value of the {@code read} field. */ + @Nullable + public FT_Stream_IoFunc read() { return nread(address()); } + /** @return the value of the {@code close} field. */ + @Nullable + public FT_Stream_CloseFunc close$() { return nclose$(address()); } + + /** Sets the address of the specified {@link ByteBuffer} to the {@code base} field. */ + public FT_Stream base(@Nullable @NativeType("unsigned char *") ByteBuffer value) { nbase(address(), value); return this; } + /** Sets the specified value to the {@code size} field. */ + public FT_Stream size(@NativeType("unsigned long") long value) { nsize(address(), value); return this; } + /** Sets the specified value to the {@code pos} field. */ + public FT_Stream pos(@NativeType("unsigned long") long value) { npos(address(), value); return this; } + /** Copies the specified {@link FT_StreamDesc} to the {@code descriptor} field. */ + public FT_Stream descriptor(FT_StreamDesc value) { ndescriptor(address(), value); return this; } + /** Passes the {@code descriptor} field to the specified {@link java.util.function.Consumer Consumer}. */ + public FT_Stream descriptor(java.util.function.ConsumerChanges 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_Stream#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_Stream getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code base} field. */ + @Nullable + @NativeType("unsigned char *") + public ByteBuffer base() { return FT_Stream.nbase(address()); } + /** @return the value of the {@code size} field. */ + @NativeType("unsigned long") + public long size() { return FT_Stream.nsize(address()); } + /** @return the value of the {@code pos} field. */ + @NativeType("unsigned long") + public long pos() { return FT_Stream.npos(address()); } + /** @return a {@link FT_StreamDesc} view of the {@code descriptor} field. */ + public FT_StreamDesc descriptor() { return FT_Stream.ndescriptor(address()); } + /** @return a {@link FT_StreamDesc} view of the {@code pathname} field. */ + public FT_StreamDesc pathname() { return FT_Stream.npathname(address()); } + /** @return the value of the {@code read} field. */ + @Nullable + public FT_Stream_IoFunc read() { return FT_Stream.nread(address()); } + /** @return the value of the {@code close} field. */ + @Nullable + public FT_Stream_CloseFunc close$() { return FT_Stream.nclose$(address()); } + + /** Sets the address of the specified {@link ByteBuffer} to the {@code base} field. */ + public Buffer base(@Nullable @NativeType("unsigned char *") ByteBuffer value) { FT_Stream.nbase(address(), value); return this; } + /** Sets the specified value to the {@code size} field. */ + public Buffer size(@NativeType("unsigned long") long value) { FT_Stream.nsize(address(), value); return this; } + /** Sets the specified value to the {@code pos} field. */ + public Buffer pos(@NativeType("unsigned long") long value) { FT_Stream.npos(address(), value); return this; } + /** Copies the specified {@link FT_StreamDesc} to the {@code descriptor} field. */ + public Buffer descriptor(FT_StreamDesc value) { FT_Stream.ndescriptor(address(), value); return this; } + /** Passes the {@code descriptor} field to the specified {@link java.util.function.Consumer Consumer}. */ + public Buffer descriptor(java.util.function.Consumer
+ * union FT_StreamDesc {
+ * long value;
+ * void * pointer;
+ * }
+ */
+public class FT_StreamDesc extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_StreamDesc(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code value} field. */ + public long value() { return nvalue(address()); } + /** @return the value of the {@code pointer} field. */ + @NativeType("void *") + public long pointer() { return npointer(address()); } + + /** Sets the specified value to the {@code value} field. */ + public FT_StreamDesc value(long value) { nvalue(address(), value); return this; } + /** Sets the specified value to the {@code pointer} field. */ + public FT_StreamDesc pointer(@NativeType("void *") long value) { npointer(address(), value); return this; } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_StreamDesc set(FT_StreamDesc src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_StreamDesc} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_StreamDesc malloc() { + return new FT_StreamDesc(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_StreamDesc} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_StreamDesc calloc() { + return new FT_StreamDesc(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_StreamDesc} instance allocated with {@link BufferUtils}. */ + public static FT_StreamDesc create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_StreamDesc(memAddress(container), container); + } + + /** Returns a new {@code FT_StreamDesc} instance for the specified memory address. */ + public static FT_StreamDesc create(long address) { + return new FT_StreamDesc(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_StreamDesc createSafe(long address) { + return address == NULL ? null : new FT_StreamDesc(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_StreamDesc} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_StreamDesc malloc(MemoryStack stack) { + return new FT_StreamDesc(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_StreamDesc} 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_StreamDesc calloc(MemoryStack stack) { + return new FT_StreamDesc(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 #value}. */ + public static long nvalue(long struct) { return memGetCLong(struct + FT_StreamDesc.VALUE); } + /** Unsafe version of {@link #pointer}. */ + public static long npointer(long struct) { return memGetAddress(struct + FT_StreamDesc.POINTER); } + + /** Unsafe version of {@link #value(long) value}. */ + public static void nvalue(long struct, long value) { memPutCLong(struct + FT_StreamDesc.VALUE, value); } + /** Unsafe version of {@link #pointer(long) pointer}. */ + public static void npointer(long struct, long value) { memPutAddress(struct + FT_StreamDesc.POINTER, value); } + + // ----------------------------------- + + /** An array of {@link FT_StreamDesc} structs. */ + public static class Buffer extends StructBufferChanges 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_StreamDesc#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_StreamDesc getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code value} field. */ + public long value() { return FT_StreamDesc.nvalue(address()); } + /** @return the value of the {@code pointer} field. */ + @NativeType("void *") + public long pointer() { return FT_StreamDesc.npointer(address()); } + + /** Sets the specified value to the {@code value} field. */ + public Buffer value(long value) { FT_StreamDesc.nvalue(address(), value); return this; } + /** Sets the specified value to the {@code pointer} field. */ + public Buffer pointer(@NativeType("void *") long value) { FT_StreamDesc.npointer(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_CloseFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_CloseFunc.java new file mode 100644 index 00000000..d683aac6 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_CloseFunc.java @@ -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.*; + +/** + *
+ * void (*{@link #invoke}) (
+ * FT_Stream stream
+ * )
+ */
+public abstract class FT_Stream_CloseFunc extends Callback implements FT_Stream_CloseFuncI {
+
+ /**
+ * Creates a {@code FT_Stream_CloseFunc} instance from the specified function pointer.
+ *
+ * @return the new {@code FT_Stream_CloseFunc}
+ */
+ public static FT_Stream_CloseFunc create(long functionPointer) {
+ FT_Stream_CloseFuncI instance = Callback.get(functionPointer);
+ return instance instanceof FT_Stream_CloseFunc
+ ? (FT_Stream_CloseFunc)instance
+ : new Container(functionPointer, instance);
+ }
+
+ /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
+ @Nullable
+ public static FT_Stream_CloseFunc createSafe(long functionPointer) {
+ return functionPointer == NULL ? null : create(functionPointer);
+ }
+
+ /** Creates a {@code FT_Stream_CloseFunc} instance that delegates to the specified {@code FT_Stream_CloseFuncI} instance. */
+ public static FT_Stream_CloseFunc create(FT_Stream_CloseFuncI instance) {
+ return instance instanceof FT_Stream_CloseFunc
+ ? (FT_Stream_CloseFunc)instance
+ : new Container(instance.address(), instance);
+ }
+
+ protected FT_Stream_CloseFunc() {
+ super(CIF);
+ }
+
+ FT_Stream_CloseFunc(long functionPointer) {
+ super(functionPointer);
+ }
+
+ private static final class Container extends FT_Stream_CloseFunc {
+
+ private final FT_Stream_CloseFuncI delegate;
+
+ Container(long functionPointer, FT_Stream_CloseFuncI delegate) {
+ super(functionPointer);
+ this.delegate = delegate;
+ }
+
+ @Override
+ public void invoke(long stream) {
+ delegate.invoke(stream);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_CloseFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_CloseFuncI.java
new file mode 100644
index 00000000..3f23c139
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_CloseFuncI.java
@@ -0,0 +1,45 @@
+/*
+ * 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.*;
+
+/**
+ *
+ * void (*{@link #invoke}) (
+ * FT_Stream stream
+ * )
+ */
+@FunctionalInterface
+@NativeType("FT_Stream_CloseFunc")
+public interface FT_Stream_CloseFuncI 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))
+ );
+ }
+
+ void invoke(@NativeType("FT_Stream") long stream);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_IoFunc.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_IoFunc.java
new file mode 100644
index 00000000..47155dac
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_IoFunc.java
@@ -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.*;
+
+/**
+ *
+ * unsigned long (*{@link #invoke}) (
+ * FT_Stream stream,
+ * unsigned long offset,
+ * unsigned char *buffer,
+ * unsigned long count
+ * )
+ */
+public abstract class FT_Stream_IoFunc extends Callback implements FT_Stream_IoFuncI {
+
+ /**
+ * Creates a {@code FT_Stream_IoFunc} instance from the specified function pointer.
+ *
+ * @return the new {@code FT_Stream_IoFunc}
+ */
+ public static FT_Stream_IoFunc create(long functionPointer) {
+ FT_Stream_IoFuncI instance = Callback.get(functionPointer);
+ return instance instanceof FT_Stream_IoFunc
+ ? (FT_Stream_IoFunc)instance
+ : new Container(functionPointer, instance);
+ }
+
+ /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
+ @Nullable
+ public static FT_Stream_IoFunc createSafe(long functionPointer) {
+ return functionPointer == NULL ? null : create(functionPointer);
+ }
+
+ /** Creates a {@code FT_Stream_IoFunc} instance that delegates to the specified {@code FT_Stream_IoFuncI} instance. */
+ public static FT_Stream_IoFunc create(FT_Stream_IoFuncI instance) {
+ return instance instanceof FT_Stream_IoFunc
+ ? (FT_Stream_IoFunc)instance
+ : new Container(instance.address(), instance);
+ }
+
+ protected FT_Stream_IoFunc() {
+ super(CIF);
+ }
+
+ FT_Stream_IoFunc(long functionPointer) {
+ super(functionPointer);
+ }
+
+ private static final class Container extends FT_Stream_IoFunc {
+
+ private final FT_Stream_IoFuncI delegate;
+
+ Container(long functionPointer, FT_Stream_IoFuncI delegate) {
+ super(functionPointer);
+ this.delegate = delegate;
+ }
+
+ @Override
+ public long invoke(long stream, long offset, long buffer, long count) {
+ return delegate.invoke(stream, offset, buffer, count);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_IoFuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_IoFuncI.java
new file mode 100644
index 00000000..0a57b71c
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Stream_IoFuncI.java
@@ -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.*;
+
+/**
+ *
+ * unsigned long (*{@link #invoke}) (
+ * FT_Stream stream,
+ * unsigned long offset,
+ * unsigned char *buffer,
+ * unsigned long count
+ * )
+ */
+@FunctionalInterface
+@NativeType("FT_Stream_IoFunc")
+public interface FT_Stream_IoFuncI extends CallbackI {
+
+ FFICIF CIF = apiCreateCIF(
+ FFI_DEFAULT_ABI,
+ ffi_type_ulong,
+ ffi_type_pointer, ffi_type_ulong, ffi_type_pointer, ffi_type_ulong
+ );
+
+ @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)),
+ memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)),
+ memGetCLong(memGetAddress(args + 3 * POINTER_SIZE))
+ );
+ apiClosureRet(ret, __result);
+ }
+
+ /** A function used to seek and read data from a given input stream. */
+ @NativeType("unsigned long") long invoke(@NativeType("FT_Stream") long stream, @NativeType("unsigned long") long offset, @NativeType("unsigned char *") long buffer, @NativeType("unsigned long") long count);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SvgGlyph.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SvgGlyph.java
new file mode 100644
index 00000000..4193955e
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_SvgGlyph.java
@@ -0,0 +1,256 @@
+/*
+ * 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 OT-SVG glyphs. This is a 'sub-class' of {@link FT_Glyph}.
+ *
+ *
+ * struct FT_SvgGlyphRec {
+ * {@link FT_Glyph FT_GlyphRec} root;
+ * FT_Byte * svg_document;
+ * FT_ULong svg_document_length;
+ * FT_UInt glyph_index;
+ * {@link FT_Size_Metrics FT_Size_Metrics} metrics;
+ * FT_UShort units_per_EM;
+ * FT_UShort start_glyph_id;
+ * FT_UShort end_glyph_id;
+ * {@link FT_Matrix FT_Matrix} transform;
+ * {@link FT_Vector FT_Vector} delta;
+ * }
+ */
+@NativeType("struct FT_SvgGlyphRec")
+public class FT_SvgGlyph extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_SvgGlyph(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 ByteBuffer} view of the data pointed to by the {@code svg_document} field. */ + @NativeType("FT_Byte *") + public ByteBuffer svg_document() { return nsvg_document(address()); } + /** @return the value of the {@code svg_document_length} field. */ + @NativeType("FT_ULong") + public long svg_document_length() { return nsvg_document_length(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_Size_Metrics} view of the {@code metrics} field. */ + public FT_Size_Metrics metrics() { return nmetrics(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 start_glyph_id} field. */ + @NativeType("FT_UShort") + public short start_glyph_id() { return nstart_glyph_id(address()); } + /** @return the value of the {@code end_glyph_id} field. */ + @NativeType("FT_UShort") + public short end_glyph_id() { return nend_glyph_id(address()); } + /** @return a {@link FT_Matrix} view of the {@code transform} field. */ + public FT_Matrix transform() { return ntransform(address()); } + /** @return a {@link FT_Vector} view of the {@code delta} field. */ + public FT_Vector delta() { return ndelta(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_SvgGlyph} instance for the specified memory address. */ + public static FT_SvgGlyph create(long address) { + return new FT_SvgGlyph(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_SvgGlyph createSafe(long address) { + return address == NULL ? null : new FT_SvgGlyph(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_SvgGlyph.ROOT); } + /** Unsafe version of {@link #svg_document() svg_document}. */ + public static ByteBuffer nsvg_document(long struct) { return memByteBuffer(memGetAddress(struct + FT_SvgGlyph.SVG_DOCUMENT), (int)nsvg_document_length(struct)); } + /** Unsafe version of {@link #svg_document_length}. */ + public static long nsvg_document_length(long struct) { return memGetCLong(struct + FT_SvgGlyph.SVG_DOCUMENT_LENGTH); } + /** Unsafe version of {@link #glyph_index}. */ + public static int nglyph_index(long struct) { return UNSAFE.getInt(null, struct + FT_SvgGlyph.GLYPH_INDEX); } + /** Unsafe version of {@link #metrics}. */ + public static FT_Size_Metrics nmetrics(long struct) { return FT_Size_Metrics.create(struct + FT_SvgGlyph.METRICS); } + /** Unsafe version of {@link #units_per_EM}. */ + public static short nunits_per_EM(long struct) { return UNSAFE.getShort(null, struct + FT_SvgGlyph.UNITS_PER_EM); } + /** Unsafe version of {@link #start_glyph_id}. */ + public static short nstart_glyph_id(long struct) { return UNSAFE.getShort(null, struct + FT_SvgGlyph.START_GLYPH_ID); } + /** Unsafe version of {@link #end_glyph_id}. */ + public static short nend_glyph_id(long struct) { return UNSAFE.getShort(null, struct + FT_SvgGlyph.END_GLYPH_ID); } + /** Unsafe version of {@link #transform}. */ + public static FT_Matrix ntransform(long struct) { return FT_Matrix.create(struct + FT_SvgGlyph.TRANSFORM); } + /** Unsafe version of {@link #delta}. */ + public static FT_Vector ndelta(long struct) { return FT_Vector.create(struct + FT_SvgGlyph.DELTA); } + + // ----------------------------------- + + /** An array of {@link FT_SvgGlyph} structs. */ + public static class Buffer extends StructBufferChanges 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_SvgGlyph#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_SvgGlyph getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link FT_Glyph} view of the {@code root} field. */ + @NativeType("FT_GlyphRec") + public FT_Glyph root() { return FT_SvgGlyph.nroot(address()); } + /** @return a {@link ByteBuffer} view of the data pointed to by the {@code svg_document} field. */ + @NativeType("FT_Byte *") + public ByteBuffer svg_document() { return FT_SvgGlyph.nsvg_document(address()); } + /** @return the value of the {@code svg_document_length} field. */ + @NativeType("FT_ULong") + public long svg_document_length() { return FT_SvgGlyph.nsvg_document_length(address()); } + /** @return the value of the {@code glyph_index} field. */ + @NativeType("FT_UInt") + public int glyph_index() { return FT_SvgGlyph.nglyph_index(address()); } + /** @return a {@link FT_Size_Metrics} view of the {@code metrics} field. */ + public FT_Size_Metrics metrics() { return FT_SvgGlyph.nmetrics(address()); } + /** @return the value of the {@code units_per_EM} field. */ + @NativeType("FT_UShort") + public short units_per_EM() { return FT_SvgGlyph.nunits_per_EM(address()); } + /** @return the value of the {@code start_glyph_id} field. */ + @NativeType("FT_UShort") + public short start_glyph_id() { return FT_SvgGlyph.nstart_glyph_id(address()); } + /** @return the value of the {@code end_glyph_id} field. */ + @NativeType("FT_UShort") + public short end_glyph_id() { return FT_SvgGlyph.nend_glyph_id(address()); } + /** @return a {@link FT_Matrix} view of the {@code transform} field. */ + public FT_Matrix transform() { return FT_SvgGlyph.ntransform(address()); } + /** @return a {@link FT_Vector} view of the {@code delta} field. */ + public FT_Vector delta() { return FT_SvgGlyph.ndelta(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_UnitVector.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_UnitVector.java new file mode 100644 index 00000000..b1496741 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_UnitVector.java @@ -0,0 +1,287 @@ +/* + * 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 2D vector unit vector. Uses {@code FT_F2Dot14} types. + * + *
+ * struct FT_UnitVector {
+ * FT_F2Dot14 x;
+ * FT_F2Dot14 y;
+ * }
+ */
+public class FT_UnitVector extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_UnitVector(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code x} field. */ + @NativeType("FT_F2Dot14") + public short x() { return nx(address()); } + /** @return the value of the {@code y} field. */ + @NativeType("FT_F2Dot14") + public short y() { return ny(address()); } + + /** Sets the specified value to the {@code x} field. */ + public FT_UnitVector x(@NativeType("FT_F2Dot14") short value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public FT_UnitVector y(@NativeType("FT_F2Dot14") short value) { ny(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_UnitVector set( + short x, + short y + ) { + x(x); + y(y); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_UnitVector set(FT_UnitVector src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_UnitVector} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_UnitVector malloc() { + return new FT_UnitVector(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_UnitVector} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_UnitVector calloc() { + return new FT_UnitVector(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_UnitVector} instance allocated with {@link BufferUtils}. */ + public static FT_UnitVector create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_UnitVector(memAddress(container), container); + } + + /** Returns a new {@code FT_UnitVector} instance for the specified memory address. */ + public static FT_UnitVector create(long address) { + return new FT_UnitVector(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_UnitVector createSafe(long address) { + return address == NULL ? null : new FT_UnitVector(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_UnitVector} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_UnitVector malloc(MemoryStack stack) { + return new FT_UnitVector(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_UnitVector} 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_UnitVector calloc(MemoryStack stack) { + return new FT_UnitVector(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 #x}. */ + public static short nx(long struct) { return UNSAFE.getShort(null, struct + FT_UnitVector.X); } + /** Unsafe version of {@link #y}. */ + public static short ny(long struct) { return UNSAFE.getShort(null, struct + FT_UnitVector.Y); } + + /** Unsafe version of {@link #x(short) x}. */ + public static void nx(long struct, short value) { UNSAFE.putShort(null, struct + FT_UnitVector.X, value); } + /** Unsafe version of {@link #y(short) y}. */ + public static void ny(long struct, short value) { UNSAFE.putShort(null, struct + FT_UnitVector.Y, value); } + + // ----------------------------------- + + /** An array of {@link FT_UnitVector} structs. */ + public static class Buffer extends StructBufferChanges 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_UnitVector#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_UnitVector getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code x} field. */ + @NativeType("FT_F2Dot14") + public short x() { return FT_UnitVector.nx(address()); } + /** @return the value of the {@code y} field. */ + @NativeType("FT_F2Dot14") + public short y() { return FT_UnitVector.ny(address()); } + + /** Sets the specified value to the {@code x} field. */ + public Buffer x(@NativeType("FT_F2Dot14") short value) { FT_UnitVector.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(@NativeType("FT_F2Dot14") short value) { FT_UnitVector.ny(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Var_Axis.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Var_Axis.java new file mode 100644 index 00000000..fcae9a71 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Var_Axis.java @@ -0,0 +1,221 @@ +/* + * 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, TrueType GX, and OpenType variation fonts. + * + *
+ * struct FT_Var_Axis {
+ * FT_String * name;
+ * FT_Fixed minimum;
+ * FT_Fixed def;
+ * FT_Fixed maximum;
+ * FT_ULong tag;
+ * FT_UInt strid;
+ * }
+ */
+public class FT_Var_Axis extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_Var_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_Fixed") + public long minimum() { return nminimum(address()); } + /** @return the value of the {@code def} field. */ + @NativeType("FT_Fixed") + public long def() { return ndef(address()); } + /** @return the value of the {@code maximum} field. */ + @NativeType("FT_Fixed") + public long maximum() { return nmaximum(address()); } + /** @return the value of the {@code tag} field. */ + @NativeType("FT_ULong") + public long tag() { return ntag(address()); } + /** @return the value of the {@code strid} field. */ + @NativeType("FT_UInt") + public int strid() { return nstrid(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Var_Axis} instance for the specified memory address. */ + public static FT_Var_Axis create(long address) { + return new FT_Var_Axis(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Var_Axis createSafe(long address) { + return address == NULL ? null : new FT_Var_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_Var_Axis.NAME)); } + /** Unsafe version of {@link #nameString}. */ + public static String nnameString(long struct) { return memUTF8(memGetAddress(struct + FT_Var_Axis.NAME)); } + /** Unsafe version of {@link #minimum}. */ + public static long nminimum(long struct) { return memGetCLong(struct + FT_Var_Axis.MINIMUM); } + /** Unsafe version of {@link #def}. */ + public static long ndef(long struct) { return memGetCLong(struct + FT_Var_Axis.DEF); } + /** Unsafe version of {@link #maximum}. */ + public static long nmaximum(long struct) { return memGetCLong(struct + FT_Var_Axis.MAXIMUM); } + /** Unsafe version of {@link #tag}. */ + public static long ntag(long struct) { return memGetCLong(struct + FT_Var_Axis.TAG); } + /** Unsafe version of {@link #strid}. */ + public static int nstrid(long struct) { return UNSAFE.getInt(null, struct + FT_Var_Axis.STRID); } + + // ----------------------------------- + + /** An array of {@link FT_Var_Axis} structs. */ + public static class Buffer extends StructBufferChanges 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_Var_Axis#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_Var_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_Var_Axis.nname(address()); } + /** @return the null-terminated string pointed to by the {@code name} field. */ + @NativeType("FT_String *") + public String nameString() { return FT_Var_Axis.nnameString(address()); } + /** @return the value of the {@code minimum} field. */ + @NativeType("FT_Fixed") + public long minimum() { return FT_Var_Axis.nminimum(address()); } + /** @return the value of the {@code def} field. */ + @NativeType("FT_Fixed") + public long def() { return FT_Var_Axis.ndef(address()); } + /** @return the value of the {@code maximum} field. */ + @NativeType("FT_Fixed") + public long maximum() { return FT_Var_Axis.nmaximum(address()); } + /** @return the value of the {@code tag} field. */ + @NativeType("FT_ULong") + public long tag() { return FT_Var_Axis.ntag(address()); } + /** @return the value of the {@code strid} field. */ + @NativeType("FT_UInt") + public int strid() { return FT_Var_Axis.nstrid(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Var_Named_Style.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Var_Named_Style.java new file mode 100644 index 00000000..9df3cd2f --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Var_Named_Style.java @@ -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.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model a named instance in a TrueType GX or OpenType variation font. + * + *
+ * struct FT_Var_Named_Style {
+ * FT_Fixed * coords;
+ * FT_UInt strid;
+ * FT_UInt psid;
+ * }
+ */
+public class FT_Var_Named_Style extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_Var_Named_Style(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** + * @return a {@link CLongBuffer} view of the data pointed to by the {@code coords} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("FT_Fixed *") + public CLongBuffer coords(int capacity) { return ncoords(address(), capacity); } + /** @return the value of the {@code strid} field. */ + @NativeType("FT_UInt") + public int strid() { return nstrid(address()); } + /** @return the value of the {@code psid} field. */ + @NativeType("FT_UInt") + public int psid() { return npsid(address()); } + + // ----------------------------------- + + /** Returns a new {@code FT_Var_Named_Style} instance for the specified memory address. */ + public static FT_Var_Named_Style create(long address) { + return new FT_Var_Named_Style(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Var_Named_Style createSafe(long address) { + return address == NULL ? null : new FT_Var_Named_Style(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 #coords(int) coords}. */ + public static CLongBuffer ncoords(long struct, int capacity) { return memCLongBuffer(memGetAddress(struct + FT_Var_Named_Style.COORDS), capacity); } + /** Unsafe version of {@link #strid}. */ + public static int nstrid(long struct) { return UNSAFE.getInt(null, struct + FT_Var_Named_Style.STRID); } + /** Unsafe version of {@link #psid}. */ + public static int npsid(long struct) { return UNSAFE.getInt(null, struct + FT_Var_Named_Style.PSID); } + + // ----------------------------------- + + /** An array of {@link FT_Var_Named_Style} structs. */ + public static class Buffer extends StructBufferChanges 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_Var_Named_Style#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_Var_Named_Style getElementFactory() { + return ELEMENT_FACTORY; + } + + /** + * @return a {@link CLongBuffer} view of the data pointed to by the {@code coords} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("FT_Fixed *") + public CLongBuffer coords(int capacity) { return FT_Var_Named_Style.ncoords(address(), capacity); } + /** @return the value of the {@code strid} field. */ + @NativeType("FT_UInt") + public int strid() { return FT_Var_Named_Style.nstrid(address()); } + /** @return the value of the {@code psid} field. */ + @NativeType("FT_UInt") + public int psid() { return FT_Var_Named_Style.npsid(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Vector.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Vector.java new file mode 100644 index 00000000..a54e26f6 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FT_Vector.java @@ -0,0 +1,287 @@ +/* + * 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 2D vector; coordinates are of the {@code FT_Pos} type. + * + *
+ * struct FT_Vector {
+ * FT_Pos x;
+ * FT_Pos y;
+ * }
+ */
+public class FT_Vector extends StructThe created instance holds a strong reference to the container object.
+ */ + public FT_Vector(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code x} field. */ + @NativeType("FT_Pos") + public long x() { return nx(address()); } + /** @return the value of the {@code y} field. */ + @NativeType("FT_Pos") + public long y() { return ny(address()); } + + /** Sets the specified value to the {@code x} field. */ + public FT_Vector x(@NativeType("FT_Pos") long value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public FT_Vector y(@NativeType("FT_Pos") long value) { ny(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public FT_Vector set( + long x, + long y + ) { + x(x); + y(y); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public FT_Vector set(FT_Vector src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code FT_Vector} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static FT_Vector malloc() { + return new FT_Vector(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code FT_Vector} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static FT_Vector calloc() { + return new FT_Vector(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code FT_Vector} instance allocated with {@link BufferUtils}. */ + public static FT_Vector create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new FT_Vector(memAddress(container), container); + } + + /** Returns a new {@code FT_Vector} instance for the specified memory address. */ + public static FT_Vector create(long address) { + return new FT_Vector(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static FT_Vector createSafe(long address) { + return address == NULL ? null : new FT_Vector(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_Vector} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static FT_Vector malloc(MemoryStack stack) { + return new FT_Vector(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code FT_Vector} 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_Vector calloc(MemoryStack stack) { + return new FT_Vector(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 #x}. */ + public static long nx(long struct) { return memGetCLong(struct + FT_Vector.X); } + /** Unsafe version of {@link #y}. */ + public static long ny(long struct) { return memGetCLong(struct + FT_Vector.Y); } + + /** Unsafe version of {@link #x(long) x}. */ + public static void nx(long struct, long value) { memPutCLong(struct + FT_Vector.X, value); } + /** Unsafe version of {@link #y(long) y}. */ + public static void ny(long struct, long value) { memPutCLong(struct + FT_Vector.Y, value); } + + // ----------------------------------- + + /** An array of {@link FT_Vector} structs. */ + public static class Buffer extends StructBufferChanges 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_Vector#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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_Vector getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code x} field. */ + @NativeType("FT_Pos") + public long x() { return FT_Vector.nx(address()); } + /** @return the value of the {@code y} field. */ + @NativeType("FT_Pos") + public long y() { return FT_Vector.ny(address()); } + + /** Sets the specified value to the {@code x} field. */ + public Buffer x(@NativeType("FT_Pos") long value) { FT_Vector.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(@NativeType("FT_Pos") long value) { FT_Vector.ny(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/FreeType.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/FreeType.java new file mode 100644 index 00000000..da644f07 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/FreeType.java @@ -0,0 +1,5951 @@ +/* + * 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 org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.libffi.LibFFI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to FreeType, a freely available software library to render fonts. + * + *It is written in C, designed to be small, efficient, highly customizable, and portable while capable of producing high-quality output (glyph images) of + * most vector and bitmap font formats.
+ * + *FreeType is a library that provides access to glyphs in font files. It scales the glyph images and their metrics to a requested size, and it rasterizes + * the glyph images to produce pixel or subpixel alpha coverage bitmaps.
+ * + *Note that FreeType is not a text layout engine. You have to use higher-level libraries like HarfBuzz, Pango, or ICU for that.
+ * + *Note also that FreeType does not perform alpha blending or compositing the resulting bitmaps or pixmaps by itself. Use your favourite graphics + * library (for example, Cairo or Skia) to further process FreeType's output.
+ * + *The default LWJGL FreeType build includes HarfBuzz and exports its full API. See the HarfBuzz bindings for more information.
+ */ +public class FreeType { + + private static final SharedLibrary FREETYPE = Library.loadNative(FreeType.class, "org.lwjgl.freetype", Configuration.FREETYPE_LIBRARY_NAME.get(Platform.mapLibraryNameBundled("freetype")), true); + + /** Contains the function pointers loaded from the freetype {@link SharedLibrary}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + Init_FreeType = apiGetFunctionAddress(FREETYPE, "FT_Init_FreeType"), + Done_FreeType = apiGetFunctionAddress(FREETYPE, "FT_Done_FreeType"), + New_Face = apiGetFunctionAddress(FREETYPE, "FT_New_Face"), + New_Memory_Face = apiGetFunctionAddress(FREETYPE, "FT_New_Memory_Face"), + Open_Face = apiGetFunctionAddress(FREETYPE, "FT_Open_Face"), + Attach_File = apiGetFunctionAddress(FREETYPE, "FT_Attach_File"), + Attach_Stream = apiGetFunctionAddress(FREETYPE, "FT_Attach_Stream"), + Reference_Face = apiGetFunctionAddress(FREETYPE, "FT_Reference_Face"), + Done_Face = apiGetFunctionAddress(FREETYPE, "FT_Done_Face"), + Select_Size = apiGetFunctionAddress(FREETYPE, "FT_Select_Size"), + Request_Size = apiGetFunctionAddress(FREETYPE, "FT_Request_Size"), + Set_Char_Size = apiGetFunctionAddress(FREETYPE, "FT_Set_Char_Size"), + Set_Pixel_Sizes = apiGetFunctionAddress(FREETYPE, "FT_Set_Pixel_Sizes"), + Load_Glyph = apiGetFunctionAddress(FREETYPE, "FT_Load_Glyph"), + Load_Char = apiGetFunctionAddress(FREETYPE, "FT_Load_Char"), + Set_Transform = apiGetFunctionAddress(FREETYPE, "FT_Set_Transform"), + Get_Transform = apiGetFunctionAddress(FREETYPE, "FT_Get_Transform"), + Render_Glyph = apiGetFunctionAddress(FREETYPE, "FT_Render_Glyph"), + Get_Kerning = apiGetFunctionAddress(FREETYPE, "FT_Get_Kerning"), + Get_Track_Kerning = apiGetFunctionAddress(FREETYPE, "FT_Get_Track_Kerning"), + Select_Charmap = apiGetFunctionAddress(FREETYPE, "FT_Select_Charmap"), + Set_Charmap = apiGetFunctionAddress(FREETYPE, "FT_Set_Charmap"), + Get_Charmap_Index = apiGetFunctionAddress(FREETYPE, "FT_Get_Charmap_Index"), + Get_Char_Index = apiGetFunctionAddress(FREETYPE, "FT_Get_Char_Index"), + Get_First_Char = apiGetFunctionAddress(FREETYPE, "FT_Get_First_Char"), + Get_Next_Char = apiGetFunctionAddress(FREETYPE, "FT_Get_Next_Char"), + Face_Properties = apiGetFunctionAddress(FREETYPE, "FT_Face_Properties"), + Get_Name_Index = apiGetFunctionAddress(FREETYPE, "FT_Get_Name_Index"), + Get_Glyph_Name = apiGetFunctionAddress(FREETYPE, "FT_Get_Glyph_Name"), + Get_Postscript_Name = apiGetFunctionAddress(FREETYPE, "FT_Get_Postscript_Name"), + Get_SubGlyph_Info = apiGetFunctionAddress(FREETYPE, "FT_Get_SubGlyph_Info"), + Get_FSType_Flags = apiGetFunctionAddress(FREETYPE, "FT_Get_FSType_Flags"), + Face_GetCharVariantIndex = apiGetFunctionAddress(FREETYPE, "FT_Face_GetCharVariantIndex"), + Face_GetCharVariantIsDefault = apiGetFunctionAddress(FREETYPE, "FT_Face_GetCharVariantIsDefault"), + Face_GetVariantSelectors = apiGetFunctionAddress(FREETYPE, "FT_Face_GetVariantSelectors"), + Face_GetVariantsOfChar = apiGetFunctionAddress(FREETYPE, "FT_Face_GetVariantsOfChar"), + Face_GetCharsOfVariant = apiGetFunctionAddress(FREETYPE, "FT_Face_GetCharsOfVariant"), + MulDiv = apiGetFunctionAddress(FREETYPE, "FT_MulDiv"), + MulFix = apiGetFunctionAddress(FREETYPE, "FT_MulFix"), + DivFix = apiGetFunctionAddress(FREETYPE, "FT_DivFix"), + RoundFix = apiGetFunctionAddress(FREETYPE, "FT_RoundFix"), + CeilFix = apiGetFunctionAddress(FREETYPE, "FT_CeilFix"), + FloorFix = apiGetFunctionAddress(FREETYPE, "FT_FloorFix"), + Vector_Transform = apiGetFunctionAddress(FREETYPE, "FT_Vector_Transform"), + Library_Version = apiGetFunctionAddress(FREETYPE, "FT_Library_Version"), + Face_CheckTrueTypePatents = apiGetFunctionAddress(FREETYPE, "FT_Face_CheckTrueTypePatents"), + Face_SetUnpatentedHinting = apiGetFunctionAddress(FREETYPE, "FT_Face_SetUnpatentedHinting"), + Get_Advance = apiGetFunctionAddress(FREETYPE, "FT_Get_Advance"), + Get_Advances = apiGetFunctionAddress(FREETYPE, "FT_Get_Advances"), + Outline_Get_BBox = apiGetFunctionAddress(FREETYPE, "FT_Outline_Get_BBox"), + Get_BDF_Charset_ID = apiGetFunctionAddress(FREETYPE, "FT_Get_BDF_Charset_ID"), + Get_BDF_Property = apiGetFunctionAddress(FREETYPE, "FT_Get_BDF_Property"), + Bitmap_Init = apiGetFunctionAddress(FREETYPE, "FT_Bitmap_Init"), + Bitmap_Copy = apiGetFunctionAddress(FREETYPE, "FT_Bitmap_Copy"), + Bitmap_Embolden = apiGetFunctionAddress(FREETYPE, "FT_Bitmap_Embolden"), + Bitmap_Convert = apiGetFunctionAddress(FREETYPE, "FT_Bitmap_Convert"), + Bitmap_Blend = apiGetFunctionAddress(FREETYPE, "FT_Bitmap_Blend"), + GlyphSlot_Own_Bitmap = apiGetFunctionAddress(FREETYPE, "FT_GlyphSlot_Own_Bitmap"), + Bitmap_Done = apiGetFunctionAddress(FREETYPE, "FT_Bitmap_Done"), + Stream_OpenBzip2 = apiGetFunctionAddressOptional(FREETYPE, "FT_Stream_OpenBzip2"), + FTC_Manager_New = apiGetFunctionAddress(FREETYPE, "FTC_Manager_New"), + FTC_Manager_Reset = apiGetFunctionAddress(FREETYPE, "FTC_Manager_Reset"), + FTC_Manager_Done = apiGetFunctionAddress(FREETYPE, "FTC_Manager_Done"), + FTC_Manager_LookupFace = apiGetFunctionAddress(FREETYPE, "FTC_Manager_LookupFace"), + FTC_Manager_LookupSize = apiGetFunctionAddress(FREETYPE, "FTC_Manager_LookupSize"), + FTC_Node_Unref = apiGetFunctionAddress(FREETYPE, "FTC_Node_Unref"), + FTC_Manager_RemoveFaceID = apiGetFunctionAddress(FREETYPE, "FTC_Manager_RemoveFaceID"), + FTC_CMapCache_New = apiGetFunctionAddress(FREETYPE, "FTC_CMapCache_New"), + FTC_CMapCache_Lookup = apiGetFunctionAddress(FREETYPE, "FTC_CMapCache_Lookup"), + FTC_ImageCache_New = apiGetFunctionAddress(FREETYPE, "FTC_ImageCache_New"), + FTC_ImageCache_Lookup = apiGetFunctionAddress(FREETYPE, "FTC_ImageCache_Lookup"), + FTC_ImageCache_LookupScaler = apiGetFunctionAddress(FREETYPE, "FTC_ImageCache_LookupScaler"), + FTC_SBitCache_New = apiGetFunctionAddress(FREETYPE, "FTC_SBitCache_New"), + FTC_SBitCache_Lookup = apiGetFunctionAddress(FREETYPE, "FTC_SBitCache_Lookup"), + FTC_SBitCache_LookupScaler = apiGetFunctionAddress(FREETYPE, "FTC_SBitCache_LookupScaler"), + Get_CID_Registry_Ordering_Supplement = apiGetFunctionAddress(FREETYPE, "FT_Get_CID_Registry_Ordering_Supplement"), + Get_CID_Is_Internally_CID_Keyed = apiGetFunctionAddress(FREETYPE, "FT_Get_CID_Is_Internally_CID_Keyed"), + Get_CID_From_Glyph_Index = apiGetFunctionAddress(FREETYPE, "FT_Get_CID_From_Glyph_Index"), + Palette_Data_Get = apiGetFunctionAddress(FREETYPE, "FT_Palette_Data_Get"), + Palette_Select = apiGetFunctionAddress(FREETYPE, "FT_Palette_Select"), + Palette_Set_Foreground_Color = apiGetFunctionAddress(FREETYPE, "FT_Palette_Set_Foreground_Color"), + Get_Color_Glyph_Layer = apiGetFunctionAddress(FREETYPE, "FT_Get_Color_Glyph_Layer"), + Get_Color_Glyph_Paint = apiGetFunctionAddress(FREETYPE, "FT_Get_Color_Glyph_Paint"), + Get_Color_Glyph_ClipBox = apiGetFunctionAddress(FREETYPE, "FT_Get_Color_Glyph_ClipBox"), + Get_Paint_Layers = apiGetFunctionAddress(FREETYPE, "FT_Get_Paint_Layers"), + Get_Colorline_Stops = apiGetFunctionAddress(FREETYPE, "FT_Get_Colorline_Stops"), + Get_Paint = apiGetFunctionAddress(FREETYPE, "FT_Get_Paint"), + Error_String = apiGetFunctionAddress(FREETYPE, "FT_Error_String"), + Get_Font_Format = apiGetFunctionAddress(FREETYPE, "FT_Get_Font_Format"), + Get_Gasp = apiGetFunctionAddress(FREETYPE, "FT_Get_Gasp"), + New_Glyph = apiGetFunctionAddress(FREETYPE, "FT_New_Glyph"), + Get_Glyph = apiGetFunctionAddress(FREETYPE, "FT_Get_Glyph"), + Glyph_Copy = apiGetFunctionAddress(FREETYPE, "FT_Glyph_Copy"), + Glyph_Transform = apiGetFunctionAddress(FREETYPE, "FT_Glyph_Transform"), + Glyph_Get_CBox = apiGetFunctionAddress(FREETYPE, "FT_Glyph_Get_CBox"), + Glyph_To_Bitmap = apiGetFunctionAddress(FREETYPE, "FT_Glyph_To_Bitmap"), + Done_Glyph = apiGetFunctionAddress(FREETYPE, "FT_Done_Glyph"), + Matrix_Multiply = apiGetFunctionAddress(FREETYPE, "FT_Matrix_Multiply"), + Matrix_Invert = apiGetFunctionAddress(FREETYPE, "FT_Matrix_Invert"), + TrueTypeGX_Validate = apiGetFunctionAddress(FREETYPE, "FT_TrueTypeGX_Validate"), + TrueTypeGX_Free = apiGetFunctionAddress(FREETYPE, "FT_TrueTypeGX_Free"), + ClassicKern_Validate = apiGetFunctionAddress(FREETYPE, "FT_ClassicKern_Validate"), + ClassicKern_Free = apiGetFunctionAddress(FREETYPE, "FT_ClassicKern_Free"), + Stream_OpenGzip = apiGetFunctionAddress(FREETYPE, "FT_Stream_OpenGzip"), + Gzip_Uncompress = apiGetFunctionAddress(FREETYPE, "FT_Gzip_Uncompress"), + Library_SetLcdFilter = apiGetFunctionAddress(FREETYPE, "FT_Library_SetLcdFilter"), + Library_SetLcdFilterWeights = apiGetFunctionAddress(FREETYPE, "FT_Library_SetLcdFilterWeights"), + Library_SetLcdGeometry = apiGetFunctionAddress(FREETYPE, "FT_Library_SetLcdGeometry"), + List_Find = apiGetFunctionAddress(FREETYPE, "FT_List_Find"), + List_Add = apiGetFunctionAddress(FREETYPE, "FT_List_Add"), + List_Insert = apiGetFunctionAddress(FREETYPE, "FT_List_Insert"), + List_Remove = apiGetFunctionAddress(FREETYPE, "FT_List_Remove"), + List_Up = apiGetFunctionAddress(FREETYPE, "FT_List_Up"), + List_Iterate = apiGetFunctionAddress(FREETYPE, "FT_List_Iterate"), + List_Finalize = apiGetFunctionAddress(FREETYPE, "FT_List_Finalize"), + Stream_OpenLZW = apiGetFunctionAddress(FREETYPE, "FT_Stream_OpenLZW"), + Get_Multi_Master = apiGetFunctionAddress(FREETYPE, "FT_Get_Multi_Master"), + Get_MM_Var = apiGetFunctionAddress(FREETYPE, "FT_Get_MM_Var"), + Done_MM_Var = apiGetFunctionAddress(FREETYPE, "FT_Done_MM_Var"), + Set_MM_Design_Coordinates = apiGetFunctionAddress(FREETYPE, "FT_Set_MM_Design_Coordinates"), + Set_Var_Design_Coordinates = apiGetFunctionAddress(FREETYPE, "FT_Set_Var_Design_Coordinates"), + Get_Var_Design_Coordinates = apiGetFunctionAddress(FREETYPE, "FT_Get_Var_Design_Coordinates"), + Set_MM_Blend_Coordinates = apiGetFunctionAddress(FREETYPE, "FT_Set_MM_Blend_Coordinates"), + Get_MM_Blend_Coordinates = apiGetFunctionAddress(FREETYPE, "FT_Get_MM_Blend_Coordinates"), + Set_Var_Blend_Coordinates = apiGetFunctionAddress(FREETYPE, "FT_Set_Var_Blend_Coordinates"), + Get_Var_Blend_Coordinates = apiGetFunctionAddress(FREETYPE, "FT_Get_Var_Blend_Coordinates"), + Set_MM_WeightVector = apiGetFunctionAddress(FREETYPE, "FT_Set_MM_WeightVector"), + Get_MM_WeightVector = apiGetFunctionAddress(FREETYPE, "FT_Get_MM_WeightVector"), + Get_Var_Axis_Flags = apiGetFunctionAddress(FREETYPE, "FT_Get_Var_Axis_Flags"), + Set_Named_Instance = apiGetFunctionAddress(FREETYPE, "FT_Set_Named_Instance"), + Get_Default_Named_Instance = apiGetFunctionAddress(FREETYPE, "FT_Get_Default_Named_Instance"), + Add_Module = apiGetFunctionAddress(FREETYPE, "FT_Add_Module"), + Get_Module = apiGetFunctionAddress(FREETYPE, "FT_Get_Module"), + Remove_Module = apiGetFunctionAddress(FREETYPE, "FT_Remove_Module"), + Property_Set = apiGetFunctionAddress(FREETYPE, "FT_Property_Set"), + Property_Get = apiGetFunctionAddress(FREETYPE, "FT_Property_Get"), + Set_Default_Properties = apiGetFunctionAddress(FREETYPE, "FT_Set_Default_Properties"), + Reference_Library = apiGetFunctionAddress(FREETYPE, "FT_Reference_Library"), + New_Library = apiGetFunctionAddress(FREETYPE, "FT_New_Library"), + Done_Library = apiGetFunctionAddress(FREETYPE, "FT_Done_Library"), + Set_Debug_Hook = apiGetFunctionAddress(FREETYPE, "FT_Set_Debug_Hook"), + Add_Default_Modules = apiGetFunctionAddress(FREETYPE, "FT_Add_Default_Modules"), + Get_TrueType_Engine_Type = apiGetFunctionAddress(FREETYPE, "FT_Get_TrueType_Engine_Type"), + OpenType_Validate = apiGetFunctionAddress(FREETYPE, "FT_OpenType_Validate"), + OpenType_Free = apiGetFunctionAddress(FREETYPE, "FT_OpenType_Free"), + Outline_Decompose = apiGetFunctionAddress(FREETYPE, "FT_Outline_Decompose"), + Outline_New = apiGetFunctionAddress(FREETYPE, "FT_Outline_New"), + Outline_Done = apiGetFunctionAddress(FREETYPE, "FT_Outline_Done"), + Outline_Check = apiGetFunctionAddress(FREETYPE, "FT_Outline_Check"), + Outline_Get_CBox = apiGetFunctionAddress(FREETYPE, "FT_Outline_Get_CBox"), + Outline_Translate = apiGetFunctionAddress(FREETYPE, "FT_Outline_Translate"), + Outline_Copy = apiGetFunctionAddress(FREETYPE, "FT_Outline_Copy"), + Outline_Transform = apiGetFunctionAddress(FREETYPE, "FT_Outline_Transform"), + Outline_Embolden = apiGetFunctionAddress(FREETYPE, "FT_Outline_Embolden"), + Outline_EmboldenXY = apiGetFunctionAddress(FREETYPE, "FT_Outline_EmboldenXY"), + Outline_Reverse = apiGetFunctionAddress(FREETYPE, "FT_Outline_Reverse"), + Outline_Get_Bitmap = apiGetFunctionAddress(FREETYPE, "FT_Outline_Get_Bitmap"), + Outline_Render = apiGetFunctionAddress(FREETYPE, "FT_Outline_Render"), + Outline_Get_Orientation = apiGetFunctionAddress(FREETYPE, "FT_Outline_Get_Orientation"), + Get_PFR_Metrics = apiGetFunctionAddress(FREETYPE, "FT_Get_PFR_Metrics"), + Get_PFR_Kerning = apiGetFunctionAddress(FREETYPE, "FT_Get_PFR_Kerning"), + Get_PFR_Advance = apiGetFunctionAddress(FREETYPE, "FT_Get_PFR_Advance"), + Get_Renderer = apiGetFunctionAddress(FREETYPE, "FT_Get_Renderer"), + Set_Renderer = apiGetFunctionAddress(FREETYPE, "FT_Set_Renderer"), + New_Size = apiGetFunctionAddress(FREETYPE, "FT_New_Size"), + Done_Size = apiGetFunctionAddress(FREETYPE, "FT_Done_Size"), + Activate_Size = apiGetFunctionAddress(FREETYPE, "FT_Activate_Size"), + Get_Sfnt_Name_Count = apiGetFunctionAddress(FREETYPE, "FT_Get_Sfnt_Name_Count"), + Get_Sfnt_Name = apiGetFunctionAddress(FREETYPE, "FT_Get_Sfnt_Name"), + Get_Sfnt_LangTag = apiGetFunctionAddress(FREETYPE, "FT_Get_Sfnt_LangTag"), + Outline_GetInsideBorder = apiGetFunctionAddress(FREETYPE, "FT_Outline_GetInsideBorder"), + Outline_GetOutsideBorder = apiGetFunctionAddress(FREETYPE, "FT_Outline_GetOutsideBorder"), + Stroker_New = apiGetFunctionAddress(FREETYPE, "FT_Stroker_New"), + Stroker_Set = apiGetFunctionAddress(FREETYPE, "FT_Stroker_Set"), + Stroker_Rewind = apiGetFunctionAddress(FREETYPE, "FT_Stroker_Rewind"), + Stroker_ParseOutline = apiGetFunctionAddress(FREETYPE, "FT_Stroker_ParseOutline"), + Stroker_BeginSubPath = apiGetFunctionAddress(FREETYPE, "FT_Stroker_BeginSubPath"), + Stroker_EndSubPath = apiGetFunctionAddress(FREETYPE, "FT_Stroker_EndSubPath"), + Stroker_LineTo = apiGetFunctionAddress(FREETYPE, "FT_Stroker_LineTo"), + Stroker_ConicTo = apiGetFunctionAddress(FREETYPE, "FT_Stroker_ConicTo"), + Stroker_CubicTo = apiGetFunctionAddress(FREETYPE, "FT_Stroker_CubicTo"), + Stroker_GetBorderCounts = apiGetFunctionAddress(FREETYPE, "FT_Stroker_GetBorderCounts"), + Stroker_ExportBorder = apiGetFunctionAddress(FREETYPE, "FT_Stroker_ExportBorder"), + Stroker_GetCounts = apiGetFunctionAddress(FREETYPE, "FT_Stroker_GetCounts"), + Stroker_Export = apiGetFunctionAddress(FREETYPE, "FT_Stroker_Export"), + Stroker_Done = apiGetFunctionAddress(FREETYPE, "FT_Stroker_Done"), + Glyph_Stroke = apiGetFunctionAddress(FREETYPE, "FT_Glyph_Stroke"), + Glyph_StrokeBorder = apiGetFunctionAddress(FREETYPE, "FT_Glyph_StrokeBorder"), + GlyphSlot_Embolden = apiGetFunctionAddress(FREETYPE, "FT_GlyphSlot_Embolden"), + GlyphSlot_AdjustWeight = apiGetFunctionAddress(FREETYPE, "FT_GlyphSlot_AdjustWeight"), + GlyphSlot_Oblique = apiGetFunctionAddress(FREETYPE, "FT_GlyphSlot_Oblique"), + GlyphSlot_Slant = apiGetFunctionAddress(FREETYPE, "FT_GlyphSlot_Slant"), + Sin = apiGetFunctionAddress(FREETYPE, "FT_Sin"), + Cos = apiGetFunctionAddress(FREETYPE, "FT_Cos"), + Tan = apiGetFunctionAddress(FREETYPE, "FT_Tan"), + Atan2 = apiGetFunctionAddress(FREETYPE, "FT_Atan2"), + Angle_Diff = apiGetFunctionAddress(FREETYPE, "FT_Angle_Diff"), + Vector_Unit = apiGetFunctionAddress(FREETYPE, "FT_Vector_Unit"), + Vector_Rotate = apiGetFunctionAddress(FREETYPE, "FT_Vector_Rotate"), + Vector_Length = apiGetFunctionAddress(FREETYPE, "FT_Vector_Length"), + Vector_Polarize = apiGetFunctionAddress(FREETYPE, "FT_Vector_Polarize"), + Vector_From_Polar = apiGetFunctionAddress(FREETYPE, "FT_Vector_From_Polar"), + Has_PS_Glyph_Names = apiGetFunctionAddress(FREETYPE, "FT_Has_PS_Glyph_Names"), + Get_PS_Font_Info = apiGetFunctionAddress(FREETYPE, "FT_Get_PS_Font_Info"), + Get_PS_Font_Private = apiGetFunctionAddress(FREETYPE, "FT_Get_PS_Font_Private"), + Get_PS_Font_Value = apiGetFunctionAddress(FREETYPE, "FT_Get_PS_Font_Value"), + Get_Sfnt_Table = apiGetFunctionAddress(FREETYPE, "FT_Get_Sfnt_Table"), + Load_Sfnt_Table = apiGetFunctionAddress(FREETYPE, "FT_Load_Sfnt_Table"), + Sfnt_Table_Info = apiGetFunctionAddress(FREETYPE, "FT_Sfnt_Table_Info"), + Get_CMap_Language_ID = apiGetFunctionAddress(FREETYPE, "FT_Get_CMap_Language_ID"), + Get_CMap_Format = apiGetFunctionAddress(FREETYPE, "FT_Get_CMap_Format"); + + } + + /** Returns the freetype {@link SharedLibrary}. */ + public static SharedLibrary getLibrary() { + return FREETYPE; + } + + /** + * {@code FT_Encoding} + * + *
+ * struct PS_FontInfoRec {
+ * FT_String * version;
+ * FT_String * notice;
+ * FT_String * full_name;
+ * FT_String * family_name;
+ * FT_String * weight;
+ * FT_Long italic_angle;
+ * FT_Bool is_fixed_pitch;
+ * FT_Short underline_position;
+ * FT_UShort underline_thickness;
+ * }
+ */
+@NativeType("struct PS_FontInfoRec")
+public class PS_FontInfo extends StructThe created instance holds a strong reference to the container object.
+ */ + public PS_FontInfo(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 version} field. */ + @NativeType("FT_String *") + public ByteBuffer version() { return nversion(address()); } + /** @return the null-terminated string pointed to by the {@code version} field. */ + @NativeType("FT_String *") + public String versionString() { return nversionString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code notice} field. */ + @NativeType("FT_String *") + public ByteBuffer notice() { return nnotice(address()); } + /** @return the null-terminated string pointed to by the {@code notice} field. */ + @NativeType("FT_String *") + public String noticeString() { return nnoticeString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code full_name} field. */ + @NativeType("FT_String *") + public ByteBuffer full_name() { return nfull_name(address()); } + /** @return the null-terminated string pointed to by the {@code full_name} field. */ + @NativeType("FT_String *") + public String full_nameString() { return nfull_nameString(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 weight} field. */ + @NativeType("FT_String *") + public ByteBuffer weight() { return nweight(address()); } + /** @return the null-terminated string pointed to by the {@code weight} field. */ + @NativeType("FT_String *") + public String weightString() { return nweightString(address()); } + /** @return the value of the {@code italic_angle} field. */ + @NativeType("FT_Long") + public long italic_angle() { return nitalic_angle(address()); } + /** @return the value of the {@code is_fixed_pitch} field. */ + @NativeType("FT_Bool") + public boolean is_fixed_pitch() { return nis_fixed_pitch(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_UShort") + public short underline_thickness() { return nunderline_thickness(address()); } + + // ----------------------------------- + + /** Returns a new {@code PS_FontInfo} instance for the specified memory address. */ + public static PS_FontInfo create(long address) { + return new PS_FontInfo(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static PS_FontInfo createSafe(long address) { + return address == NULL ? null : new PS_FontInfo(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 #version}. */ + public static ByteBuffer nversion(long struct) { return memByteBufferNT1(memGetAddress(struct + PS_FontInfo.VERSION)); } + /** Unsafe version of {@link #versionString}. */ + public static String nversionString(long struct) { return memUTF8(memGetAddress(struct + PS_FontInfo.VERSION)); } + /** Unsafe version of {@link #notice}. */ + public static ByteBuffer nnotice(long struct) { return memByteBufferNT1(memGetAddress(struct + PS_FontInfo.NOTICE)); } + /** Unsafe version of {@link #noticeString}. */ + public static String nnoticeString(long struct) { return memUTF8(memGetAddress(struct + PS_FontInfo.NOTICE)); } + /** Unsafe version of {@link #full_name}. */ + public static ByteBuffer nfull_name(long struct) { return memByteBufferNT1(memGetAddress(struct + PS_FontInfo.FULL_NAME)); } + /** Unsafe version of {@link #full_nameString}. */ + public static String nfull_nameString(long struct) { return memUTF8(memGetAddress(struct + PS_FontInfo.FULL_NAME)); } + /** Unsafe version of {@link #family_name}. */ + public static ByteBuffer nfamily_name(long struct) { return memByteBufferNT1(memGetAddress(struct + PS_FontInfo.FAMILY_NAME)); } + /** Unsafe version of {@link #family_nameString}. */ + public static String nfamily_nameString(long struct) { return memUTF8(memGetAddress(struct + PS_FontInfo.FAMILY_NAME)); } + /** Unsafe version of {@link #weight}. */ + public static ByteBuffer nweight(long struct) { return memByteBufferNT1(memGetAddress(struct + PS_FontInfo.WEIGHT)); } + /** Unsafe version of {@link #weightString}. */ + public static String nweightString(long struct) { return memUTF8(memGetAddress(struct + PS_FontInfo.WEIGHT)); } + /** Unsafe version of {@link #italic_angle}. */ + public static long nitalic_angle(long struct) { return memGetCLong(struct + PS_FontInfo.ITALIC_ANGLE); } + /** Unsafe version of {@link #is_fixed_pitch}. */ + public static boolean nis_fixed_pitch(long struct) { return UNSAFE.getByte(null, struct + PS_FontInfo.IS_FIXED_PITCH) != 0; } + /** Unsafe version of {@link #underline_position}. */ + public static short nunderline_position(long struct) { return UNSAFE.getShort(null, struct + PS_FontInfo.UNDERLINE_POSITION); } + /** Unsafe version of {@link #underline_thickness}. */ + public static short nunderline_thickness(long struct) { return UNSAFE.getShort(null, struct + PS_FontInfo.UNDERLINE_THICKNESS); } + + // ----------------------------------- + + /** An array of {@link PS_FontInfo} structs. */ + public static class Buffer extends StructBufferChanges 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 PS_FontInfo#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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 PS_FontInfo getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code version} field. */ + @NativeType("FT_String *") + public ByteBuffer version() { return PS_FontInfo.nversion(address()); } + /** @return the null-terminated string pointed to by the {@code version} field. */ + @NativeType("FT_String *") + public String versionString() { return PS_FontInfo.nversionString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code notice} field. */ + @NativeType("FT_String *") + public ByteBuffer notice() { return PS_FontInfo.nnotice(address()); } + /** @return the null-terminated string pointed to by the {@code notice} field. */ + @NativeType("FT_String *") + public String noticeString() { return PS_FontInfo.nnoticeString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code full_name} field. */ + @NativeType("FT_String *") + public ByteBuffer full_name() { return PS_FontInfo.nfull_name(address()); } + /** @return the null-terminated string pointed to by the {@code full_name} field. */ + @NativeType("FT_String *") + public String full_nameString() { return PS_FontInfo.nfull_nameString(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 PS_FontInfo.nfamily_name(address()); } + /** @return the null-terminated string pointed to by the {@code family_name} field. */ + @NativeType("FT_String *") + public String family_nameString() { return PS_FontInfo.nfamily_nameString(address()); } + /** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code weight} field. */ + @NativeType("FT_String *") + public ByteBuffer weight() { return PS_FontInfo.nweight(address()); } + /** @return the null-terminated string pointed to by the {@code weight} field. */ + @NativeType("FT_String *") + public String weightString() { return PS_FontInfo.nweightString(address()); } + /** @return the value of the {@code italic_angle} field. */ + @NativeType("FT_Long") + public long italic_angle() { return PS_FontInfo.nitalic_angle(address()); } + /** @return the value of the {@code is_fixed_pitch} field. */ + @NativeType("FT_Bool") + public boolean is_fixed_pitch() { return PS_FontInfo.nis_fixed_pitch(address()); } + /** @return the value of the {@code underline_position} field. */ + @NativeType("FT_Short") + public short underline_position() { return PS_FontInfo.nunderline_position(address()); } + /** @return the value of the {@code underline_thickness} field. */ + @NativeType("FT_UShort") + public short underline_thickness() { return PS_FontInfo.nunderline_thickness(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/PS_Private.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/PS_Private.java new file mode 100644 index 00000000..b399ba89 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/PS_Private.java @@ -0,0 +1,533 @@ +/* + * 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.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used to model a Type~1 or Type~2 private dictionary. Note that for Multiple Master fonts, each instance has its own Private dictionary. + * + *
+ * struct PS_PrivateRec {
+ * FT_Int unique_id;
+ * FT_Int lenIV;
+ * FT_Byte num_blue_values;
+ * FT_Byte num_other_blues;
+ * FT_Byte num_family_blues;
+ * FT_Byte num_family_other_blues;
+ * FT_Short blue_values[14];
+ * FT_Short other_blues[10];
+ * FT_Short family_blues[14];
+ * FT_Short family_other_blues[10];
+ * FT_Fixed blue_scale;
+ * FT_Int blue_shift;
+ * FT_Int blue_fuzz;
+ * FT_UShort standard_width[1];
+ * FT_UShort standard_height[1];
+ * FT_Byte num_snap_widths;
+ * FT_Byte num_snap_heights;
+ * FT_Bool force_bold;
+ * FT_Bool round_stem_up;
+ * FT_Short {@link #snap_widths}[13];
+ * FT_Short {@link #snap_heights}[13];
+ * FT_Fixed expansion_factor;
+ * FT_Long language_group;
+ * FT_Long password;
+ * FT_Short min_feature[2];
+ * }
+ */
+@NativeType("struct PS_PrivateRec")
+public class PS_Private extends StructThe created instance holds a strong reference to the container object.
+ */ + public PS_Private(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code unique_id} field. */ + @NativeType("FT_Int") + public int unique_id() { return nunique_id(address()); } + /** @return the value of the {@code lenIV} field. */ + @NativeType("FT_Int") + public int lenIV() { return nlenIV(address()); } + /** @return the value of the {@code num_blue_values} field. */ + @NativeType("FT_Byte") + public byte num_blue_values() { return nnum_blue_values(address()); } + /** @return the value of the {@code num_other_blues} field. */ + @NativeType("FT_Byte") + public byte num_other_blues() { return nnum_other_blues(address()); } + /** @return the value of the {@code num_family_blues} field. */ + @NativeType("FT_Byte") + public byte num_family_blues() { return nnum_family_blues(address()); } + /** @return the value of the {@code num_family_other_blues} field. */ + @NativeType("FT_Byte") + public byte num_family_other_blues() { return nnum_family_other_blues(address()); } + /** @return a {@link ShortBuffer} view of the {@code blue_values} field. */ + @NativeType("FT_Short[14]") + public ShortBuffer blue_values() { return nblue_values(address()); } + /** @return the value at the specified index of the {@code blue_values} field. */ + @NativeType("FT_Short") + public short blue_values(int index) { return nblue_values(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code other_blues} field. */ + @NativeType("FT_Short[10]") + public ShortBuffer other_blues() { return nother_blues(address()); } + /** @return the value at the specified index of the {@code other_blues} field. */ + @NativeType("FT_Short") + public short other_blues(int index) { return nother_blues(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code family_blues} field. */ + @NativeType("FT_Short[14]") + public ShortBuffer family_blues() { return nfamily_blues(address()); } + /** @return the value at the specified index of the {@code family_blues} field. */ + @NativeType("FT_Short") + public short family_blues(int index) { return nfamily_blues(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code family_other_blues} field. */ + @NativeType("FT_Short[10]") + public ShortBuffer family_other_blues() { return nfamily_other_blues(address()); } + /** @return the value at the specified index of the {@code family_other_blues} field. */ + @NativeType("FT_Short") + public short family_other_blues(int index) { return nfamily_other_blues(address(), index); } + /** @return the value of the {@code blue_scale} field. */ + @NativeType("FT_Fixed") + public long blue_scale() { return nblue_scale(address()); } + /** @return the value of the {@code blue_shift} field. */ + @NativeType("FT_Int") + public int blue_shift() { return nblue_shift(address()); } + /** @return the value of the {@code blue_fuzz} field. */ + @NativeType("FT_Int") + public int blue_fuzz() { return nblue_fuzz(address()); } + /** @return a {@link ShortBuffer} view of the {@code standard_width} field. */ + @NativeType("FT_UShort[1]") + public ShortBuffer standard_width() { return nstandard_width(address()); } + /** @return the value at the specified index of the {@code standard_width} field. */ + @NativeType("FT_UShort") + public short standard_width(int index) { return nstandard_width(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code standard_height} field. */ + @NativeType("FT_UShort[1]") + public ShortBuffer standard_height() { return nstandard_height(address()); } + /** @return the value at the specified index of the {@code standard_height} field. */ + @NativeType("FT_UShort") + public short standard_height(int index) { return nstandard_height(address(), index); } + /** @return the value of the {@code num_snap_widths} field. */ + @NativeType("FT_Byte") + public byte num_snap_widths() { return nnum_snap_widths(address()); } + /** @return the value of the {@code num_snap_heights} field. */ + @NativeType("FT_Byte") + public byte num_snap_heights() { return nnum_snap_heights(address()); } + /** @return the value of the {@code force_bold} field. */ + @NativeType("FT_Bool") + public boolean force_bold() { return nforce_bold(address()); } + /** @return the value of the {@code round_stem_up} field. */ + @NativeType("FT_Bool") + public boolean round_stem_up() { return nround_stem_up(address()); } + /** including std width */ + @NativeType("FT_Short[13]") + public ShortBuffer snap_widths() { return nsnap_widths(address()); } + /** including std width */ + @NativeType("FT_Short") + public short snap_widths(int index) { return nsnap_widths(address(), index); } + /** including std height */ + @NativeType("FT_Short[13]") + public ShortBuffer snap_heights() { return nsnap_heights(address()); } + /** including std height */ + @NativeType("FT_Short") + public short snap_heights(int index) { return nsnap_heights(address(), index); } + /** @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 language_group} field. */ + @NativeType("FT_Long") + public long language_group() { return nlanguage_group(address()); } + /** @return the value of the {@code password} field. */ + @NativeType("FT_Long") + public long password() { return npassword(address()); } + /** @return a {@link ShortBuffer} view of the {@code min_feature} field. */ + @NativeType("FT_Short[2]") + public ShortBuffer min_feature() { return nmin_feature(address()); } + /** @return the value at the specified index of the {@code min_feature} field. */ + @NativeType("FT_Short") + public short min_feature(int index) { return nmin_feature(address(), index); } + + // ----------------------------------- + + /** Returns a new {@code PS_Private} instance for the specified memory address. */ + public static PS_Private create(long address) { + return new PS_Private(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static PS_Private createSafe(long address) { + return address == NULL ? null : new PS_Private(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 #unique_id}. */ + public static int nunique_id(long struct) { return UNSAFE.getInt(null, struct + PS_Private.UNIQUE_ID); } + /** Unsafe version of {@link #lenIV}. */ + public static int nlenIV(long struct) { return UNSAFE.getInt(null, struct + PS_Private.LENIV); } + /** Unsafe version of {@link #num_blue_values}. */ + public static byte nnum_blue_values(long struct) { return UNSAFE.getByte(null, struct + PS_Private.NUM_BLUE_VALUES); } + /** Unsafe version of {@link #num_other_blues}. */ + public static byte nnum_other_blues(long struct) { return UNSAFE.getByte(null, struct + PS_Private.NUM_OTHER_BLUES); } + /** Unsafe version of {@link #num_family_blues}. */ + public static byte nnum_family_blues(long struct) { return UNSAFE.getByte(null, struct + PS_Private.NUM_FAMILY_BLUES); } + /** Unsafe version of {@link #num_family_other_blues}. */ + public static byte nnum_family_other_blues(long struct) { return UNSAFE.getByte(null, struct + PS_Private.NUM_FAMILY_OTHER_BLUES); } + /** Unsafe version of {@link #blue_values}. */ + public static ShortBuffer nblue_values(long struct) { return memShortBuffer(struct + PS_Private.BLUE_VALUES, 14); } + /** Unsafe version of {@link #blue_values(int) blue_values}. */ + public static short nblue_values(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.BLUE_VALUES + check(index, 14) * 2); + } + /** Unsafe version of {@link #other_blues}. */ + public static ShortBuffer nother_blues(long struct) { return memShortBuffer(struct + PS_Private.OTHER_BLUES, 10); } + /** Unsafe version of {@link #other_blues(int) other_blues}. */ + public static short nother_blues(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.OTHER_BLUES + check(index, 10) * 2); + } + /** Unsafe version of {@link #family_blues}. */ + public static ShortBuffer nfamily_blues(long struct) { return memShortBuffer(struct + PS_Private.FAMILY_BLUES, 14); } + /** Unsafe version of {@link #family_blues(int) family_blues}. */ + public static short nfamily_blues(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.FAMILY_BLUES + check(index, 14) * 2); + } + /** Unsafe version of {@link #family_other_blues}. */ + public static ShortBuffer nfamily_other_blues(long struct) { return memShortBuffer(struct + PS_Private.FAMILY_OTHER_BLUES, 10); } + /** Unsafe version of {@link #family_other_blues(int) family_other_blues}. */ + public static short nfamily_other_blues(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.FAMILY_OTHER_BLUES + check(index, 10) * 2); + } + /** Unsafe version of {@link #blue_scale}. */ + public static long nblue_scale(long struct) { return memGetCLong(struct + PS_Private.BLUE_SCALE); } + /** Unsafe version of {@link #blue_shift}. */ + public static int nblue_shift(long struct) { return UNSAFE.getInt(null, struct + PS_Private.BLUE_SHIFT); } + /** Unsafe version of {@link #blue_fuzz}. */ + public static int nblue_fuzz(long struct) { return UNSAFE.getInt(null, struct + PS_Private.BLUE_FUZZ); } + /** Unsafe version of {@link #standard_width}. */ + public static ShortBuffer nstandard_width(long struct) { return memShortBuffer(struct + PS_Private.STANDARD_WIDTH, 1); } + /** Unsafe version of {@link #standard_width(int) standard_width}. */ + public static short nstandard_width(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.STANDARD_WIDTH + check(index, 1) * 2); + } + /** Unsafe version of {@link #standard_height}. */ + public static ShortBuffer nstandard_height(long struct) { return memShortBuffer(struct + PS_Private.STANDARD_HEIGHT, 1); } + /** Unsafe version of {@link #standard_height(int) standard_height}. */ + public static short nstandard_height(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.STANDARD_HEIGHT + check(index, 1) * 2); + } + /** Unsafe version of {@link #num_snap_widths}. */ + public static byte nnum_snap_widths(long struct) { return UNSAFE.getByte(null, struct + PS_Private.NUM_SNAP_WIDTHS); } + /** Unsafe version of {@link #num_snap_heights}. */ + public static byte nnum_snap_heights(long struct) { return UNSAFE.getByte(null, struct + PS_Private.NUM_SNAP_HEIGHTS); } + /** Unsafe version of {@link #force_bold}. */ + public static boolean nforce_bold(long struct) { return UNSAFE.getByte(null, struct + PS_Private.FORCE_BOLD) != 0; } + /** Unsafe version of {@link #round_stem_up}. */ + public static boolean nround_stem_up(long struct) { return UNSAFE.getByte(null, struct + PS_Private.ROUND_STEM_UP) != 0; } + /** Unsafe version of {@link #snap_widths}. */ + public static ShortBuffer nsnap_widths(long struct) { return memShortBuffer(struct + PS_Private.SNAP_WIDTHS, 13); } + /** Unsafe version of {@link #snap_widths(int) snap_widths}. */ + public static short nsnap_widths(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.SNAP_WIDTHS + check(index, 13) * 2); + } + /** Unsafe version of {@link #snap_heights}. */ + public static ShortBuffer nsnap_heights(long struct) { return memShortBuffer(struct + PS_Private.SNAP_HEIGHTS, 13); } + /** Unsafe version of {@link #snap_heights(int) snap_heights}. */ + public static short nsnap_heights(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.SNAP_HEIGHTS + check(index, 13) * 2); + } + /** Unsafe version of {@link #expansion_factor}. */ + public static long nexpansion_factor(long struct) { return memGetCLong(struct + PS_Private.EXPANSION_FACTOR); } + /** Unsafe version of {@link #language_group}. */ + public static long nlanguage_group(long struct) { return memGetCLong(struct + PS_Private.LANGUAGE_GROUP); } + /** Unsafe version of {@link #password}. */ + public static long npassword(long struct) { return memGetCLong(struct + PS_Private.PASSWORD); } + /** Unsafe version of {@link #min_feature}. */ + public static ShortBuffer nmin_feature(long struct) { return memShortBuffer(struct + PS_Private.MIN_FEATURE, 2); } + /** Unsafe version of {@link #min_feature(int) min_feature}. */ + public static short nmin_feature(long struct, int index) { + return UNSAFE.getShort(null, struct + PS_Private.MIN_FEATURE + check(index, 2) * 2); + } + + // ----------------------------------- + + /** An array of {@link PS_Private} structs. */ + public static class Buffer extends StructBufferChanges 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 PS_Private#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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 PS_Private getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code unique_id} field. */ + @NativeType("FT_Int") + public int unique_id() { return PS_Private.nunique_id(address()); } + /** @return the value of the {@code lenIV} field. */ + @NativeType("FT_Int") + public int lenIV() { return PS_Private.nlenIV(address()); } + /** @return the value of the {@code num_blue_values} field. */ + @NativeType("FT_Byte") + public byte num_blue_values() { return PS_Private.nnum_blue_values(address()); } + /** @return the value of the {@code num_other_blues} field. */ + @NativeType("FT_Byte") + public byte num_other_blues() { return PS_Private.nnum_other_blues(address()); } + /** @return the value of the {@code num_family_blues} field. */ + @NativeType("FT_Byte") + public byte num_family_blues() { return PS_Private.nnum_family_blues(address()); } + /** @return the value of the {@code num_family_other_blues} field. */ + @NativeType("FT_Byte") + public byte num_family_other_blues() { return PS_Private.nnum_family_other_blues(address()); } + /** @return a {@link ShortBuffer} view of the {@code blue_values} field. */ + @NativeType("FT_Short[14]") + public ShortBuffer blue_values() { return PS_Private.nblue_values(address()); } + /** @return the value at the specified index of the {@code blue_values} field. */ + @NativeType("FT_Short") + public short blue_values(int index) { return PS_Private.nblue_values(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code other_blues} field. */ + @NativeType("FT_Short[10]") + public ShortBuffer other_blues() { return PS_Private.nother_blues(address()); } + /** @return the value at the specified index of the {@code other_blues} field. */ + @NativeType("FT_Short") + public short other_blues(int index) { return PS_Private.nother_blues(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code family_blues} field. */ + @NativeType("FT_Short[14]") + public ShortBuffer family_blues() { return PS_Private.nfamily_blues(address()); } + /** @return the value at the specified index of the {@code family_blues} field. */ + @NativeType("FT_Short") + public short family_blues(int index) { return PS_Private.nfamily_blues(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code family_other_blues} field. */ + @NativeType("FT_Short[10]") + public ShortBuffer family_other_blues() { return PS_Private.nfamily_other_blues(address()); } + /** @return the value at the specified index of the {@code family_other_blues} field. */ + @NativeType("FT_Short") + public short family_other_blues(int index) { return PS_Private.nfamily_other_blues(address(), index); } + /** @return the value of the {@code blue_scale} field. */ + @NativeType("FT_Fixed") + public long blue_scale() { return PS_Private.nblue_scale(address()); } + /** @return the value of the {@code blue_shift} field. */ + @NativeType("FT_Int") + public int blue_shift() { return PS_Private.nblue_shift(address()); } + /** @return the value of the {@code blue_fuzz} field. */ + @NativeType("FT_Int") + public int blue_fuzz() { return PS_Private.nblue_fuzz(address()); } + /** @return a {@link ShortBuffer} view of the {@code standard_width} field. */ + @NativeType("FT_UShort[1]") + public ShortBuffer standard_width() { return PS_Private.nstandard_width(address()); } + /** @return the value at the specified index of the {@code standard_width} field. */ + @NativeType("FT_UShort") + public short standard_width(int index) { return PS_Private.nstandard_width(address(), index); } + /** @return a {@link ShortBuffer} view of the {@code standard_height} field. */ + @NativeType("FT_UShort[1]") + public ShortBuffer standard_height() { return PS_Private.nstandard_height(address()); } + /** @return the value at the specified index of the {@code standard_height} field. */ + @NativeType("FT_UShort") + public short standard_height(int index) { return PS_Private.nstandard_height(address(), index); } + /** @return the value of the {@code num_snap_widths} field. */ + @NativeType("FT_Byte") + public byte num_snap_widths() { return PS_Private.nnum_snap_widths(address()); } + /** @return the value of the {@code num_snap_heights} field. */ + @NativeType("FT_Byte") + public byte num_snap_heights() { return PS_Private.nnum_snap_heights(address()); } + /** @return the value of the {@code force_bold} field. */ + @NativeType("FT_Bool") + public boolean force_bold() { return PS_Private.nforce_bold(address()); } + /** @return the value of the {@code round_stem_up} field. */ + @NativeType("FT_Bool") + public boolean round_stem_up() { return PS_Private.nround_stem_up(address()); } + /** @return a {@link ShortBuffer} view of the {@link PS_Private#snap_widths} field. */ + @NativeType("FT_Short[13]") + public ShortBuffer snap_widths() { return PS_Private.nsnap_widths(address()); } + /** @return the value at the specified index of the {@link PS_Private#snap_widths} field. */ + @NativeType("FT_Short") + public short snap_widths(int index) { return PS_Private.nsnap_widths(address(), index); } + /** @return a {@link ShortBuffer} view of the {@link PS_Private#snap_heights} field. */ + @NativeType("FT_Short[13]") + public ShortBuffer snap_heights() { return PS_Private.nsnap_heights(address()); } + /** @return the value at the specified index of the {@link PS_Private#snap_heights} field. */ + @NativeType("FT_Short") + public short snap_heights(int index) { return PS_Private.nsnap_heights(address(), index); } + /** @return the value of the {@code expansion_factor} field. */ + @NativeType("FT_Fixed") + public long expansion_factor() { return PS_Private.nexpansion_factor(address()); } + /** @return the value of the {@code language_group} field. */ + @NativeType("FT_Long") + public long language_group() { return PS_Private.nlanguage_group(address()); } + /** @return the value of the {@code password} field. */ + @NativeType("FT_Long") + public long password() { return PS_Private.npassword(address()); } + /** @return a {@link ShortBuffer} view of the {@code min_feature} field. */ + @NativeType("FT_Short[2]") + public ShortBuffer min_feature() { return PS_Private.nmin_feature(address()); } + /** @return the value at the specified index of the {@code min_feature} field. */ + @NativeType("FT_Short") + public short min_feature(int index) { return PS_Private.nmin_feature(address(), index); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Free_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Free_Func.java new file mode 100644 index 00000000..b94c78aa --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Free_Func.java @@ -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.*; + +/** + *
+ * void (*{@link #invoke}) (
+ * FT_Pointer *data_pointer
+ * )
+ */
+public abstract class SVG_Lib_Free_Func extends Callback implements SVG_Lib_Free_FuncI {
+
+ /**
+ * Creates a {@code SVG_Lib_Free_Func} instance from the specified function pointer.
+ *
+ * @return the new {@code SVG_Lib_Free_Func}
+ */
+ public static SVG_Lib_Free_Func create(long functionPointer) {
+ SVG_Lib_Free_FuncI instance = Callback.get(functionPointer);
+ return instance instanceof SVG_Lib_Free_Func
+ ? (SVG_Lib_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 SVG_Lib_Free_Func createSafe(long functionPointer) {
+ return functionPointer == NULL ? null : create(functionPointer);
+ }
+
+ /** Creates a {@code SVG_Lib_Free_Func} instance that delegates to the specified {@code SVG_Lib_Free_FuncI} instance. */
+ public static SVG_Lib_Free_Func create(SVG_Lib_Free_FuncI instance) {
+ return instance instanceof SVG_Lib_Free_Func
+ ? (SVG_Lib_Free_Func)instance
+ : new Container(instance.address(), instance);
+ }
+
+ protected SVG_Lib_Free_Func() {
+ super(CIF);
+ }
+
+ SVG_Lib_Free_Func(long functionPointer) {
+ super(functionPointer);
+ }
+
+ private static final class Container extends SVG_Lib_Free_Func {
+
+ private final SVG_Lib_Free_FuncI delegate;
+
+ Container(long functionPointer, SVG_Lib_Free_FuncI delegate) {
+ super(functionPointer);
+ this.delegate = delegate;
+ }
+
+ @Override
+ public void invoke(long data_pointer) {
+ delegate.invoke(data_pointer);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Free_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Free_FuncI.java
new file mode 100644
index 00000000..5af5b89c
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Free_FuncI.java
@@ -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.*;
+
+/**
+ *
+ * void (*{@link #invoke}) (
+ * FT_Pointer *data_pointer
+ * )
+ */
+@FunctionalInterface
+@NativeType("SVG_Lib_Free_Func")
+public interface SVG_Lib_Free_FuncI 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 callback that is called when the {@code ot-svg} module is being freed. */
+ void invoke(@NativeType("FT_Pointer *") long data_pointer);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Init_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Init_Func.java
new file mode 100644
index 00000000..8a040daa
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Init_Func.java
@@ -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.*;
+
+/**
+ *
+ * FT_Error (*{@link #invoke}) (
+ * FT_Pointer *data_pointer
+ * )
+ */
+public abstract class SVG_Lib_Init_Func extends Callback implements SVG_Lib_Init_FuncI {
+
+ /**
+ * Creates a {@code SVG_Lib_Init_Func} instance from the specified function pointer.
+ *
+ * @return the new {@code SVG_Lib_Init_Func}
+ */
+ public static SVG_Lib_Init_Func create(long functionPointer) {
+ SVG_Lib_Init_FuncI instance = Callback.get(functionPointer);
+ return instance instanceof SVG_Lib_Init_Func
+ ? (SVG_Lib_Init_Func)instance
+ : new Container(functionPointer, instance);
+ }
+
+ /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
+ @Nullable
+ public static SVG_Lib_Init_Func createSafe(long functionPointer) {
+ return functionPointer == NULL ? null : create(functionPointer);
+ }
+
+ /** Creates a {@code SVG_Lib_Init_Func} instance that delegates to the specified {@code SVG_Lib_Init_FuncI} instance. */
+ public static SVG_Lib_Init_Func create(SVG_Lib_Init_FuncI instance) {
+ return instance instanceof SVG_Lib_Init_Func
+ ? (SVG_Lib_Init_Func)instance
+ : new Container(instance.address(), instance);
+ }
+
+ protected SVG_Lib_Init_Func() {
+ super(CIF);
+ }
+
+ SVG_Lib_Init_Func(long functionPointer) {
+ super(functionPointer);
+ }
+
+ private static final class Container extends SVG_Lib_Init_Func {
+
+ private final SVG_Lib_Init_FuncI delegate;
+
+ Container(long functionPointer, SVG_Lib_Init_FuncI delegate) {
+ super(functionPointer);
+ this.delegate = delegate;
+ }
+
+ @Override
+ public int invoke(long data_pointer) {
+ return delegate.invoke(data_pointer);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Init_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Init_FuncI.java
new file mode 100644
index 00000000..78171175
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Init_FuncI.java
@@ -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.*;
+
+/**
+ *
+ * FT_Error (*{@link #invoke}) (
+ * FT_Pointer *data_pointer
+ * )
+ */
+@FunctionalInterface
+@NativeType("SVG_Lib_Init_Func")
+public interface SVG_Lib_Init_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 callback that is called when the first OT-SVG glyph is rendered in the lifetime of an {@code FT_Library} object. */
+ @NativeType("FT_Error") int invoke(@NativeType("FT_Pointer *") long data_pointer);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Preset_Slot_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Preset_Slot_Func.java
new file mode 100644
index 00000000..fff90782
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Preset_Slot_Func.java
@@ -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.*;
+
+/**
+ *
+ * FT_Error (*{@link #invoke}) (
+ * FT_GlyphSlot slot,
+ * FT_Bool cache,
+ * FT_Pointer *state
+ * )
+ */
+public abstract class SVG_Lib_Preset_Slot_Func extends Callback implements SVG_Lib_Preset_Slot_FuncI {
+
+ /**
+ * Creates a {@code SVG_Lib_Preset_Slot_Func} instance from the specified function pointer.
+ *
+ * @return the new {@code SVG_Lib_Preset_Slot_Func}
+ */
+ public static SVG_Lib_Preset_Slot_Func create(long functionPointer) {
+ SVG_Lib_Preset_Slot_FuncI instance = Callback.get(functionPointer);
+ return instance instanceof SVG_Lib_Preset_Slot_Func
+ ? (SVG_Lib_Preset_Slot_Func)instance
+ : new Container(functionPointer, instance);
+ }
+
+ /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
+ @Nullable
+ public static SVG_Lib_Preset_Slot_Func createSafe(long functionPointer) {
+ return functionPointer == NULL ? null : create(functionPointer);
+ }
+
+ /** Creates a {@code SVG_Lib_Preset_Slot_Func} instance that delegates to the specified {@code SVG_Lib_Preset_Slot_FuncI} instance. */
+ public static SVG_Lib_Preset_Slot_Func create(SVG_Lib_Preset_Slot_FuncI instance) {
+ return instance instanceof SVG_Lib_Preset_Slot_Func
+ ? (SVG_Lib_Preset_Slot_Func)instance
+ : new Container(instance.address(), instance);
+ }
+
+ protected SVG_Lib_Preset_Slot_Func() {
+ super(CIF);
+ }
+
+ SVG_Lib_Preset_Slot_Func(long functionPointer) {
+ super(functionPointer);
+ }
+
+ private static final class Container extends SVG_Lib_Preset_Slot_Func {
+
+ private final SVG_Lib_Preset_Slot_FuncI delegate;
+
+ Container(long functionPointer, SVG_Lib_Preset_Slot_FuncI delegate) {
+ super(functionPointer);
+ this.delegate = delegate;
+ }
+
+ @Override
+ public int invoke(long slot, boolean cache, long state) {
+ return delegate.invoke(slot, cache, state);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Preset_Slot_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Preset_Slot_FuncI.java
new file mode 100644
index 00000000..2a49a415
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Preset_Slot_FuncI.java
@@ -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.*;
+
+/**
+ *
+ * FT_Error (*{@link #invoke}) (
+ * FT_GlyphSlot slot,
+ * FT_Bool cache,
+ * FT_Pointer *state
+ * )
+ */
+@FunctionalInterface
+@NativeType("SVG_Lib_Preset_Slot_Func")
+public interface SVG_Lib_Preset_Slot_FuncI extends CallbackI {
+
+ FFICIF CIF = apiCreateCIF(
+ FFI_DEFAULT_ABI,
+ ffi_type_sint32,
+ ffi_type_pointer, 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)),
+ memGetByte(memGetAddress(args + POINTER_SIZE)) != 0,
+ memGetAddress(memGetAddress(args + 2 * POINTER_SIZE))
+ );
+ apiClosureRet(ret, __result);
+ }
+
+ /** A callback that is called to preset the glyph slot. */
+ @NativeType("FT_Error") int invoke(@NativeType("FT_GlyphSlot") long slot, @NativeType("FT_Bool") boolean cache, @NativeType("FT_Pointer *") long state);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Render_Func.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Render_Func.java
new file mode 100644
index 00000000..88c7553c
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Render_Func.java
@@ -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.*;
+
+/**
+ *
+ * FT_Error (*{@link #invoke}) (
+ * FT_GlyphSlot slot,
+ * FT_Pointer *data_pointer
+ * )
+ */
+public abstract class SVG_Lib_Render_Func extends Callback implements SVG_Lib_Render_FuncI {
+
+ /**
+ * Creates a {@code SVG_Lib_Render_Func} instance from the specified function pointer.
+ *
+ * @return the new {@code SVG_Lib_Render_Func}
+ */
+ public static SVG_Lib_Render_Func create(long functionPointer) {
+ SVG_Lib_Render_FuncI instance = Callback.get(functionPointer);
+ return instance instanceof SVG_Lib_Render_Func
+ ? (SVG_Lib_Render_Func)instance
+ : new Container(functionPointer, instance);
+ }
+
+ /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
+ @Nullable
+ public static SVG_Lib_Render_Func createSafe(long functionPointer) {
+ return functionPointer == NULL ? null : create(functionPointer);
+ }
+
+ /** Creates a {@code SVG_Lib_Render_Func} instance that delegates to the specified {@code SVG_Lib_Render_FuncI} instance. */
+ public static SVG_Lib_Render_Func create(SVG_Lib_Render_FuncI instance) {
+ return instance instanceof SVG_Lib_Render_Func
+ ? (SVG_Lib_Render_Func)instance
+ : new Container(instance.address(), instance);
+ }
+
+ protected SVG_Lib_Render_Func() {
+ super(CIF);
+ }
+
+ SVG_Lib_Render_Func(long functionPointer) {
+ super(functionPointer);
+ }
+
+ private static final class Container extends SVG_Lib_Render_Func {
+
+ private final SVG_Lib_Render_FuncI delegate;
+
+ Container(long functionPointer, SVG_Lib_Render_FuncI delegate) {
+ super(functionPointer);
+ this.delegate = delegate;
+ }
+
+ @Override
+ public int invoke(long slot, long data_pointer) {
+ return delegate.invoke(slot, data_pointer);
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Render_FuncI.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Render_FuncI.java
new file mode 100644
index 00000000..5496cb21
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_Lib_Render_FuncI.java
@@ -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.*;
+
+/**
+ *
+ * FT_Error (*{@link #invoke}) (
+ * FT_GlyphSlot slot,
+ * FT_Pointer *data_pointer
+ * )
+ */
+@FunctionalInterface
+@NativeType("SVG_Lib_Render_Func")
+public interface SVG_Lib_Render_FuncI 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 callback that is called to render an OT-SVG glyph. */
+ @NativeType("FT_Error") int invoke(@NativeType("FT_GlyphSlot") long slot, @NativeType("FT_Pointer *") long data_pointer);
+
+}
\ No newline at end of file
diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_RendererHooks.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_RendererHooks.java
new file mode 100644
index 00000000..57109058
--- /dev/null
+++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/SVG_RendererHooks.java
@@ -0,0 +1,332 @@
+/*
+ * 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 that stores the four hooks needed to render OT-SVG glyphs properly.
+ *
+ *
+ * struct SVG_RendererHooks {
+ * {@link SVG_Lib_Init_FuncI SVG_Lib_Init_Func} init_svg;
+ * {@link SVG_Lib_Free_FuncI SVG_Lib_Free_Func} free_svg;
+ * {@link SVG_Lib_Render_FuncI SVG_Lib_Render_Func} render_svg;
+ * {@link SVG_Lib_Preset_Slot_FuncI SVG_Lib_Preset_Slot_Func} preset_slot;
+ * }
+ */
+public class SVG_RendererHooks extends StructThe created instance holds a strong reference to the container object.
+ */ + public SVG_RendererHooks(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code init_svg} field. */ + public SVG_Lib_Init_Func init_svg() { return ninit_svg(address()); } + /** @return the value of the {@code free_svg} field. */ + public SVG_Lib_Free_Func free_svg() { return nfree_svg(address()); } + /** @return the value of the {@code render_svg} field. */ + public SVG_Lib_Render_Func render_svg() { return nrender_svg(address()); } + /** @return the value of the {@code preset_slot} field. */ + public SVG_Lib_Preset_Slot_Func preset_slot() { return npreset_slot(address()); } + + /** Sets the specified value to the {@code init_svg} field. */ + public SVG_RendererHooks init_svg(@NativeType("SVG_Lib_Init_Func") SVG_Lib_Init_FuncI value) { ninit_svg(address(), value); return this; } + /** Sets the specified value to the {@code free_svg} field. */ + public SVG_RendererHooks free_svg(@NativeType("SVG_Lib_Free_Func") SVG_Lib_Free_FuncI value) { nfree_svg(address(), value); return this; } + /** Sets the specified value to the {@code render_svg} field. */ + public SVG_RendererHooks render_svg(@NativeType("SVG_Lib_Render_Func") SVG_Lib_Render_FuncI value) { nrender_svg(address(), value); return this; } + /** Sets the specified value to the {@code preset_slot} field. */ + public SVG_RendererHooks preset_slot(@NativeType("SVG_Lib_Preset_Slot_Func") SVG_Lib_Preset_Slot_FuncI value) { npreset_slot(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public SVG_RendererHooks set( + SVG_Lib_Init_FuncI init_svg, + SVG_Lib_Free_FuncI free_svg, + SVG_Lib_Render_FuncI render_svg, + SVG_Lib_Preset_Slot_FuncI preset_slot + ) { + init_svg(init_svg); + free_svg(free_svg); + render_svg(render_svg); + preset_slot(preset_slot); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public SVG_RendererHooks set(SVG_RendererHooks src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code SVG_RendererHooks} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static SVG_RendererHooks malloc() { + return new SVG_RendererHooks(nmemAllocChecked(SIZEOF), null); + } + + /** Returns a new {@code SVG_RendererHooks} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static SVG_RendererHooks calloc() { + return new SVG_RendererHooks(nmemCallocChecked(1, SIZEOF), null); + } + + /** Returns a new {@code SVG_RendererHooks} instance allocated with {@link BufferUtils}. */ + public static SVG_RendererHooks create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return new SVG_RendererHooks(memAddress(container), container); + } + + /** Returns a new {@code SVG_RendererHooks} instance for the specified memory address. */ + public static SVG_RendererHooks create(long address) { + return new SVG_RendererHooks(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static SVG_RendererHooks createSafe(long address) { + return address == NULL ? null : new SVG_RendererHooks(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 SVG_RendererHooks} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static SVG_RendererHooks malloc(MemoryStack stack) { + return new SVG_RendererHooks(stack.nmalloc(ALIGNOF, SIZEOF), null); + } + + /** + * Returns a new {@code SVG_RendererHooks} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static SVG_RendererHooks calloc(MemoryStack stack) { + return new SVG_RendererHooks(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 #init_svg}. */ + public static SVG_Lib_Init_Func ninit_svg(long struct) { return SVG_Lib_Init_Func.create(memGetAddress(struct + SVG_RendererHooks.INIT_SVG)); } + /** Unsafe version of {@link #free_svg}. */ + public static SVG_Lib_Free_Func nfree_svg(long struct) { return SVG_Lib_Free_Func.create(memGetAddress(struct + SVG_RendererHooks.FREE_SVG)); } + /** Unsafe version of {@link #render_svg}. */ + public static SVG_Lib_Render_Func nrender_svg(long struct) { return SVG_Lib_Render_Func.create(memGetAddress(struct + SVG_RendererHooks.RENDER_SVG)); } + /** Unsafe version of {@link #preset_slot}. */ + public static SVG_Lib_Preset_Slot_Func npreset_slot(long struct) { return SVG_Lib_Preset_Slot_Func.create(memGetAddress(struct + SVG_RendererHooks.PRESET_SLOT)); } + + /** Unsafe version of {@link #init_svg(SVG_Lib_Init_FuncI) init_svg}. */ + public static void ninit_svg(long struct, SVG_Lib_Init_FuncI value) { memPutAddress(struct + SVG_RendererHooks.INIT_SVG, value.address()); } + /** Unsafe version of {@link #free_svg(SVG_Lib_Free_FuncI) free_svg}. */ + public static void nfree_svg(long struct, SVG_Lib_Free_FuncI value) { memPutAddress(struct + SVG_RendererHooks.FREE_SVG, value.address()); } + /** Unsafe version of {@link #render_svg(SVG_Lib_Render_FuncI) render_svg}. */ + public static void nrender_svg(long struct, SVG_Lib_Render_FuncI value) { memPutAddress(struct + SVG_RendererHooks.RENDER_SVG, value.address()); } + /** Unsafe version of {@link #preset_slot(SVG_Lib_Preset_Slot_FuncI) preset_slot}. */ + public static void npreset_slot(long struct, SVG_Lib_Preset_Slot_FuncI value) { memPutAddress(struct + SVG_RendererHooks.PRESET_SLOT, 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 + SVG_RendererHooks.INIT_SVG)); + check(memGetAddress(struct + SVG_RendererHooks.FREE_SVG)); + check(memGetAddress(struct + SVG_RendererHooks.RENDER_SVG)); + check(memGetAddress(struct + SVG_RendererHooks.PRESET_SLOT)); + } + + // ----------------------------------- + + /** An array of {@link SVG_RendererHooks} structs. */ + public static class Buffer extends StructBufferChanges 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 SVG_RendererHooks#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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 SVG_RendererHooks getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code init_svg} field. */ + public SVG_Lib_Init_Func init_svg() { return SVG_RendererHooks.ninit_svg(address()); } + /** @return the value of the {@code free_svg} field. */ + public SVG_Lib_Free_Func free_svg() { return SVG_RendererHooks.nfree_svg(address()); } + /** @return the value of the {@code render_svg} field. */ + public SVG_Lib_Render_Func render_svg() { return SVG_RendererHooks.nrender_svg(address()); } + /** @return the value of the {@code preset_slot} field. */ + public SVG_Lib_Preset_Slot_Func preset_slot() { return SVG_RendererHooks.npreset_slot(address()); } + + /** Sets the specified value to the {@code init_svg} field. */ + public Buffer init_svg(@NativeType("SVG_Lib_Init_Func") SVG_Lib_Init_FuncI value) { SVG_RendererHooks.ninit_svg(address(), value); return this; } + /** Sets the specified value to the {@code free_svg} field. */ + public Buffer free_svg(@NativeType("SVG_Lib_Free_Func") SVG_Lib_Free_FuncI value) { SVG_RendererHooks.nfree_svg(address(), value); return this; } + /** Sets the specified value to the {@code render_svg} field. */ + public Buffer render_svg(@NativeType("SVG_Lib_Render_Func") SVG_Lib_Render_FuncI value) { SVG_RendererHooks.nrender_svg(address(), value); return this; } + /** Sets the specified value to the {@code preset_slot} field. */ + public Buffer preset_slot(@NativeType("SVG_Lib_Preset_Slot_Func") SVG_Lib_Preset_Slot_FuncI value) { SVG_RendererHooks.npreset_slot(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_Header.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_Header.java new file mode 100644 index 00000000..733eb1aa --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_Header.java @@ -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.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model a TrueType font header table. + * + *
+ * struct TT_Header {
+ * FT_Fixed Table_Version;
+ * FT_Fixed Font_Revision;
+ * FT_Long CheckSum_Adjust;
+ * FT_Long Magic_Number;
+ * FT_UShort Flags;
+ * FT_UShort Units_Per_EM;
+ * FT_ULong Created[2];
+ * FT_ULong Modified[2];
+ * FT_Short xMin;
+ * FT_Short yMin;
+ * FT_Short xMax;
+ * FT_Short yMax;
+ * FT_UShort Mac_Style;
+ * FT_UShort Lowest_Rec_PPEM;
+ * FT_Short Font_Direction;
+ * FT_Short Index_To_Loc_Format;
+ * FT_Short Glyph_Data_Format;
+ * }
+ */
+public class TT_Header extends StructThe created instance holds a strong reference to the container object.
+ */ + public TT_Header(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code Table_Version} field. */ + @NativeType("FT_Fixed") + public long Table_Version() { return nTable_Version(address()); } + /** @return the value of the {@code Font_Revision} field. */ + @NativeType("FT_Fixed") + public long Font_Revision() { return nFont_Revision(address()); } + /** @return the value of the {@code CheckSum_Adjust} field. */ + @NativeType("FT_Long") + public long CheckSum_Adjust() { return nCheckSum_Adjust(address()); } + /** @return the value of the {@code Magic_Number} field. */ + @NativeType("FT_Long") + public long Magic_Number() { return nMagic_Number(address()); } + /** @return the value of the {@code Flags} field. */ + @NativeType("FT_UShort") + public short Flags() { return nFlags(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 a {@link CLongBuffer} view of the {@code Created} field. */ + @NativeType("FT_ULong[2]") + public CLongBuffer Created() { return nCreated(address()); } + /** @return the value at the specified index of the {@code Created} field. */ + @NativeType("FT_ULong") + public long Created(int index) { return nCreated(address(), index); } + /** @return a {@link CLongBuffer} view of the {@code Modified} field. */ + @NativeType("FT_ULong[2]") + public CLongBuffer Modified() { return nModified(address()); } + /** @return the value at the specified index of the {@code Modified} field. */ + @NativeType("FT_ULong") + public long Modified(int index) { return nModified(address(), index); } + /** @return the value of the {@code xMin} field. */ + @NativeType("FT_Short") + public short xMin() { return nxMin(address()); } + /** @return the value of the {@code yMin} field. */ + @NativeType("FT_Short") + public short yMin() { return nyMin(address()); } + /** @return the value of the {@code xMax} field. */ + @NativeType("FT_Short") + public short xMax() { return nxMax(address()); } + /** @return the value of the {@code yMax} field. */ + @NativeType("FT_Short") + public short yMax() { return nyMax(address()); } + /** @return the value of the {@code Mac_Style} field. */ + @NativeType("FT_UShort") + public short Mac_Style() { return nMac_Style(address()); } + /** @return the value of the {@code Lowest_Rec_PPEM} field. */ + @NativeType("FT_UShort") + public short Lowest_Rec_PPEM() { return nLowest_Rec_PPEM(address()); } + /** @return the value of the {@code Font_Direction} field. */ + @NativeType("FT_Short") + public short Font_Direction() { return nFont_Direction(address()); } + /** @return the value of the {@code Index_To_Loc_Format} field. */ + @NativeType("FT_Short") + public short Index_To_Loc_Format() { return nIndex_To_Loc_Format(address()); } + /** @return the value of the {@code Glyph_Data_Format} field. */ + @NativeType("FT_Short") + public short Glyph_Data_Format() { return nGlyph_Data_Format(address()); } + + // ----------------------------------- + + /** Returns a new {@code TT_Header} instance for the specified memory address. */ + public static TT_Header create(long address) { + return new TT_Header(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TT_Header createSafe(long address) { + return address == NULL ? null : new TT_Header(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 #Table_Version}. */ + public static long nTable_Version(long struct) { return memGetCLong(struct + TT_Header.TABLE_VERSION); } + /** Unsafe version of {@link #Font_Revision}. */ + public static long nFont_Revision(long struct) { return memGetCLong(struct + TT_Header.FONT_REVISION); } + /** Unsafe version of {@link #CheckSum_Adjust}. */ + public static long nCheckSum_Adjust(long struct) { return memGetCLong(struct + TT_Header.CHECKSUM_ADJUST); } + /** Unsafe version of {@link #Magic_Number}. */ + public static long nMagic_Number(long struct) { return memGetCLong(struct + TT_Header.MAGIC_NUMBER); } + /** Unsafe version of {@link #Flags}. */ + public static short nFlags(long struct) { return UNSAFE.getShort(null, struct + TT_Header.FLAGS); } + /** Unsafe version of {@link #Units_Per_EM}. */ + public static short nUnits_Per_EM(long struct) { return UNSAFE.getShort(null, struct + TT_Header.UNITS_PER_EM); } + /** Unsafe version of {@link #Created}. */ + public static CLongBuffer nCreated(long struct) { return memCLongBuffer(struct + TT_Header.CREATED, 2); } + /** Unsafe version of {@link #Created(int) Created}. */ + public static long nCreated(long struct, int index) { + return memGetCLong(struct + TT_Header.CREATED + check(index, 2) * CLONG_SIZE); + } + /** Unsafe version of {@link #Modified}. */ + public static CLongBuffer nModified(long struct) { return memCLongBuffer(struct + TT_Header.MODIFIED, 2); } + /** Unsafe version of {@link #Modified(int) Modified}. */ + public static long nModified(long struct, int index) { + return memGetCLong(struct + TT_Header.MODIFIED + check(index, 2) * CLONG_SIZE); + } + /** Unsafe version of {@link #xMin}. */ + public static short nxMin(long struct) { return UNSAFE.getShort(null, struct + TT_Header.XMIN); } + /** Unsafe version of {@link #yMin}. */ + public static short nyMin(long struct) { return UNSAFE.getShort(null, struct + TT_Header.YMIN); } + /** Unsafe version of {@link #xMax}. */ + public static short nxMax(long struct) { return UNSAFE.getShort(null, struct + TT_Header.XMAX); } + /** Unsafe version of {@link #yMax}. */ + public static short nyMax(long struct) { return UNSAFE.getShort(null, struct + TT_Header.YMAX); } + /** Unsafe version of {@link #Mac_Style}. */ + public static short nMac_Style(long struct) { return UNSAFE.getShort(null, struct + TT_Header.MAC_STYLE); } + /** Unsafe version of {@link #Lowest_Rec_PPEM}. */ + public static short nLowest_Rec_PPEM(long struct) { return UNSAFE.getShort(null, struct + TT_Header.LOWEST_REC_PPEM); } + /** Unsafe version of {@link #Font_Direction}. */ + public static short nFont_Direction(long struct) { return UNSAFE.getShort(null, struct + TT_Header.FONT_DIRECTION); } + /** Unsafe version of {@link #Index_To_Loc_Format}. */ + public static short nIndex_To_Loc_Format(long struct) { return UNSAFE.getShort(null, struct + TT_Header.INDEX_TO_LOC_FORMAT); } + /** Unsafe version of {@link #Glyph_Data_Format}. */ + public static short nGlyph_Data_Format(long struct) { return UNSAFE.getShort(null, struct + TT_Header.GLYPH_DATA_FORMAT); } + + // ----------------------------------- + + /** An array of {@link TT_Header} structs. */ + public static class Buffer extends StructBufferChanges 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 TT_Header#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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 TT_Header getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code Table_Version} field. */ + @NativeType("FT_Fixed") + public long Table_Version() { return TT_Header.nTable_Version(address()); } + /** @return the value of the {@code Font_Revision} field. */ + @NativeType("FT_Fixed") + public long Font_Revision() { return TT_Header.nFont_Revision(address()); } + /** @return the value of the {@code CheckSum_Adjust} field. */ + @NativeType("FT_Long") + public long CheckSum_Adjust() { return TT_Header.nCheckSum_Adjust(address()); } + /** @return the value of the {@code Magic_Number} field. */ + @NativeType("FT_Long") + public long Magic_Number() { return TT_Header.nMagic_Number(address()); } + /** @return the value of the {@code Flags} field. */ + @NativeType("FT_UShort") + public short Flags() { return TT_Header.nFlags(address()); } + /** @return the value of the {@code Units_Per_EM} field. */ + @NativeType("FT_UShort") + public short Units_Per_EM() { return TT_Header.nUnits_Per_EM(address()); } + /** @return a {@link CLongBuffer} view of the {@code Created} field. */ + @NativeType("FT_ULong[2]") + public CLongBuffer Created() { return TT_Header.nCreated(address()); } + /** @return the value at the specified index of the {@code Created} field. */ + @NativeType("FT_ULong") + public long Created(int index) { return TT_Header.nCreated(address(), index); } + /** @return a {@link CLongBuffer} view of the {@code Modified} field. */ + @NativeType("FT_ULong[2]") + public CLongBuffer Modified() { return TT_Header.nModified(address()); } + /** @return the value at the specified index of the {@code Modified} field. */ + @NativeType("FT_ULong") + public long Modified(int index) { return TT_Header.nModified(address(), index); } + /** @return the value of the {@code xMin} field. */ + @NativeType("FT_Short") + public short xMin() { return TT_Header.nxMin(address()); } + /** @return the value of the {@code yMin} field. */ + @NativeType("FT_Short") + public short yMin() { return TT_Header.nyMin(address()); } + /** @return the value of the {@code xMax} field. */ + @NativeType("FT_Short") + public short xMax() { return TT_Header.nxMax(address()); } + /** @return the value of the {@code yMax} field. */ + @NativeType("FT_Short") + public short yMax() { return TT_Header.nyMax(address()); } + /** @return the value of the {@code Mac_Style} field. */ + @NativeType("FT_UShort") + public short Mac_Style() { return TT_Header.nMac_Style(address()); } + /** @return the value of the {@code Lowest_Rec_PPEM} field. */ + @NativeType("FT_UShort") + public short Lowest_Rec_PPEM() { return TT_Header.nLowest_Rec_PPEM(address()); } + /** @return the value of the {@code Font_Direction} field. */ + @NativeType("FT_Short") + public short Font_Direction() { return TT_Header.nFont_Direction(address()); } + /** @return the value of the {@code Index_To_Loc_Format} field. */ + @NativeType("FT_Short") + public short Index_To_Loc_Format() { return TT_Header.nIndex_To_Loc_Format(address()); } + /** @return the value of the {@code Glyph_Data_Format} field. */ + @NativeType("FT_Short") + public short Glyph_Data_Format() { return TT_Header.nGlyph_Data_Format(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_HoriHeader.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_HoriHeader.java new file mode 100644 index 00000000..4cd20af4 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_HoriHeader.java @@ -0,0 +1,364 @@ +/* + * 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.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model a TrueType horizontal header, the {@code hhea} table, as well as the corresponding horizontal metrics table, {@code hmtx}. + * + *
+ * struct TT_HoriHeader {
+ * FT_Fixed Version;
+ * FT_Short Ascender;
+ * FT_Short Descender;
+ * FT_Short Line_Gap;
+ * FT_UShort {@link #advance_Width_Max};
+ * FT_Short {@link #min_Left_Side_Bearing};
+ * FT_Short {@link #min_Right_Side_Bearing};
+ * FT_Short {@link #xMax_Extent};
+ * FT_Short caret_Slope_Rise;
+ * FT_Short caret_Slope_Run;
+ * FT_Short caret_Offset;
+ * FT_Short Reserved[4];
+ * FT_Short metric_Data_Format;
+ * FT_UShort number_Of_HMetrics;
+ * void * long_metrics;
+ * void * short_metrics;
+ * }
+ */
+public class TT_HoriHeader extends StructThe created instance holds a strong reference to the container object.
+ */ + public TT_HoriHeader(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code Version} field. */ + @NativeType("FT_Fixed") + public long Version() { return nVersion(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 Line_Gap} field. */ + @NativeType("FT_Short") + public short Line_Gap() { return nLine_Gap(address()); } + /** advance width maximum */ + @NativeType("FT_UShort") + public short advance_Width_Max() { return nadvance_Width_Max(address()); } + /** minimum left-sb */ + @NativeType("FT_Short") + public short min_Left_Side_Bearing() { return nmin_Left_Side_Bearing(address()); } + /** minimum right-sb */ + @NativeType("FT_Short") + public short min_Right_Side_Bearing() { return nmin_Right_Side_Bearing(address()); } + /** xmax extents */ + @NativeType("FT_Short") + public short xMax_Extent() { return nxMax_Extent(address()); } + /** @return the value of the {@code caret_Slope_Rise} field. */ + @NativeType("FT_Short") + public short caret_Slope_Rise() { return ncaret_Slope_Rise(address()); } + /** @return the value of the {@code caret_Slope_Run} field. */ + @NativeType("FT_Short") + public short caret_Slope_Run() { return ncaret_Slope_Run(address()); } + /** @return the value of the {@code caret_Offset} field. */ + @NativeType("FT_Short") + public short caret_Offset() { return ncaret_Offset(address()); } + /** @return a {@link ShortBuffer} view of the {@code Reserved} field. */ + @NativeType("FT_Short[4]") + public ShortBuffer Reserved() { return nReserved(address()); } + /** @return the value at the specified index of the {@code Reserved} field. */ + @NativeType("FT_Short") + public short Reserved(int index) { return nReserved(address(), index); } + /** @return the value of the {@code metric_Data_Format} field. */ + @NativeType("FT_Short") + public short metric_Data_Format() { return nmetric_Data_Format(address()); } + /** @return the value of the {@code number_Of_HMetrics} field. */ + @NativeType("FT_UShort") + public short number_Of_HMetrics() { return nnumber_Of_HMetrics(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code long_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer long_metrics(int capacity) { return nlong_metrics(address(), capacity); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code short_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer short_metrics(int capacity) { return nshort_metrics(address(), capacity); } + + // ----------------------------------- + + /** Returns a new {@code TT_HoriHeader} instance for the specified memory address. */ + public static TT_HoriHeader create(long address) { + return new TT_HoriHeader(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TT_HoriHeader createSafe(long address) { + return address == NULL ? null : new TT_HoriHeader(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 #Version}. */ + public static long nVersion(long struct) { return memGetCLong(struct + TT_HoriHeader.VERSION); } + /** Unsafe version of {@link #Ascender}. */ + public static short nAscender(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.ASCENDER); } + /** Unsafe version of {@link #Descender}. */ + public static short nDescender(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.DESCENDER); } + /** Unsafe version of {@link #Line_Gap}. */ + public static short nLine_Gap(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.LINE_GAP); } + /** Unsafe version of {@link #advance_Width_Max}. */ + public static short nadvance_Width_Max(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.ADVANCE_WIDTH_MAX); } + /** Unsafe version of {@link #min_Left_Side_Bearing}. */ + public static short nmin_Left_Side_Bearing(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.MIN_LEFT_SIDE_BEARING); } + /** Unsafe version of {@link #min_Right_Side_Bearing}. */ + public static short nmin_Right_Side_Bearing(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.MIN_RIGHT_SIDE_BEARING); } + /** Unsafe version of {@link #xMax_Extent}. */ + public static short nxMax_Extent(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.XMAX_EXTENT); } + /** Unsafe version of {@link #caret_Slope_Rise}. */ + public static short ncaret_Slope_Rise(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.CARET_SLOPE_RISE); } + /** Unsafe version of {@link #caret_Slope_Run}. */ + public static short ncaret_Slope_Run(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.CARET_SLOPE_RUN); } + /** Unsafe version of {@link #caret_Offset}. */ + public static short ncaret_Offset(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.CARET_OFFSET); } + /** Unsafe version of {@link #Reserved}. */ + public static ShortBuffer nReserved(long struct) { return memShortBuffer(struct + TT_HoriHeader.RESERVED, 4); } + /** Unsafe version of {@link #Reserved(int) Reserved}. */ + public static short nReserved(long struct, int index) { + return UNSAFE.getShort(null, struct + TT_HoriHeader.RESERVED + check(index, 4) * 2); + } + /** Unsafe version of {@link #metric_Data_Format}. */ + public static short nmetric_Data_Format(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.METRIC_DATA_FORMAT); } + /** Unsafe version of {@link #number_Of_HMetrics}. */ + public static short nnumber_Of_HMetrics(long struct) { return UNSAFE.getShort(null, struct + TT_HoriHeader.NUMBER_OF_HMETRICS); } + /** Unsafe version of {@link #long_metrics(int) long_metrics}. */ + @Nullable public static ByteBuffer nlong_metrics(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + TT_HoriHeader.LONG_METRICS), capacity); } + /** Unsafe version of {@link #short_metrics(int) short_metrics}. */ + @Nullable public static ByteBuffer nshort_metrics(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + TT_HoriHeader.SHORT_METRICS), capacity); } + + // ----------------------------------- + + /** An array of {@link TT_HoriHeader} structs. */ + public static class Buffer extends StructBufferChanges 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 TT_HoriHeader#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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 TT_HoriHeader getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code Version} field. */ + @NativeType("FT_Fixed") + public long Version() { return TT_HoriHeader.nVersion(address()); } + /** @return the value of the {@code Ascender} field. */ + @NativeType("FT_Short") + public short Ascender() { return TT_HoriHeader.nAscender(address()); } + /** @return the value of the {@code Descender} field. */ + @NativeType("FT_Short") + public short Descender() { return TT_HoriHeader.nDescender(address()); } + /** @return the value of the {@code Line_Gap} field. */ + @NativeType("FT_Short") + public short Line_Gap() { return TT_HoriHeader.nLine_Gap(address()); } + /** @return the value of the {@link TT_HoriHeader#advance_Width_Max} field. */ + @NativeType("FT_UShort") + public short advance_Width_Max() { return TT_HoriHeader.nadvance_Width_Max(address()); } + /** @return the value of the {@link TT_HoriHeader#min_Left_Side_Bearing} field. */ + @NativeType("FT_Short") + public short min_Left_Side_Bearing() { return TT_HoriHeader.nmin_Left_Side_Bearing(address()); } + /** @return the value of the {@link TT_HoriHeader#min_Right_Side_Bearing} field. */ + @NativeType("FT_Short") + public short min_Right_Side_Bearing() { return TT_HoriHeader.nmin_Right_Side_Bearing(address()); } + /** @return the value of the {@link TT_HoriHeader#xMax_Extent} field. */ + @NativeType("FT_Short") + public short xMax_Extent() { return TT_HoriHeader.nxMax_Extent(address()); } + /** @return the value of the {@code caret_Slope_Rise} field. */ + @NativeType("FT_Short") + public short caret_Slope_Rise() { return TT_HoriHeader.ncaret_Slope_Rise(address()); } + /** @return the value of the {@code caret_Slope_Run} field. */ + @NativeType("FT_Short") + public short caret_Slope_Run() { return TT_HoriHeader.ncaret_Slope_Run(address()); } + /** @return the value of the {@code caret_Offset} field. */ + @NativeType("FT_Short") + public short caret_Offset() { return TT_HoriHeader.ncaret_Offset(address()); } + /** @return a {@link ShortBuffer} view of the {@code Reserved} field. */ + @NativeType("FT_Short[4]") + public ShortBuffer Reserved() { return TT_HoriHeader.nReserved(address()); } + /** @return the value at the specified index of the {@code Reserved} field. */ + @NativeType("FT_Short") + public short Reserved(int index) { return TT_HoriHeader.nReserved(address(), index); } + /** @return the value of the {@code metric_Data_Format} field. */ + @NativeType("FT_Short") + public short metric_Data_Format() { return TT_HoriHeader.nmetric_Data_Format(address()); } + /** @return the value of the {@code number_Of_HMetrics} field. */ + @NativeType("FT_UShort") + public short number_Of_HMetrics() { return TT_HoriHeader.nnumber_Of_HMetrics(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code long_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer long_metrics(int capacity) { return TT_HoriHeader.nlong_metrics(address(), capacity); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code short_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer short_metrics(int capacity) { return TT_HoriHeader.nshort_metrics(address(), capacity); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_MaxProfile.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_MaxProfile.java new file mode 100644 index 00000000..d91de98a --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_MaxProfile.java @@ -0,0 +1,321 @@ +/* + * 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 maximum profile ({@code maxp}) table contains many max values, which can be used to pre-allocate arrays for speeding up glyph loading and hinting. + * + *
+ * struct TT_MaxProfile {
+ * FT_Fixed version;
+ * FT_UShort numGlyphs;
+ * FT_UShort maxPoints;
+ * FT_UShort maxContours;
+ * FT_UShort maxCompositePoints;
+ * FT_UShort maxCompositeContours;
+ * FT_UShort maxZones;
+ * FT_UShort maxTwilightPoints;
+ * FT_UShort maxStorage;
+ * FT_UShort maxFunctionDefs;
+ * FT_UShort maxInstructionDefs;
+ * FT_UShort maxStackElements;
+ * FT_UShort maxSizeOfInstructions;
+ * FT_UShort maxComponentElements;
+ * FT_UShort maxComponentDepth;
+ * }
+ */
+public class TT_MaxProfile extends StructThe created instance holds a strong reference to the container object.
+ */ + public TT_MaxProfile(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code version} field. */ + @NativeType("FT_Fixed") + public long version() { return nversion(address()); } + /** @return the value of the {@code numGlyphs} field. */ + @NativeType("FT_UShort") + public short numGlyphs() { return nnumGlyphs(address()); } + /** @return the value of the {@code maxPoints} field. */ + @NativeType("FT_UShort") + public short maxPoints() { return nmaxPoints(address()); } + /** @return the value of the {@code maxContours} field. */ + @NativeType("FT_UShort") + public short maxContours() { return nmaxContours(address()); } + /** @return the value of the {@code maxCompositePoints} field. */ + @NativeType("FT_UShort") + public short maxCompositePoints() { return nmaxCompositePoints(address()); } + /** @return the value of the {@code maxCompositeContours} field. */ + @NativeType("FT_UShort") + public short maxCompositeContours() { return nmaxCompositeContours(address()); } + /** @return the value of the {@code maxZones} field. */ + @NativeType("FT_UShort") + public short maxZones() { return nmaxZones(address()); } + /** @return the value of the {@code maxTwilightPoints} field. */ + @NativeType("FT_UShort") + public short maxTwilightPoints() { return nmaxTwilightPoints(address()); } + /** @return the value of the {@code maxStorage} field. */ + @NativeType("FT_UShort") + public short maxStorage() { return nmaxStorage(address()); } + /** @return the value of the {@code maxFunctionDefs} field. */ + @NativeType("FT_UShort") + public short maxFunctionDefs() { return nmaxFunctionDefs(address()); } + /** @return the value of the {@code maxInstructionDefs} field. */ + @NativeType("FT_UShort") + public short maxInstructionDefs() { return nmaxInstructionDefs(address()); } + /** @return the value of the {@code maxStackElements} field. */ + @NativeType("FT_UShort") + public short maxStackElements() { return nmaxStackElements(address()); } + /** @return the value of the {@code maxSizeOfInstructions} field. */ + @NativeType("FT_UShort") + public short maxSizeOfInstructions() { return nmaxSizeOfInstructions(address()); } + /** @return the value of the {@code maxComponentElements} field. */ + @NativeType("FT_UShort") + public short maxComponentElements() { return nmaxComponentElements(address()); } + /** @return the value of the {@code maxComponentDepth} field. */ + @NativeType("FT_UShort") + public short maxComponentDepth() { return nmaxComponentDepth(address()); } + + // ----------------------------------- + + /** Returns a new {@code TT_MaxProfile} instance for the specified memory address. */ + public static TT_MaxProfile create(long address) { + return new TT_MaxProfile(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TT_MaxProfile createSafe(long address) { + return address == NULL ? null : new TT_MaxProfile(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 #version}. */ + public static long nversion(long struct) { return memGetCLong(struct + TT_MaxProfile.VERSION); } + /** Unsafe version of {@link #numGlyphs}. */ + public static short nnumGlyphs(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.NUMGLYPHS); } + /** Unsafe version of {@link #maxPoints}. */ + public static short nmaxPoints(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXPOINTS); } + /** Unsafe version of {@link #maxContours}. */ + public static short nmaxContours(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXCONTOURS); } + /** Unsafe version of {@link #maxCompositePoints}. */ + public static short nmaxCompositePoints(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXCOMPOSITEPOINTS); } + /** Unsafe version of {@link #maxCompositeContours}. */ + public static short nmaxCompositeContours(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXCOMPOSITECONTOURS); } + /** Unsafe version of {@link #maxZones}. */ + public static short nmaxZones(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXZONES); } + /** Unsafe version of {@link #maxTwilightPoints}. */ + public static short nmaxTwilightPoints(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXTWILIGHTPOINTS); } + /** Unsafe version of {@link #maxStorage}. */ + public static short nmaxStorage(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXSTORAGE); } + /** Unsafe version of {@link #maxFunctionDefs}. */ + public static short nmaxFunctionDefs(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXFUNCTIONDEFS); } + /** Unsafe version of {@link #maxInstructionDefs}. */ + public static short nmaxInstructionDefs(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXINSTRUCTIONDEFS); } + /** Unsafe version of {@link #maxStackElements}. */ + public static short nmaxStackElements(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXSTACKELEMENTS); } + /** Unsafe version of {@link #maxSizeOfInstructions}. */ + public static short nmaxSizeOfInstructions(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXSIZEOFINSTRUCTIONS); } + /** Unsafe version of {@link #maxComponentElements}. */ + public static short nmaxComponentElements(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXCOMPONENTELEMENTS); } + /** Unsafe version of {@link #maxComponentDepth}. */ + public static short nmaxComponentDepth(long struct) { return UNSAFE.getShort(null, struct + TT_MaxProfile.MAXCOMPONENTDEPTH); } + + // ----------------------------------- + + /** An array of {@link TT_MaxProfile} structs. */ + public static class Buffer extends StructBufferChanges 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 TT_MaxProfile#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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 TT_MaxProfile getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code version} field. */ + @NativeType("FT_Fixed") + public long version() { return TT_MaxProfile.nversion(address()); } + /** @return the value of the {@code numGlyphs} field. */ + @NativeType("FT_UShort") + public short numGlyphs() { return TT_MaxProfile.nnumGlyphs(address()); } + /** @return the value of the {@code maxPoints} field. */ + @NativeType("FT_UShort") + public short maxPoints() { return TT_MaxProfile.nmaxPoints(address()); } + /** @return the value of the {@code maxContours} field. */ + @NativeType("FT_UShort") + public short maxContours() { return TT_MaxProfile.nmaxContours(address()); } + /** @return the value of the {@code maxCompositePoints} field. */ + @NativeType("FT_UShort") + public short maxCompositePoints() { return TT_MaxProfile.nmaxCompositePoints(address()); } + /** @return the value of the {@code maxCompositeContours} field. */ + @NativeType("FT_UShort") + public short maxCompositeContours() { return TT_MaxProfile.nmaxCompositeContours(address()); } + /** @return the value of the {@code maxZones} field. */ + @NativeType("FT_UShort") + public short maxZones() { return TT_MaxProfile.nmaxZones(address()); } + /** @return the value of the {@code maxTwilightPoints} field. */ + @NativeType("FT_UShort") + public short maxTwilightPoints() { return TT_MaxProfile.nmaxTwilightPoints(address()); } + /** @return the value of the {@code maxStorage} field. */ + @NativeType("FT_UShort") + public short maxStorage() { return TT_MaxProfile.nmaxStorage(address()); } + /** @return the value of the {@code maxFunctionDefs} field. */ + @NativeType("FT_UShort") + public short maxFunctionDefs() { return TT_MaxProfile.nmaxFunctionDefs(address()); } + /** @return the value of the {@code maxInstructionDefs} field. */ + @NativeType("FT_UShort") + public short maxInstructionDefs() { return TT_MaxProfile.nmaxInstructionDefs(address()); } + /** @return the value of the {@code maxStackElements} field. */ + @NativeType("FT_UShort") + public short maxStackElements() { return TT_MaxProfile.nmaxStackElements(address()); } + /** @return the value of the {@code maxSizeOfInstructions} field. */ + @NativeType("FT_UShort") + public short maxSizeOfInstructions() { return TT_MaxProfile.nmaxSizeOfInstructions(address()); } + /** @return the value of the {@code maxComponentElements} field. */ + @NativeType("FT_UShort") + public short maxComponentElements() { return TT_MaxProfile.nmaxComponentElements(address()); } + /** @return the value of the {@code maxComponentDepth} field. */ + @NativeType("FT_UShort") + public short maxComponentDepth() { return TT_MaxProfile.nmaxComponentDepth(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_OS2.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_OS2.java new file mode 100644 index 00000000..43de32e4 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_OS2.java @@ -0,0 +1,630 @@ +/* + * 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.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model a TrueType {@code OS/2} table. + * + *
+ * struct TT_OS2 {
+ * FT_UShort version;
+ * FT_Short xAvgCharWidth;
+ * FT_UShort usWeightClass;
+ * FT_UShort usWidthClass;
+ * FT_UShort fsType;
+ * FT_Short ySubscriptXSize;
+ * FT_Short ySubscriptYSize;
+ * FT_Short ySubscriptXOffset;
+ * FT_Short ySubscriptYOffset;
+ * FT_Short ySuperscriptXSize;
+ * FT_Short ySuperscriptYSize;
+ * FT_Short ySuperscriptXOffset;
+ * FT_Short ySuperscriptYOffset;
+ * FT_Short yStrikeoutSize;
+ * FT_Short yStrikeoutPosition;
+ * FT_Short sFamilyClass;
+ * FT_Byte panose[10];
+ * FT_ULong ulUnicodeRange1;
+ * FT_ULong ulUnicodeRange2;
+ * FT_ULong ulUnicodeRange3;
+ * FT_ULong ulUnicodeRange4;
+ * FT_Char achVendID[4];
+ * FT_UShort fsSelection;
+ * FT_UShort usFirstCharIndex;
+ * FT_UShort usLastCharIndex;
+ * FT_Short sTypoAscender;
+ * FT_Short sTypoDescender;
+ * FT_Short sTypoLineGap;
+ * FT_UShort usWinAscent;
+ * FT_UShort usWinDescent;
+ * FT_ULong ulCodePageRange1;
+ * FT_ULong ulCodePageRange2;
+ * FT_Short sxHeight;
+ * FT_Short sCapHeight;
+ * FT_UShort usDefaultChar;
+ * FT_UShort usBreakChar;
+ * FT_UShort usMaxContext;
+ * FT_UShort usLowerOpticalPointSize;
+ * FT_UShort usUpperOpticalPointSize;
+ * }
+ */
+public class TT_OS2 extends StructThe created instance holds a strong reference to the container object.
+ */ + public TT_OS2(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code version} field. */ + @NativeType("FT_UShort") + public short version() { return nversion(address()); } + /** @return the value of the {@code xAvgCharWidth} field. */ + @NativeType("FT_Short") + public short xAvgCharWidth() { return nxAvgCharWidth(address()); } + /** @return the value of the {@code usWeightClass} field. */ + @NativeType("FT_UShort") + public short usWeightClass() { return nusWeightClass(address()); } + /** @return the value of the {@code usWidthClass} field. */ + @NativeType("FT_UShort") + public short usWidthClass() { return nusWidthClass(address()); } + /** @return the value of the {@code fsType} field. */ + @NativeType("FT_UShort") + public short fsType() { return nfsType(address()); } + /** @return the value of the {@code ySubscriptXSize} field. */ + @NativeType("FT_Short") + public short ySubscriptXSize() { return nySubscriptXSize(address()); } + /** @return the value of the {@code ySubscriptYSize} field. */ + @NativeType("FT_Short") + public short ySubscriptYSize() { return nySubscriptYSize(address()); } + /** @return the value of the {@code ySubscriptXOffset} field. */ + @NativeType("FT_Short") + public short ySubscriptXOffset() { return nySubscriptXOffset(address()); } + /** @return the value of the {@code ySubscriptYOffset} field. */ + @NativeType("FT_Short") + public short ySubscriptYOffset() { return nySubscriptYOffset(address()); } + /** @return the value of the {@code ySuperscriptXSize} field. */ + @NativeType("FT_Short") + public short ySuperscriptXSize() { return nySuperscriptXSize(address()); } + /** @return the value of the {@code ySuperscriptYSize} field. */ + @NativeType("FT_Short") + public short ySuperscriptYSize() { return nySuperscriptYSize(address()); } + /** @return the value of the {@code ySuperscriptXOffset} field. */ + @NativeType("FT_Short") + public short ySuperscriptXOffset() { return nySuperscriptXOffset(address()); } + /** @return the value of the {@code ySuperscriptYOffset} field. */ + @NativeType("FT_Short") + public short ySuperscriptYOffset() { return nySuperscriptYOffset(address()); } + /** @return the value of the {@code yStrikeoutSize} field. */ + @NativeType("FT_Short") + public short yStrikeoutSize() { return nyStrikeoutSize(address()); } + /** @return the value of the {@code yStrikeoutPosition} field. */ + @NativeType("FT_Short") + public short yStrikeoutPosition() { return nyStrikeoutPosition(address()); } + /** @return the value of the {@code sFamilyClass} field. */ + @NativeType("FT_Short") + public short sFamilyClass() { return nsFamilyClass(address()); } + /** @return a {@link ByteBuffer} view of the {@code panose} field. */ + @NativeType("FT_Byte[10]") + public ByteBuffer panose() { return npanose(address()); } + /** @return the value at the specified index of the {@code panose} field. */ + @NativeType("FT_Byte") + public byte panose(int index) { return npanose(address(), index); } + /** @return the value of the {@code ulUnicodeRange1} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange1() { return nulUnicodeRange1(address()); } + /** @return the value of the {@code ulUnicodeRange2} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange2() { return nulUnicodeRange2(address()); } + /** @return the value of the {@code ulUnicodeRange3} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange3() { return nulUnicodeRange3(address()); } + /** @return the value of the {@code ulUnicodeRange4} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange4() { return nulUnicodeRange4(address()); } + /** @return a {@link ByteBuffer} view of the {@code achVendID} field. */ + @NativeType("FT_Char[4]") + public ByteBuffer achVendID() { return nachVendID(address()); } + /** @return the value at the specified index of the {@code achVendID} field. */ + @NativeType("FT_Char") + public byte achVendID(int index) { return nachVendID(address(), index); } + /** @return the value of the {@code fsSelection} field. */ + @NativeType("FT_UShort") + public short fsSelection() { return nfsSelection(address()); } + /** @return the value of the {@code usFirstCharIndex} field. */ + @NativeType("FT_UShort") + public short usFirstCharIndex() { return nusFirstCharIndex(address()); } + /** @return the value of the {@code usLastCharIndex} field. */ + @NativeType("FT_UShort") + public short usLastCharIndex() { return nusLastCharIndex(address()); } + /** @return the value of the {@code sTypoAscender} field. */ + @NativeType("FT_Short") + public short sTypoAscender() { return nsTypoAscender(address()); } + /** @return the value of the {@code sTypoDescender} field. */ + @NativeType("FT_Short") + public short sTypoDescender() { return nsTypoDescender(address()); } + /** @return the value of the {@code sTypoLineGap} field. */ + @NativeType("FT_Short") + public short sTypoLineGap() { return nsTypoLineGap(address()); } + /** @return the value of the {@code usWinAscent} field. */ + @NativeType("FT_UShort") + public short usWinAscent() { return nusWinAscent(address()); } + /** @return the value of the {@code usWinDescent} field. */ + @NativeType("FT_UShort") + public short usWinDescent() { return nusWinDescent(address()); } + /** @return the value of the {@code ulCodePageRange1} field. */ + @NativeType("FT_ULong") + public long ulCodePageRange1() { return nulCodePageRange1(address()); } + /** @return the value of the {@code ulCodePageRange2} field. */ + @NativeType("FT_ULong") + public long ulCodePageRange2() { return nulCodePageRange2(address()); } + /** @return the value of the {@code sxHeight} field. */ + @NativeType("FT_Short") + public short sxHeight() { return nsxHeight(address()); } + /** @return the value of the {@code sCapHeight} field. */ + @NativeType("FT_Short") + public short sCapHeight() { return nsCapHeight(address()); } + /** @return the value of the {@code usDefaultChar} field. */ + @NativeType("FT_UShort") + public short usDefaultChar() { return nusDefaultChar(address()); } + /** @return the value of the {@code usBreakChar} field. */ + @NativeType("FT_UShort") + public short usBreakChar() { return nusBreakChar(address()); } + /** @return the value of the {@code usMaxContext} field. */ + @NativeType("FT_UShort") + public short usMaxContext() { return nusMaxContext(address()); } + /** @return the value of the {@code usLowerOpticalPointSize} field. */ + @NativeType("FT_UShort") + public short usLowerOpticalPointSize() { return nusLowerOpticalPointSize(address()); } + /** @return the value of the {@code usUpperOpticalPointSize} field. */ + @NativeType("FT_UShort") + public short usUpperOpticalPointSize() { return nusUpperOpticalPointSize(address()); } + + // ----------------------------------- + + /** Returns a new {@code TT_OS2} instance for the specified memory address. */ + public static TT_OS2 create(long address) { + return new TT_OS2(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TT_OS2 createSafe(long address) { + return address == NULL ? null : new TT_OS2(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 #version}. */ + public static short nversion(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.VERSION); } + /** Unsafe version of {@link #xAvgCharWidth}. */ + public static short nxAvgCharWidth(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.XAVGCHARWIDTH); } + /** Unsafe version of {@link #usWeightClass}. */ + public static short nusWeightClass(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USWEIGHTCLASS); } + /** Unsafe version of {@link #usWidthClass}. */ + public static short nusWidthClass(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USWIDTHCLASS); } + /** Unsafe version of {@link #fsType}. */ + public static short nfsType(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.FSTYPE); } + /** Unsafe version of {@link #ySubscriptXSize}. */ + public static short nySubscriptXSize(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUBSCRIPTXSIZE); } + /** Unsafe version of {@link #ySubscriptYSize}. */ + public static short nySubscriptYSize(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUBSCRIPTYSIZE); } + /** Unsafe version of {@link #ySubscriptXOffset}. */ + public static short nySubscriptXOffset(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUBSCRIPTXOFFSET); } + /** Unsafe version of {@link #ySubscriptYOffset}. */ + public static short nySubscriptYOffset(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUBSCRIPTYOFFSET); } + /** Unsafe version of {@link #ySuperscriptXSize}. */ + public static short nySuperscriptXSize(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUPERSCRIPTXSIZE); } + /** Unsafe version of {@link #ySuperscriptYSize}. */ + public static short nySuperscriptYSize(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUPERSCRIPTYSIZE); } + /** Unsafe version of {@link #ySuperscriptXOffset}. */ + public static short nySuperscriptXOffset(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUPERSCRIPTXOFFSET); } + /** Unsafe version of {@link #ySuperscriptYOffset}. */ + public static short nySuperscriptYOffset(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSUPERSCRIPTYOFFSET); } + /** Unsafe version of {@link #yStrikeoutSize}. */ + public static short nyStrikeoutSize(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSTRIKEOUTSIZE); } + /** Unsafe version of {@link #yStrikeoutPosition}. */ + public static short nyStrikeoutPosition(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.YSTRIKEOUTPOSITION); } + /** Unsafe version of {@link #sFamilyClass}. */ + public static short nsFamilyClass(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.SFAMILYCLASS); } + /** Unsafe version of {@link #panose}. */ + public static ByteBuffer npanose(long struct) { return memByteBuffer(struct + TT_OS2.PANOSE, 10); } + /** Unsafe version of {@link #panose(int) panose}. */ + public static byte npanose(long struct, int index) { + return UNSAFE.getByte(null, struct + TT_OS2.PANOSE + check(index, 10) * 1); + } + /** Unsafe version of {@link #ulUnicodeRange1}. */ + public static long nulUnicodeRange1(long struct) { return memGetCLong(struct + TT_OS2.ULUNICODERANGE1); } + /** Unsafe version of {@link #ulUnicodeRange2}. */ + public static long nulUnicodeRange2(long struct) { return memGetCLong(struct + TT_OS2.ULUNICODERANGE2); } + /** Unsafe version of {@link #ulUnicodeRange3}. */ + public static long nulUnicodeRange3(long struct) { return memGetCLong(struct + TT_OS2.ULUNICODERANGE3); } + /** Unsafe version of {@link #ulUnicodeRange4}. */ + public static long nulUnicodeRange4(long struct) { return memGetCLong(struct + TT_OS2.ULUNICODERANGE4); } + /** Unsafe version of {@link #achVendID}. */ + public static ByteBuffer nachVendID(long struct) { return memByteBuffer(struct + TT_OS2.ACHVENDID, 4); } + /** Unsafe version of {@link #achVendID(int) achVendID}. */ + public static byte nachVendID(long struct, int index) { + return UNSAFE.getByte(null, struct + TT_OS2.ACHVENDID + check(index, 4) * 1); + } + /** Unsafe version of {@link #fsSelection}. */ + public static short nfsSelection(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.FSSELECTION); } + /** Unsafe version of {@link #usFirstCharIndex}. */ + public static short nusFirstCharIndex(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USFIRSTCHARINDEX); } + /** Unsafe version of {@link #usLastCharIndex}. */ + public static short nusLastCharIndex(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USLASTCHARINDEX); } + /** Unsafe version of {@link #sTypoAscender}. */ + public static short nsTypoAscender(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.STYPOASCENDER); } + /** Unsafe version of {@link #sTypoDescender}. */ + public static short nsTypoDescender(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.STYPODESCENDER); } + /** Unsafe version of {@link #sTypoLineGap}. */ + public static short nsTypoLineGap(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.STYPOLINEGAP); } + /** Unsafe version of {@link #usWinAscent}. */ + public static short nusWinAscent(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USWINASCENT); } + /** Unsafe version of {@link #usWinDescent}. */ + public static short nusWinDescent(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USWINDESCENT); } + /** Unsafe version of {@link #ulCodePageRange1}. */ + public static long nulCodePageRange1(long struct) { return memGetCLong(struct + TT_OS2.ULCODEPAGERANGE1); } + /** Unsafe version of {@link #ulCodePageRange2}. */ + public static long nulCodePageRange2(long struct) { return memGetCLong(struct + TT_OS2.ULCODEPAGERANGE2); } + /** Unsafe version of {@link #sxHeight}. */ + public static short nsxHeight(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.SXHEIGHT); } + /** Unsafe version of {@link #sCapHeight}. */ + public static short nsCapHeight(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.SCAPHEIGHT); } + /** Unsafe version of {@link #usDefaultChar}. */ + public static short nusDefaultChar(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USDEFAULTCHAR); } + /** Unsafe version of {@link #usBreakChar}. */ + public static short nusBreakChar(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USBREAKCHAR); } + /** Unsafe version of {@link #usMaxContext}. */ + public static short nusMaxContext(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USMAXCONTEXT); } + /** Unsafe version of {@link #usLowerOpticalPointSize}. */ + public static short nusLowerOpticalPointSize(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USLOWEROPTICALPOINTSIZE); } + /** Unsafe version of {@link #usUpperOpticalPointSize}. */ + public static short nusUpperOpticalPointSize(long struct) { return UNSAFE.getShort(null, struct + TT_OS2.USUPPEROPTICALPOINTSIZE); } + + // ----------------------------------- + + /** An array of {@link TT_OS2} structs. */ + public static class Buffer extends StructBufferChanges 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 TT_OS2#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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 TT_OS2 getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code version} field. */ + @NativeType("FT_UShort") + public short version() { return TT_OS2.nversion(address()); } + /** @return the value of the {@code xAvgCharWidth} field. */ + @NativeType("FT_Short") + public short xAvgCharWidth() { return TT_OS2.nxAvgCharWidth(address()); } + /** @return the value of the {@code usWeightClass} field. */ + @NativeType("FT_UShort") + public short usWeightClass() { return TT_OS2.nusWeightClass(address()); } + /** @return the value of the {@code usWidthClass} field. */ + @NativeType("FT_UShort") + public short usWidthClass() { return TT_OS2.nusWidthClass(address()); } + /** @return the value of the {@code fsType} field. */ + @NativeType("FT_UShort") + public short fsType() { return TT_OS2.nfsType(address()); } + /** @return the value of the {@code ySubscriptXSize} field. */ + @NativeType("FT_Short") + public short ySubscriptXSize() { return TT_OS2.nySubscriptXSize(address()); } + /** @return the value of the {@code ySubscriptYSize} field. */ + @NativeType("FT_Short") + public short ySubscriptYSize() { return TT_OS2.nySubscriptYSize(address()); } + /** @return the value of the {@code ySubscriptXOffset} field. */ + @NativeType("FT_Short") + public short ySubscriptXOffset() { return TT_OS2.nySubscriptXOffset(address()); } + /** @return the value of the {@code ySubscriptYOffset} field. */ + @NativeType("FT_Short") + public short ySubscriptYOffset() { return TT_OS2.nySubscriptYOffset(address()); } + /** @return the value of the {@code ySuperscriptXSize} field. */ + @NativeType("FT_Short") + public short ySuperscriptXSize() { return TT_OS2.nySuperscriptXSize(address()); } + /** @return the value of the {@code ySuperscriptYSize} field. */ + @NativeType("FT_Short") + public short ySuperscriptYSize() { return TT_OS2.nySuperscriptYSize(address()); } + /** @return the value of the {@code ySuperscriptXOffset} field. */ + @NativeType("FT_Short") + public short ySuperscriptXOffset() { return TT_OS2.nySuperscriptXOffset(address()); } + /** @return the value of the {@code ySuperscriptYOffset} field. */ + @NativeType("FT_Short") + public short ySuperscriptYOffset() { return TT_OS2.nySuperscriptYOffset(address()); } + /** @return the value of the {@code yStrikeoutSize} field. */ + @NativeType("FT_Short") + public short yStrikeoutSize() { return TT_OS2.nyStrikeoutSize(address()); } + /** @return the value of the {@code yStrikeoutPosition} field. */ + @NativeType("FT_Short") + public short yStrikeoutPosition() { return TT_OS2.nyStrikeoutPosition(address()); } + /** @return the value of the {@code sFamilyClass} field. */ + @NativeType("FT_Short") + public short sFamilyClass() { return TT_OS2.nsFamilyClass(address()); } + /** @return a {@link ByteBuffer} view of the {@code panose} field. */ + @NativeType("FT_Byte[10]") + public ByteBuffer panose() { return TT_OS2.npanose(address()); } + /** @return the value at the specified index of the {@code panose} field. */ + @NativeType("FT_Byte") + public byte panose(int index) { return TT_OS2.npanose(address(), index); } + /** @return the value of the {@code ulUnicodeRange1} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange1() { return TT_OS2.nulUnicodeRange1(address()); } + /** @return the value of the {@code ulUnicodeRange2} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange2() { return TT_OS2.nulUnicodeRange2(address()); } + /** @return the value of the {@code ulUnicodeRange3} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange3() { return TT_OS2.nulUnicodeRange3(address()); } + /** @return the value of the {@code ulUnicodeRange4} field. */ + @NativeType("FT_ULong") + public long ulUnicodeRange4() { return TT_OS2.nulUnicodeRange4(address()); } + /** @return a {@link ByteBuffer} view of the {@code achVendID} field. */ + @NativeType("FT_Char[4]") + public ByteBuffer achVendID() { return TT_OS2.nachVendID(address()); } + /** @return the value at the specified index of the {@code achVendID} field. */ + @NativeType("FT_Char") + public byte achVendID(int index) { return TT_OS2.nachVendID(address(), index); } + /** @return the value of the {@code fsSelection} field. */ + @NativeType("FT_UShort") + public short fsSelection() { return TT_OS2.nfsSelection(address()); } + /** @return the value of the {@code usFirstCharIndex} field. */ + @NativeType("FT_UShort") + public short usFirstCharIndex() { return TT_OS2.nusFirstCharIndex(address()); } + /** @return the value of the {@code usLastCharIndex} field. */ + @NativeType("FT_UShort") + public short usLastCharIndex() { return TT_OS2.nusLastCharIndex(address()); } + /** @return the value of the {@code sTypoAscender} field. */ + @NativeType("FT_Short") + public short sTypoAscender() { return TT_OS2.nsTypoAscender(address()); } + /** @return the value of the {@code sTypoDescender} field. */ + @NativeType("FT_Short") + public short sTypoDescender() { return TT_OS2.nsTypoDescender(address()); } + /** @return the value of the {@code sTypoLineGap} field. */ + @NativeType("FT_Short") + public short sTypoLineGap() { return TT_OS2.nsTypoLineGap(address()); } + /** @return the value of the {@code usWinAscent} field. */ + @NativeType("FT_UShort") + public short usWinAscent() { return TT_OS2.nusWinAscent(address()); } + /** @return the value of the {@code usWinDescent} field. */ + @NativeType("FT_UShort") + public short usWinDescent() { return TT_OS2.nusWinDescent(address()); } + /** @return the value of the {@code ulCodePageRange1} field. */ + @NativeType("FT_ULong") + public long ulCodePageRange1() { return TT_OS2.nulCodePageRange1(address()); } + /** @return the value of the {@code ulCodePageRange2} field. */ + @NativeType("FT_ULong") + public long ulCodePageRange2() { return TT_OS2.nulCodePageRange2(address()); } + /** @return the value of the {@code sxHeight} field. */ + @NativeType("FT_Short") + public short sxHeight() { return TT_OS2.nsxHeight(address()); } + /** @return the value of the {@code sCapHeight} field. */ + @NativeType("FT_Short") + public short sCapHeight() { return TT_OS2.nsCapHeight(address()); } + /** @return the value of the {@code usDefaultChar} field. */ + @NativeType("FT_UShort") + public short usDefaultChar() { return TT_OS2.nusDefaultChar(address()); } + /** @return the value of the {@code usBreakChar} field. */ + @NativeType("FT_UShort") + public short usBreakChar() { return TT_OS2.nusBreakChar(address()); } + /** @return the value of the {@code usMaxContext} field. */ + @NativeType("FT_UShort") + public short usMaxContext() { return TT_OS2.nusMaxContext(address()); } + /** @return the value of the {@code usLowerOpticalPointSize} field. */ + @NativeType("FT_UShort") + public short usLowerOpticalPointSize() { return TT_OS2.nusLowerOpticalPointSize(address()); } + /** @return the value of the {@code usUpperOpticalPointSize} field. */ + @NativeType("FT_UShort") + public short usUpperOpticalPointSize() { return TT_OS2.nusUpperOpticalPointSize(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_PCLT.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_PCLT.java new file mode 100644 index 00000000..e4534abc --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_PCLT.java @@ -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.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure to model a TrueType {@code PCLT} table. + * + *
+ * struct TT_PCLT {
+ * FT_Fixed Version;
+ * FT_ULong FontNumber;
+ * FT_UShort Pitch;
+ * FT_UShort xHeight;
+ * FT_UShort Style;
+ * FT_UShort TypeFamily;
+ * FT_UShort CapHeight;
+ * FT_UShort SymbolSet;
+ * FT_Char TypeFace[16];
+ * FT_Char CharacterComplement[8];
+ * FT_Char FileName[6];
+ * FT_Char StrokeWeight;
+ * FT_Char WidthType;
+ * FT_Byte SerifStyle;
+ * FT_Byte Reserved;
+ * }
+ */
+public class TT_PCLT extends StructThe created instance holds a strong reference to the container object.
+ */ + public TT_PCLT(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code Version} field. */ + @NativeType("FT_Fixed") + public long Version() { return nVersion(address()); } + /** @return the value of the {@code FontNumber} field. */ + @NativeType("FT_ULong") + public long FontNumber() { return nFontNumber(address()); } + /** @return the value of the {@code Pitch} field. */ + @NativeType("FT_UShort") + public short Pitch() { return nPitch(address()); } + /** @return the value of the {@code xHeight} field. */ + @NativeType("FT_UShort") + public short xHeight() { return nxHeight(address()); } + /** @return the value of the {@code Style} field. */ + @NativeType("FT_UShort") + public short Style() { return nStyle(address()); } + /** @return the value of the {@code TypeFamily} field. */ + @NativeType("FT_UShort") + public short TypeFamily() { return nTypeFamily(address()); } + /** @return the value of the {@code CapHeight} field. */ + @NativeType("FT_UShort") + public short CapHeight() { return nCapHeight(address()); } + /** @return the value of the {@code SymbolSet} field. */ + @NativeType("FT_UShort") + public short SymbolSet() { return nSymbolSet(address()); } + /** @return a {@link ByteBuffer} view of the {@code TypeFace} field. */ + @NativeType("FT_Char[16]") + public ByteBuffer TypeFace() { return nTypeFace(address()); } + /** @return the value at the specified index of the {@code TypeFace} field. */ + @NativeType("FT_Char") + public byte TypeFace(int index) { return nTypeFace(address(), index); } + /** @return a {@link ByteBuffer} view of the {@code CharacterComplement} field. */ + @NativeType("FT_Char[8]") + public ByteBuffer CharacterComplement() { return nCharacterComplement(address()); } + /** @return the value at the specified index of the {@code CharacterComplement} field. */ + @NativeType("FT_Char") + public byte CharacterComplement(int index) { return nCharacterComplement(address(), index); } + /** @return a {@link ByteBuffer} view of the {@code FileName} field. */ + @NativeType("FT_Char[6]") + public ByteBuffer FileName() { return nFileName(address()); } + /** @return the value at the specified index of the {@code FileName} field. */ + @NativeType("FT_Char") + public byte FileName(int index) { return nFileName(address(), index); } + /** @return the value of the {@code StrokeWeight} field. */ + @NativeType("FT_Char") + public byte StrokeWeight() { return nStrokeWeight(address()); } + /** @return the value of the {@code WidthType} field. */ + @NativeType("FT_Char") + public byte WidthType() { return nWidthType(address()); } + /** @return the value of the {@code SerifStyle} field. */ + @NativeType("FT_Byte") + public byte SerifStyle() { return nSerifStyle(address()); } + /** @return the value of the {@code Reserved} field. */ + @NativeType("FT_Byte") + public byte Reserved() { return nReserved(address()); } + + // ----------------------------------- + + /** Returns a new {@code TT_PCLT} instance for the specified memory address. */ + public static TT_PCLT create(long address) { + return new TT_PCLT(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TT_PCLT createSafe(long address) { + return address == NULL ? null : new TT_PCLT(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 #Version}. */ + public static long nVersion(long struct) { return memGetCLong(struct + TT_PCLT.VERSION); } + /** Unsafe version of {@link #FontNumber}. */ + public static long nFontNumber(long struct) { return memGetCLong(struct + TT_PCLT.FONTNUMBER); } + /** Unsafe version of {@link #Pitch}. */ + public static short nPitch(long struct) { return UNSAFE.getShort(null, struct + TT_PCLT.PITCH); } + /** Unsafe version of {@link #xHeight}. */ + public static short nxHeight(long struct) { return UNSAFE.getShort(null, struct + TT_PCLT.XHEIGHT); } + /** Unsafe version of {@link #Style}. */ + public static short nStyle(long struct) { return UNSAFE.getShort(null, struct + TT_PCLT.STYLE); } + /** Unsafe version of {@link #TypeFamily}. */ + public static short nTypeFamily(long struct) { return UNSAFE.getShort(null, struct + TT_PCLT.TYPEFAMILY); } + /** Unsafe version of {@link #CapHeight}. */ + public static short nCapHeight(long struct) { return UNSAFE.getShort(null, struct + TT_PCLT.CAPHEIGHT); } + /** Unsafe version of {@link #SymbolSet}. */ + public static short nSymbolSet(long struct) { return UNSAFE.getShort(null, struct + TT_PCLT.SYMBOLSET); } + /** Unsafe version of {@link #TypeFace}. */ + public static ByteBuffer nTypeFace(long struct) { return memByteBuffer(struct + TT_PCLT.TYPEFACE, 16); } + /** Unsafe version of {@link #TypeFace(int) TypeFace}. */ + public static byte nTypeFace(long struct, int index) { + return UNSAFE.getByte(null, struct + TT_PCLT.TYPEFACE + check(index, 16) * 1); + } + /** Unsafe version of {@link #CharacterComplement}. */ + public static ByteBuffer nCharacterComplement(long struct) { return memByteBuffer(struct + TT_PCLT.CHARACTERCOMPLEMENT, 8); } + /** Unsafe version of {@link #CharacterComplement(int) CharacterComplement}. */ + public static byte nCharacterComplement(long struct, int index) { + return UNSAFE.getByte(null, struct + TT_PCLT.CHARACTERCOMPLEMENT + check(index, 8) * 1); + } + /** Unsafe version of {@link #FileName}. */ + public static ByteBuffer nFileName(long struct) { return memByteBuffer(struct + TT_PCLT.FILENAME, 6); } + /** Unsafe version of {@link #FileName(int) FileName}. */ + public static byte nFileName(long struct, int index) { + return UNSAFE.getByte(null, struct + TT_PCLT.FILENAME + check(index, 6) * 1); + } + /** Unsafe version of {@link #StrokeWeight}. */ + public static byte nStrokeWeight(long struct) { return UNSAFE.getByte(null, struct + TT_PCLT.STROKEWEIGHT); } + /** Unsafe version of {@link #WidthType}. */ + public static byte nWidthType(long struct) { return UNSAFE.getByte(null, struct + TT_PCLT.WIDTHTYPE); } + /** Unsafe version of {@link #SerifStyle}. */ + public static byte nSerifStyle(long struct) { return UNSAFE.getByte(null, struct + TT_PCLT.SERIFSTYLE); } + /** Unsafe version of {@link #Reserved}. */ + public static byte nReserved(long struct) { return UNSAFE.getByte(null, struct + TT_PCLT.RESERVED); } + + // ----------------------------------- + + /** An array of {@link TT_PCLT} structs. */ + public static class Buffer extends StructBufferChanges 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 TT_PCLT#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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 TT_PCLT getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code Version} field. */ + @NativeType("FT_Fixed") + public long Version() { return TT_PCLT.nVersion(address()); } + /** @return the value of the {@code FontNumber} field. */ + @NativeType("FT_ULong") + public long FontNumber() { return TT_PCLT.nFontNumber(address()); } + /** @return the value of the {@code Pitch} field. */ + @NativeType("FT_UShort") + public short Pitch() { return TT_PCLT.nPitch(address()); } + /** @return the value of the {@code xHeight} field. */ + @NativeType("FT_UShort") + public short xHeight() { return TT_PCLT.nxHeight(address()); } + /** @return the value of the {@code Style} field. */ + @NativeType("FT_UShort") + public short Style() { return TT_PCLT.nStyle(address()); } + /** @return the value of the {@code TypeFamily} field. */ + @NativeType("FT_UShort") + public short TypeFamily() { return TT_PCLT.nTypeFamily(address()); } + /** @return the value of the {@code CapHeight} field. */ + @NativeType("FT_UShort") + public short CapHeight() { return TT_PCLT.nCapHeight(address()); } + /** @return the value of the {@code SymbolSet} field. */ + @NativeType("FT_UShort") + public short SymbolSet() { return TT_PCLT.nSymbolSet(address()); } + /** @return a {@link ByteBuffer} view of the {@code TypeFace} field. */ + @NativeType("FT_Char[16]") + public ByteBuffer TypeFace() { return TT_PCLT.nTypeFace(address()); } + /** @return the value at the specified index of the {@code TypeFace} field. */ + @NativeType("FT_Char") + public byte TypeFace(int index) { return TT_PCLT.nTypeFace(address(), index); } + /** @return a {@link ByteBuffer} view of the {@code CharacterComplement} field. */ + @NativeType("FT_Char[8]") + public ByteBuffer CharacterComplement() { return TT_PCLT.nCharacterComplement(address()); } + /** @return the value at the specified index of the {@code CharacterComplement} field. */ + @NativeType("FT_Char") + public byte CharacterComplement(int index) { return TT_PCLT.nCharacterComplement(address(), index); } + /** @return a {@link ByteBuffer} view of the {@code FileName} field. */ + @NativeType("FT_Char[6]") + public ByteBuffer FileName() { return TT_PCLT.nFileName(address()); } + /** @return the value at the specified index of the {@code FileName} field. */ + @NativeType("FT_Char") + public byte FileName(int index) { return TT_PCLT.nFileName(address(), index); } + /** @return the value of the {@code StrokeWeight} field. */ + @NativeType("FT_Char") + public byte StrokeWeight() { return TT_PCLT.nStrokeWeight(address()); } + /** @return the value of the {@code WidthType} field. */ + @NativeType("FT_Char") + public byte WidthType() { return TT_PCLT.nWidthType(address()); } + /** @return the value of the {@code SerifStyle} field. */ + @NativeType("FT_Byte") + public byte SerifStyle() { return TT_PCLT.nSerifStyle(address()); } + /** @return the value of the {@code Reserved} field. */ + @NativeType("FT_Byte") + public byte Reserved() { return TT_PCLT.nReserved(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_Postscript.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_Postscript.java new file mode 100644 index 00000000..0268220a --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_Postscript.java @@ -0,0 +1,249 @@ +/* + * 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 TrueType 'post' table. + * + *
+ * struct TT_Postscript {
+ * FT_Fixed FormatType;
+ * FT_Fixed italicAngle;
+ * FT_Short underlinePosition;
+ * FT_Short underlineThickness;
+ * FT_ULong isFixedPitch;
+ * FT_ULong minMemType42;
+ * FT_ULong maxMemType42;
+ * FT_ULong minMemType1;
+ * FT_ULong maxMemType1;
+ * }
+ */
+public class TT_Postscript extends StructThe created instance holds a strong reference to the container object.
+ */ + public TT_Postscript(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code FormatType} field. */ + @NativeType("FT_Fixed") + public long FormatType() { return nFormatType(address()); } + /** @return the value of the {@code italicAngle} field. */ + @NativeType("FT_Fixed") + public long italicAngle() { return nitalicAngle(address()); } + /** @return the value of the {@code underlinePosition} field. */ + @NativeType("FT_Short") + public short underlinePosition() { return nunderlinePosition(address()); } + /** @return the value of the {@code underlineThickness} field. */ + @NativeType("FT_Short") + public short underlineThickness() { return nunderlineThickness(address()); } + /** @return the value of the {@code isFixedPitch} field. */ + @NativeType("FT_ULong") + public long isFixedPitch() { return nisFixedPitch(address()); } + /** @return the value of the {@code minMemType42} field. */ + @NativeType("FT_ULong") + public long minMemType42() { return nminMemType42(address()); } + /** @return the value of the {@code maxMemType42} field. */ + @NativeType("FT_ULong") + public long maxMemType42() { return nmaxMemType42(address()); } + /** @return the value of the {@code minMemType1} field. */ + @NativeType("FT_ULong") + public long minMemType1() { return nminMemType1(address()); } + /** @return the value of the {@code maxMemType1} field. */ + @NativeType("FT_ULong") + public long maxMemType1() { return nmaxMemType1(address()); } + + // ----------------------------------- + + /** Returns a new {@code TT_Postscript} instance for the specified memory address. */ + public static TT_Postscript create(long address) { + return new TT_Postscript(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TT_Postscript createSafe(long address) { + return address == NULL ? null : new TT_Postscript(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 #FormatType}. */ + public static long nFormatType(long struct) { return memGetCLong(struct + TT_Postscript.FORMATTYPE); } + /** Unsafe version of {@link #italicAngle}. */ + public static long nitalicAngle(long struct) { return memGetCLong(struct + TT_Postscript.ITALICANGLE); } + /** Unsafe version of {@link #underlinePosition}. */ + public static short nunderlinePosition(long struct) { return UNSAFE.getShort(null, struct + TT_Postscript.UNDERLINEPOSITION); } + /** Unsafe version of {@link #underlineThickness}. */ + public static short nunderlineThickness(long struct) { return UNSAFE.getShort(null, struct + TT_Postscript.UNDERLINETHICKNESS); } + /** Unsafe version of {@link #isFixedPitch}. */ + public static long nisFixedPitch(long struct) { return memGetCLong(struct + TT_Postscript.ISFIXEDPITCH); } + /** Unsafe version of {@link #minMemType42}. */ + public static long nminMemType42(long struct) { return memGetCLong(struct + TT_Postscript.MINMEMTYPE42); } + /** Unsafe version of {@link #maxMemType42}. */ + public static long nmaxMemType42(long struct) { return memGetCLong(struct + TT_Postscript.MAXMEMTYPE42); } + /** Unsafe version of {@link #minMemType1}. */ + public static long nminMemType1(long struct) { return memGetCLong(struct + TT_Postscript.MINMEMTYPE1); } + /** Unsafe version of {@link #maxMemType1}. */ + public static long nmaxMemType1(long struct) { return memGetCLong(struct + TT_Postscript.MAXMEMTYPE1); } + + // ----------------------------------- + + /** An array of {@link TT_Postscript} structs. */ + public static class Buffer extends StructBufferChanges 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 TT_Postscript#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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 TT_Postscript getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code FormatType} field. */ + @NativeType("FT_Fixed") + public long FormatType() { return TT_Postscript.nFormatType(address()); } + /** @return the value of the {@code italicAngle} field. */ + @NativeType("FT_Fixed") + public long italicAngle() { return TT_Postscript.nitalicAngle(address()); } + /** @return the value of the {@code underlinePosition} field. */ + @NativeType("FT_Short") + public short underlinePosition() { return TT_Postscript.nunderlinePosition(address()); } + /** @return the value of the {@code underlineThickness} field. */ + @NativeType("FT_Short") + public short underlineThickness() { return TT_Postscript.nunderlineThickness(address()); } + /** @return the value of the {@code isFixedPitch} field. */ + @NativeType("FT_ULong") + public long isFixedPitch() { return TT_Postscript.nisFixedPitch(address()); } + /** @return the value of the {@code minMemType42} field. */ + @NativeType("FT_ULong") + public long minMemType42() { return TT_Postscript.nminMemType42(address()); } + /** @return the value of the {@code maxMemType42} field. */ + @NativeType("FT_ULong") + public long maxMemType42() { return TT_Postscript.nmaxMemType42(address()); } + /** @return the value of the {@code minMemType1} field. */ + @NativeType("FT_ULong") + public long minMemType1() { return TT_Postscript.nminMemType1(address()); } + /** @return the value of the {@code maxMemType1} field. */ + @NativeType("FT_ULong") + public long maxMemType1() { return TT_Postscript.nmaxMemType1(address()); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_VertHeader.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_VertHeader.java new file mode 100644 index 00000000..effba0b0 --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/TT_VertHeader.java @@ -0,0 +1,364 @@ +/* + * 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.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A structure used to model a TrueType vertical header, the {@code vhea} table, as well as the corresponding vertical metrics table, {@code vmtx}. + * + *
+ * struct TT_VertHeader {
+ * FT_Fixed Version;
+ * FT_Short Ascender;
+ * FT_Short Descender;
+ * FT_Short Line_Gap;
+ * FT_UShort {@link #advance_Height_Max};
+ * FT_Short {@link #min_Top_Side_Bearing};
+ * FT_Short {@link #min_Bottom_Side_Bearing};
+ * FT_Short {@link #yMax_Extent};
+ * FT_Short caret_Slope_Rise;
+ * FT_Short caret_Slope_Run;
+ * FT_Short caret_Offset;
+ * FT_Short Reserved[4];
+ * FT_Short metric_Data_Format;
+ * FT_UShort number_Of_VMetrics;
+ * void * long_metrics;
+ * void * short_metrics;
+ * }
+ */
+public class TT_VertHeader extends StructThe created instance holds a strong reference to the container object.
+ */ + public TT_VertHeader(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** @return the value of the {@code Version} field. */ + @NativeType("FT_Fixed") + public long Version() { return nVersion(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 Line_Gap} field. */ + @NativeType("FT_Short") + public short Line_Gap() { return nLine_Gap(address()); } + /** advance height maximum */ + @NativeType("FT_UShort") + public short advance_Height_Max() { return nadvance_Height_Max(address()); } + /** minimum top-sb */ + @NativeType("FT_Short") + public short min_Top_Side_Bearing() { return nmin_Top_Side_Bearing(address()); } + /** minimum bottom-sb */ + @NativeType("FT_Short") + public short min_Bottom_Side_Bearing() { return nmin_Bottom_Side_Bearing(address()); } + /** ymax extents */ + @NativeType("FT_Short") + public short yMax_Extent() { return nyMax_Extent(address()); } + /** @return the value of the {@code caret_Slope_Rise} field. */ + @NativeType("FT_Short") + public short caret_Slope_Rise() { return ncaret_Slope_Rise(address()); } + /** @return the value of the {@code caret_Slope_Run} field. */ + @NativeType("FT_Short") + public short caret_Slope_Run() { return ncaret_Slope_Run(address()); } + /** @return the value of the {@code caret_Offset} field. */ + @NativeType("FT_Short") + public short caret_Offset() { return ncaret_Offset(address()); } + /** @return a {@link ShortBuffer} view of the {@code Reserved} field. */ + @NativeType("FT_Short[4]") + public ShortBuffer Reserved() { return nReserved(address()); } + /** @return the value at the specified index of the {@code Reserved} field. */ + @NativeType("FT_Short") + public short Reserved(int index) { return nReserved(address(), index); } + /** @return the value of the {@code metric_Data_Format} field. */ + @NativeType("FT_Short") + public short metric_Data_Format() { return nmetric_Data_Format(address()); } + /** @return the value of the {@code number_Of_VMetrics} field. */ + @NativeType("FT_UShort") + public short number_Of_VMetrics() { return nnumber_Of_VMetrics(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code long_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer long_metrics(int capacity) { return nlong_metrics(address(), capacity); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code short_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer short_metrics(int capacity) { return nshort_metrics(address(), capacity); } + + // ----------------------------------- + + /** Returns a new {@code TT_VertHeader} instance for the specified memory address. */ + public static TT_VertHeader create(long address) { + return new TT_VertHeader(address, null); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TT_VertHeader createSafe(long address) { + return address == NULL ? null : new TT_VertHeader(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 #Version}. */ + public static long nVersion(long struct) { return memGetCLong(struct + TT_VertHeader.VERSION); } + /** Unsafe version of {@link #Ascender}. */ + public static short nAscender(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.ASCENDER); } + /** Unsafe version of {@link #Descender}. */ + public static short nDescender(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.DESCENDER); } + /** Unsafe version of {@link #Line_Gap}. */ + public static short nLine_Gap(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.LINE_GAP); } + /** Unsafe version of {@link #advance_Height_Max}. */ + public static short nadvance_Height_Max(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.ADVANCE_HEIGHT_MAX); } + /** Unsafe version of {@link #min_Top_Side_Bearing}. */ + public static short nmin_Top_Side_Bearing(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.MIN_TOP_SIDE_BEARING); } + /** Unsafe version of {@link #min_Bottom_Side_Bearing}. */ + public static short nmin_Bottom_Side_Bearing(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.MIN_BOTTOM_SIDE_BEARING); } + /** Unsafe version of {@link #yMax_Extent}. */ + public static short nyMax_Extent(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.YMAX_EXTENT); } + /** Unsafe version of {@link #caret_Slope_Rise}. */ + public static short ncaret_Slope_Rise(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.CARET_SLOPE_RISE); } + /** Unsafe version of {@link #caret_Slope_Run}. */ + public static short ncaret_Slope_Run(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.CARET_SLOPE_RUN); } + /** Unsafe version of {@link #caret_Offset}. */ + public static short ncaret_Offset(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.CARET_OFFSET); } + /** Unsafe version of {@link #Reserved}. */ + public static ShortBuffer nReserved(long struct) { return memShortBuffer(struct + TT_VertHeader.RESERVED, 4); } + /** Unsafe version of {@link #Reserved(int) Reserved}. */ + public static short nReserved(long struct, int index) { + return UNSAFE.getShort(null, struct + TT_VertHeader.RESERVED + check(index, 4) * 2); + } + /** Unsafe version of {@link #metric_Data_Format}. */ + public static short nmetric_Data_Format(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.METRIC_DATA_FORMAT); } + /** Unsafe version of {@link #number_Of_VMetrics}. */ + public static short nnumber_Of_VMetrics(long struct) { return UNSAFE.getShort(null, struct + TT_VertHeader.NUMBER_OF_VMETRICS); } + /** Unsafe version of {@link #long_metrics(int) long_metrics}. */ + @Nullable public static ByteBuffer nlong_metrics(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + TT_VertHeader.LONG_METRICS), capacity); } + /** Unsafe version of {@link #short_metrics(int) short_metrics}. */ + @Nullable public static ByteBuffer nshort_metrics(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + TT_VertHeader.SHORT_METRICS), capacity); } + + // ----------------------------------- + + /** An array of {@link TT_VertHeader} structs. */ + public static class Buffer extends StructBufferChanges 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 TT_VertHeader#SIZEOF}, and its mark will be undefined.
+ * + *The created buffer instance holds a strong reference to the container object.
+ */ + 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 TT_VertHeader getElementFactory() { + return ELEMENT_FACTORY; + } + + /** @return the value of the {@code Version} field. */ + @NativeType("FT_Fixed") + public long Version() { return TT_VertHeader.nVersion(address()); } + /** @return the value of the {@code Ascender} field. */ + @NativeType("FT_Short") + public short Ascender() { return TT_VertHeader.nAscender(address()); } + /** @return the value of the {@code Descender} field. */ + @NativeType("FT_Short") + public short Descender() { return TT_VertHeader.nDescender(address()); } + /** @return the value of the {@code Line_Gap} field. */ + @NativeType("FT_Short") + public short Line_Gap() { return TT_VertHeader.nLine_Gap(address()); } + /** @return the value of the {@link TT_VertHeader#advance_Height_Max} field. */ + @NativeType("FT_UShort") + public short advance_Height_Max() { return TT_VertHeader.nadvance_Height_Max(address()); } + /** @return the value of the {@link TT_VertHeader#min_Top_Side_Bearing} field. */ + @NativeType("FT_Short") + public short min_Top_Side_Bearing() { return TT_VertHeader.nmin_Top_Side_Bearing(address()); } + /** @return the value of the {@link TT_VertHeader#min_Bottom_Side_Bearing} field. */ + @NativeType("FT_Short") + public short min_Bottom_Side_Bearing() { return TT_VertHeader.nmin_Bottom_Side_Bearing(address()); } + /** @return the value of the {@link TT_VertHeader#yMax_Extent} field. */ + @NativeType("FT_Short") + public short yMax_Extent() { return TT_VertHeader.nyMax_Extent(address()); } + /** @return the value of the {@code caret_Slope_Rise} field. */ + @NativeType("FT_Short") + public short caret_Slope_Rise() { return TT_VertHeader.ncaret_Slope_Rise(address()); } + /** @return the value of the {@code caret_Slope_Run} field. */ + @NativeType("FT_Short") + public short caret_Slope_Run() { return TT_VertHeader.ncaret_Slope_Run(address()); } + /** @return the value of the {@code caret_Offset} field. */ + @NativeType("FT_Short") + public short caret_Offset() { return TT_VertHeader.ncaret_Offset(address()); } + /** @return a {@link ShortBuffer} view of the {@code Reserved} field. */ + @NativeType("FT_Short[4]") + public ShortBuffer Reserved() { return TT_VertHeader.nReserved(address()); } + /** @return the value at the specified index of the {@code Reserved} field. */ + @NativeType("FT_Short") + public short Reserved(int index) { return TT_VertHeader.nReserved(address(), index); } + /** @return the value of the {@code metric_Data_Format} field. */ + @NativeType("FT_Short") + public short metric_Data_Format() { return TT_VertHeader.nmetric_Data_Format(address()); } + /** @return the value of the {@code number_Of_VMetrics} field. */ + @NativeType("FT_UShort") + public short number_Of_VMetrics() { return TT_VertHeader.nnumber_Of_VMetrics(address()); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code long_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer long_metrics(int capacity) { return TT_VertHeader.nlong_metrics(address(), capacity); } + /** + * @return a {@link ByteBuffer} view of the data pointed to by the {@code short_metrics} field. + * + * @param capacity the number of elements in the returned buffer + */ + @Nullable + @NativeType("void *") + public ByteBuffer short_metrics(int capacity) { return TT_VertHeader.nshort_metrics(address(), capacity); } + + } + +} \ No newline at end of file diff --git a/LWJGL/src/main/java/org/lwjgl/util/freetype/package-info.java b/LWJGL/src/main/java/org/lwjgl/util/freetype/package-info.java new file mode 100644 index 00000000..13e53fdb --- /dev/null +++ b/LWJGL/src/main/java/org/lwjgl/util/freetype/package-info.java @@ -0,0 +1,15 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** + * Contains bindings to the FreeType, a freely available software library to render fonts. + * + *It is written in C, designed to be small, efficient, highly customizable, and portable while capable of producing high-quality output (glyph images) of + * most vector and bitmap font formats.
+ */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.util.freetype; +