Skip to content

Commit

Permalink
Generate extra functions and structs
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancheung committed Apr 14, 2024
1 parent 87b17b1 commit b8822db
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 4 deletions.
4 changes: 0 additions & 4 deletions FreeTypeSharp.Generator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,6 @@ private static void RegisterType(ASTContext context, string typeName)
{
// Skip structs having unsupported fields, like union and function pointers
case "FT_COLR_Paint_":
case "FT_MemoryRec_":
case "FT_Outline_Funcs_":
case "FT_Raster_Params_":
case "FT_StreamRec_":
continue;
default:
break;
Expand Down
2 changes: 2 additions & 0 deletions FreeTypeSharp.Generator/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
#include FT_FREETYPE_H
#include FT_OUTLINE_H
#include FT_SIZES_H
#include FT_RENDER_H
#include FT_GLYPH_H
#include FT_BITMAP_H
#include FT_BBOX_H
#include FT_CACHE_H
#include FT_STROKER_H
#include FT_SYNTHESIS_H
#include FT_TRIGONOMETRY_H
#include FT_GASP_H
#include FT_ADVANCES_H
30 changes: 30 additions & 0 deletions FreeTypeSharp/Generated/FT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,30 @@ public unsafe static partial class FT
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_Activate_Size(FT_SizeRec_* size);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_Add_Module(FT_LibraryRec_* library, FT_Module_Class_* clazz);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_ModuleRec_* FT_Get_Module(FT_LibraryRec_* library, byte* module_name);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_Remove_Module(FT_LibraryRec_* library, FT_ModuleRec_* module);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_Property_Set(FT_LibraryRec_* library, byte* module_name, byte* property_name, void* value);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_Property_Get(FT_LibraryRec_* library, byte* module_name, byte* property_name, void* value);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void FT_Set_Default_Properties(FT_LibraryRec_* library);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_Reference_Library(FT_LibraryRec_* library);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_New_Library(FT_MemoryRec_* memory, FT_LibraryRec_** alibrary);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_Done_Library(FT_LibraryRec_* library);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void FT_Set_Debug_Hook(FT_LibraryRec_* library, uint hook_index, void* debug_hook);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void FT_Add_Default_Modules(FT_LibraryRec_* library);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_TrueTypeEngineType_ FT_Get_TrueType_Engine_Type(FT_LibraryRec_* library);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_New_Glyph(FT_LibraryRec_* library, FT_Glyph_Format_ format, FT_GlyphRec_** aglyph);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_Get_Glyph(FT_GlyphSlotRec_* slot, FT_GlyphRec_** aglyph);
Expand All @@ -154,6 +178,10 @@ public unsafe static partial class FT
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_Matrix_Invert(FT_Matrix_* matrix);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_RendererRec_* FT_Get_Renderer(FT_LibraryRec_* library, FT_Glyph_Format_ format);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_Set_Renderer(FT_LibraryRec_* library, FT_RendererRec_* renderer, uint num_params, FT_Parameter_* parameters);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_Palette_Data_Get(FT_FaceRec_* face, FT_Palette_Data_* apalette);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_Palette_Select(FT_FaceRec_* face, ushort palette_index, FT_Color_** apalette);
Expand Down Expand Up @@ -282,6 +310,8 @@ public unsafe static partial class FT
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void FT_Vector_From_Polar(FT_Vector_* vec, IntPtr length, IntPtr angle);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int FT_Get_Gasp(FT_FaceRec_* face, uint ppem);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_Get_Advance(FT_FaceRec_* face, uint gindex, FT_LOAD load_flags, IntPtr* padvance);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern FT_Error FT_Get_Advances(FT_FaceRec_* face, uint start, uint count, FT_LOAD load_flags, IntPtr* padvances);
Expand Down
8 changes: 8 additions & 0 deletions FreeTypeSharp/Generated/FT_Glyph_Class_.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,13 @@ namespace FreeTypeSharp
[StructLayout(LayoutKind.Sequential)]
public unsafe struct FT_Glyph_Class_
{
public IntPtr glyph_size;
public FT_Glyph_Format_ glyph_format;
public void* glyph_init;
public void* glyph_done;
public void* glyph_copy;
public void* glyph_transform;
public void* glyph_bbox;
public void* glyph_prepare;
}
}
4 changes: 4 additions & 0 deletions FreeTypeSharp/Generated/FT_MemoryRec_.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ namespace FreeTypeSharp
[StructLayout(LayoutKind.Sequential)]
public unsafe struct FT_MemoryRec_
{
public void* user;
public void* alloc;
public void* free;
public void* realloc;
}
}
19 changes: 19 additions & 0 deletions FreeTypeSharp/Generated/FT_Module_Class_.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace FreeTypeSharp
{
using System.Runtime.InteropServices;
using System;

[StructLayout(LayoutKind.Sequential)]
public unsafe struct FT_Module_Class_
{
public UIntPtr module_flags;
public IntPtr module_size;
public byte* module_name;
public IntPtr module_version;
public IntPtr module_requires;
public void* module_interface;
public void* module_init;
public void* module_done;
public void* get_interface;
}
}
6 changes: 6 additions & 0 deletions FreeTypeSharp/Generated/FT_Outline_Funcs_.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@ namespace FreeTypeSharp
[StructLayout(LayoutKind.Sequential)]
public unsafe struct FT_Outline_Funcs_
{
public void* move_to;
public void* line_to;
public void* conic_to;
public void* cubic_to;
public int shift;
public IntPtr delta;
}
}
9 changes: 9 additions & 0 deletions FreeTypeSharp/Generated/FT_Raster_Params_.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,14 @@ namespace FreeTypeSharp
[StructLayout(LayoutKind.Sequential)]
public unsafe struct FT_Raster_Params_
{
public FT_Bitmap_* target;
public void* source;
public int flags;
public void* gray_spans;
public void* black_spans;
public void* bit_test;
public void* bit_set;
public void* user;
public FT_BBox_ clip_box;
}
}
10 changes: 10 additions & 0 deletions FreeTypeSharp/Generated/FT_RendererRec_.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace FreeTypeSharp
{
using System.Runtime.InteropServices;
using System;

[StructLayout(LayoutKind.Sequential)]
public unsafe struct FT_RendererRec_
{
}
}
12 changes: 12 additions & 0 deletions FreeTypeSharp/Generated/FT_StreamDesc_.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace FreeTypeSharp
{
using System.Runtime.InteropServices;
using System;

[StructLayout(LayoutKind.Sequential)]
public unsafe struct FT_StreamDesc_
{
public IntPtr value;
public void* pointer;
}
}
10 changes: 10 additions & 0 deletions FreeTypeSharp/Generated/FT_StreamRec_.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,15 @@ namespace FreeTypeSharp
[StructLayout(LayoutKind.Sequential)]
public unsafe struct FT_StreamRec_
{
public byte* _base;
public UIntPtr size;
public UIntPtr pos;
public FT_StreamDesc_ descriptor;
public FT_StreamDesc_ pathname;
public void* read;
public void* close;
public FT_MemoryRec_* memory;
public byte* cursor;
public byte* limit;
}
}
9 changes: 9 additions & 0 deletions FreeTypeSharp/Generated/FT_TrueTypeEngineType_.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace FreeTypeSharp
{
public enum FT_TrueTypeEngineType_ : int
{
FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
FT_TRUETYPE_ENGINE_TYPE_UNPATENTED = 1,
FT_TRUETYPE_ENGINE_TYPE_PATENTED = 2
}
}

0 comments on commit b8822db

Please sign in to comment.