mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
319 lines
14 KiB
C#
319 lines
14 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.ImGui.Generator; do not edit by hand.
|
|
#nullable enable
|
|
|
|
namespace Brutal.ImGuiApi
|
|
{
|
|
public static partial class ImFontExtensions
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3944">imgui.h:3944</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L5250">imgui_draw.cpp:5250</see>
|
|
/// <br/><c>bool IsGlyphInFont(ImWchar c)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Methods
|
|
/// </para>
|
|
/// <para>
|
|
/// This is not fast query
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe bool IsGlyphInFont(this ImFontPtr target, uint c) =>
|
|
PInvoke.ImFont_IsGlyphInFont(target, c);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3945">imgui.h:3945</see>
|
|
/// <br/><c>bool IsLoaded() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Methods
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe bool IsLoaded(this ImFontPtr target) => PInvoke.ImFont_IsLoaded(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Fill ImFontConfig::Name.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3946">imgui.h:3946</see>
|
|
/// <br/><c>const char* GetDebugName() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Methods
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe ImString GetDebugName(this ImFontPtr target) =>
|
|
Utf8.GetNullTerminatedSpan(PInvoke.ImFont_GetDebugName(target));
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get or create baked data for given size
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3951">imgui.h:3951</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L5288">imgui_draw.cpp:5288</see>
|
|
/// <br/><c>ImFontBaked* GetFontBaked(float font_size, float density = -1.0f)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// [Internal] Don't use!
|
|
/// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
|
|
/// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
|
|
/// </code>
|
|
/// <para>
|
|
/// ImFontBaked pointers are valid for the entire frame but shall never be kept between frames.
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe ImFontBakedPtr GetFontBaked(this ImFontPtr target, float fontSize, float density = -1f) =>
|
|
PInvoke.ImFont_GetFontBaked(target, fontSize, density);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// utf8
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3952">imgui.h:3952</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L5465">imgui_draw.cpp:5465</see>
|
|
/// <br/>
|
|
/// <c>ImVec2 CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end = NULL, const char** remaining = NULL)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// [Internal] Don't use!
|
|
/// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
|
|
/// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe float2 CalcTextSizeA(
|
|
this ImFontPtr target,
|
|
float size,
|
|
float maxWidth,
|
|
float wrapWidth,
|
|
ImString text,
|
|
Ptr<Ptr<byte>> remaining = default
|
|
)
|
|
{
|
|
fixed (byte* text_fixed = text)
|
|
{
|
|
return PInvoke.ImFont_CalcTextSizeA(
|
|
target,
|
|
size,
|
|
maxWidth,
|
|
wrapWidth,
|
|
text_fixed,
|
|
text_fixed + text.Length,
|
|
(byte**)remaining
|
|
);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3953">imgui.h:3953</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L5359">imgui_draw.cpp:5359</see>
|
|
/// <br/>
|
|
/// <c>const char* CalcWordWrapPosition(float size, const char* text, const char* text_end, float wrap_width)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// [Internal] Don't use!
|
|
/// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
|
|
/// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
|
|
/// </code>
|
|
/// <code>
|
|
/// Simple word-wrapping for English, not full-featured. Please submit failing cases!
|
|
/// This will return the next location to wrap from. If no wrapping if necessary, this will fast-forward to e.g. text_end.
|
|
/// FIXME: Much possible improvements (don't cut things like "word !", "word!!!" but cut within "word,,,,", more sensible support for punctuations, support for Unicode punctuations, etc.)
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe Ptr<byte> CalcWordWrapPosition(
|
|
this ImFontPtr target,
|
|
float size,
|
|
ImString text,
|
|
float wrapWidth
|
|
)
|
|
{
|
|
fixed (byte* text_fixed = text)
|
|
{
|
|
return PInvoke.ImFont_CalcWordWrapPosition(
|
|
target,
|
|
size,
|
|
text_fixed,
|
|
text_fixed + text.Length,
|
|
wrapWidth
|
|
);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3954">imgui.h:3954</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L5550">imgui_draw.cpp:5550</see>
|
|
/// <br/>
|
|
/// <c>void RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, ImWchar c, const ImVec4* cpu_fine_clip = NULL)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// [Internal] Don't use!
|
|
/// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
|
|
/// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
|
|
/// </code>
|
|
/// <para>
|
|
/// Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound.
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void RenderChar(
|
|
this ImFontPtr target,
|
|
ImDrawListPtr drawList,
|
|
float size,
|
|
in float2 pos,
|
|
ImColor8 col,
|
|
uint c,
|
|
in float4? cpuFineClip = null
|
|
)
|
|
{
|
|
var cpuFineClip_ptr = cpuFineClip is { } cpuFineClip_value ? &cpuFineClip_value : null;
|
|
fixed (float2* pos_fixed = &pos)
|
|
{
|
|
PInvoke.ImFont_RenderChar(target, drawList, size, pos_fixed, col, c, (float4*)cpuFineClip_ptr);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3955">imgui.h:3955</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L5589">imgui_draw.cpp:5589</see>
|
|
/// <br/>
|
|
/// <c>void RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width = 0.0f, bool cpu_fine_clip = false)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// [Internal] Don't use!
|
|
/// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
|
|
/// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
|
|
/// </code>
|
|
/// <para>
|
|
/// Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound.
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void RenderText(
|
|
this ImFontPtr target,
|
|
ImDrawListPtr drawList,
|
|
float size,
|
|
in float2 pos,
|
|
ImColor8 col,
|
|
in float4 clipRect,
|
|
ImString text,
|
|
float wrapWidth = 0f,
|
|
bool cpuFineClip = false
|
|
)
|
|
{
|
|
fixed (byte* text_fixed = text)
|
|
{
|
|
fixed (float4* clipRect_fixed = &clipRect)
|
|
{
|
|
fixed (float2* pos_fixed = &pos)
|
|
{
|
|
PInvoke.ImFont_RenderText(
|
|
target,
|
|
drawList,
|
|
size,
|
|
pos_fixed,
|
|
col,
|
|
clipRect_fixed,
|
|
text_fixed,
|
|
text_fixed + text.Length,
|
|
wrapWidth,
|
|
cpuFineClip
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3961">imgui.h:3961</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L5087">imgui_draw.cpp:5087</see>
|
|
/// <br/><c>void ClearOutputData()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal] Don't use!
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void ClearOutputData(this ImFontPtr target) => PInvoke.ImFont_ClearOutputData(target);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Makes 'from_codepoint' character points to 'to_codepoint' glyph.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3962">imgui.h:3962</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L5199">imgui_draw.cpp:5199</see>
|
|
/// <br/><c>void AddRemapChar(ImWchar from_codepoint, ImWchar to_codepoint)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal] Don't use!
|
|
/// </para>
|
|
/// </remarks>
|
|
public static unsafe void AddRemapChar(this ImFontPtr target, uint fromCodepoint, uint toCodepoint) =>
|
|
PInvoke.ImFont_AddRemapChar(target, fromCodepoint, toCodepoint);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui.h#L3963">imgui.h:3963</see>
|
|
/// ,
|
|
/// <see href="https://github.com/RocketWerkz/imgui/blob/v1.92.2-docking-brutal/imgui_draw.cpp#L5098">imgui_draw.cpp:5098</see>
|
|
/// <br/><c>bool IsGlyphRangeUnused(unsigned int c_begin, unsigned int c_last)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// [Internal] Don't use!
|
|
/// </para>
|
|
/// <code>
|
|
/// API is designed this way to avoid exposing the 8K page size
|
|
/// e.g. use with IsGlyphRangeUnused(0, 255)
|
|
/// </code>
|
|
/// </remarks>
|
|
public static unsafe bool IsGlyphRangeUnused(this ImFontPtr target, uint cBegin, uint cLast) =>
|
|
PInvoke.ImFont_IsGlyphRangeUnused(target, cBegin, cLast);
|
|
}
|
|
}
|