mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
5053 lines
129 KiB
C#
5053 lines
129 KiB
C#
// ------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by a tool.
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
// ------------------------------------------------------------------------------
|
|
|
|
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Runtime.InteropServices;
|
|
using HexaGen.Runtime;
|
|
using System.Numerics;
|
|
|
|
namespace Dalamud.Bindings.ImGui
|
|
{
|
|
public unsafe partial class ImGuiP
|
|
{
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void LogSetNextTextDecoration(ReadOnlySpan<byte> prefix, string suffix)
|
|
{
|
|
fixed (byte* pprefix = prefix)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (suffix != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(suffix);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(suffix, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
LogSetNextTextDecorationNative((byte*)pprefix, pStr0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void LogSetNextTextDecoration(string prefix, ref byte suffix)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (prefix != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(prefix);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(prefix, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* psuffix = &suffix)
|
|
{
|
|
LogSetNextTextDecorationNative(pStr0, (byte*)psuffix);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void LogSetNextTextDecoration(string prefix, ReadOnlySpan<byte> suffix)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (prefix != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(prefix);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(prefix, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* psuffix = suffix)
|
|
{
|
|
LogSetNextTextDecorationNative(pStr0, (byte*)psuffix);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static byte BeginChildExNative(byte* name, uint id, Vector2 sizeArg, byte border, ImGuiWindowFlags flags)
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
return ((delegate* unmanaged[Cdecl]<byte*, uint, Vector2, byte, ImGuiWindowFlags, byte>)funcTable[1009])(name, id, sizeArg, border, flags);
|
|
#else
|
|
return (byte)((delegate* unmanaged[Cdecl]<nint, uint, Vector2, byte, ImGuiWindowFlags, byte>)funcTable[1009])((nint)name, id, sizeArg, border, flags);
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginChildEx(byte* name, uint id, Vector2 sizeArg, bool border, ImGuiWindowFlags flags)
|
|
{
|
|
byte ret = BeginChildExNative(name, id, sizeArg, border ? (byte)1 : (byte)0, flags);
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginChildEx(ref byte name, uint id, Vector2 sizeArg, bool border, ImGuiWindowFlags flags)
|
|
{
|
|
fixed (byte* pname = &name)
|
|
{
|
|
byte ret = BeginChildExNative((byte*)pname, id, sizeArg, border ? (byte)1 : (byte)0, flags);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginChildEx(ReadOnlySpan<byte> name, uint id, Vector2 sizeArg, bool border, ImGuiWindowFlags flags)
|
|
{
|
|
fixed (byte* pname = name)
|
|
{
|
|
byte ret = BeginChildExNative((byte*)pname, id, sizeArg, border ? (byte)1 : (byte)0, flags);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginChildEx(string name, uint id, Vector2 sizeArg, bool border, ImGuiWindowFlags flags)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (name != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(name);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(name, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = BeginChildExNative(pStr0, id, sizeArg, border ? (byte)1 : (byte)0, flags);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static void OpenPopupExNative(uint id, ImGuiPopupFlags popupFlags)
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
((delegate* unmanaged[Cdecl]<uint, ImGuiPopupFlags, void>)funcTable[1010])(id, popupFlags);
|
|
#else
|
|
((delegate* unmanaged[Cdecl]<uint, ImGuiPopupFlags, void>)funcTable[1010])(id, popupFlags);
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void OpenPopupEx(uint id, ImGuiPopupFlags popupFlags)
|
|
{
|
|
OpenPopupExNative(id, popupFlags);
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void OpenPopupEx(uint id)
|
|
{
|
|
OpenPopupExNative(id, (ImGuiPopupFlags)(ImGuiPopupFlags.None));
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static void ClosePopupToLevelNative(int remaining, byte restoreFocusToWindowUnderPopup)
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
((delegate* unmanaged[Cdecl]<int, byte, void>)funcTable[1011])(remaining, restoreFocusToWindowUnderPopup);
|
|
#else
|
|
((delegate* unmanaged[Cdecl]<int, byte, void>)funcTable[1011])(remaining, restoreFocusToWindowUnderPopup);
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void ClosePopupToLevel(int remaining, bool restoreFocusToWindowUnderPopup)
|
|
{
|
|
ClosePopupToLevelNative(remaining, restoreFocusToWindowUnderPopup ? (byte)1 : (byte)0);
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static void ClosePopupsOverWindowNative(ImGuiWindow* refWindow, byte restoreFocusToWindowUnderPopup)
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
((delegate* unmanaged[Cdecl]<ImGuiWindow*, byte, void>)funcTable[1012])(refWindow, restoreFocusToWindowUnderPopup);
|
|
#else
|
|
((delegate* unmanaged[Cdecl]<nint, byte, void>)funcTable[1012])((nint)refWindow, restoreFocusToWindowUnderPopup);
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void ClosePopupsOverWindow(ImGuiWindowPtr refWindow, bool restoreFocusToWindowUnderPopup)
|
|
{
|
|
ClosePopupsOverWindowNative(refWindow, restoreFocusToWindowUnderPopup ? (byte)1 : (byte)0);
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void ClosePopupsOverWindow(ref ImGuiWindow refWindow, bool restoreFocusToWindowUnderPopup)
|
|
{
|
|
fixed (ImGuiWindow* prefWindow = &refWindow)
|
|
{
|
|
ClosePopupsOverWindowNative((ImGuiWindow*)prefWindow, restoreFocusToWindowUnderPopup ? (byte)1 : (byte)0);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static void ClosePopupsExceptModalsNative()
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
((delegate* unmanaged[Cdecl]<void>)funcTable[1013])();
|
|
#else
|
|
((delegate* unmanaged[Cdecl]<void>)funcTable[1013])();
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void ClosePopupsExceptModals()
|
|
{
|
|
ClosePopupsExceptModalsNative();
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static byte IsPopupOpenNative(uint id, ImGuiPopupFlags popupFlags)
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
return ((delegate* unmanaged[Cdecl]<uint, ImGuiPopupFlags, byte>)funcTable[1014])(id, popupFlags);
|
|
#else
|
|
return (byte)((delegate* unmanaged[Cdecl]<uint, ImGuiPopupFlags, byte>)funcTable[1014])(id, popupFlags);
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool IsPopupOpen(uint id, ImGuiPopupFlags popupFlags)
|
|
{
|
|
byte ret = IsPopupOpenNative(id, popupFlags);
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static byte BeginPopupExNative(uint id, ImGuiWindowFlags extraFlags)
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
return ((delegate* unmanaged[Cdecl]<uint, ImGuiWindowFlags, byte>)funcTable[1015])(id, extraFlags);
|
|
#else
|
|
return (byte)((delegate* unmanaged[Cdecl]<uint, ImGuiWindowFlags, byte>)funcTable[1015])(id, extraFlags);
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginPopupEx(uint id, ImGuiWindowFlags extraFlags)
|
|
{
|
|
byte ret = BeginPopupExNative(id, extraFlags);
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static void BeginTooltipExNative(ImGuiTooltipFlags tooltipFlags, ImGuiWindowFlags extraWindowFlags)
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
((delegate* unmanaged[Cdecl]<ImGuiTooltipFlags, ImGuiWindowFlags, void>)funcTable[1016])(tooltipFlags, extraWindowFlags);
|
|
#else
|
|
((delegate* unmanaged[Cdecl]<ImGuiTooltipFlags, ImGuiWindowFlags, void>)funcTable[1016])(tooltipFlags, extraWindowFlags);
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void BeginTooltipEx(ImGuiTooltipFlags tooltipFlags, ImGuiWindowFlags extraWindowFlags)
|
|
{
|
|
BeginTooltipExNative(tooltipFlags, extraWindowFlags);
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static void GetPopupAllowedExtentRectNative(ImRect* pOut, ImGuiWindow* window)
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
((delegate* unmanaged[Cdecl]<ImRect*, ImGuiWindow*, void>)funcTable[1017])(pOut, window);
|
|
#else
|
|
((delegate* unmanaged[Cdecl]<nint, nint, void>)funcTable[1017])((nint)pOut, (nint)window);
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static ImRect GetPopupAllowedExtentRect(ImGuiWindowPtr window)
|
|
{
|
|
ImRect ret;
|
|
GetPopupAllowedExtentRectNative(&ret, window);
|
|
return ret;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void GetPopupAllowedExtentRect(ImRectPtr pOut, ImGuiWindowPtr window)
|
|
{
|
|
GetPopupAllowedExtentRectNative(pOut, window);
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void GetPopupAllowedExtentRect(ref ImRect pOut, ImGuiWindowPtr window)
|
|
{
|
|
fixed (ImRect* ppOut = &pOut)
|
|
{
|
|
GetPopupAllowedExtentRectNative((ImRect*)ppOut, window);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static ImRect GetPopupAllowedExtentRect(ref ImGuiWindow window)
|
|
{
|
|
fixed (ImGuiWindow* pwindow = &window)
|
|
{
|
|
ImRect ret;
|
|
GetPopupAllowedExtentRectNative(&ret, (ImGuiWindow*)pwindow);
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void GetPopupAllowedExtentRect(ImRectPtr pOut, ref ImGuiWindow window)
|
|
{
|
|
fixed (ImGuiWindow* pwindow = &window)
|
|
{
|
|
GetPopupAllowedExtentRectNative(pOut, (ImGuiWindow*)pwindow);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void GetPopupAllowedExtentRect(ref ImRect pOut, ref ImGuiWindow window)
|
|
{
|
|
fixed (ImRect* ppOut = &pOut)
|
|
{
|
|
fixed (ImGuiWindow* pwindow = &window)
|
|
{
|
|
GetPopupAllowedExtentRectNative((ImRect*)ppOut, (ImGuiWindow*)pwindow);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static ImGuiWindow* GetTopMostPopupModalNative()
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
return ((delegate* unmanaged[Cdecl]<ImGuiWindow*>)funcTable[1018])();
|
|
#else
|
|
return (ImGuiWindow*)((delegate* unmanaged[Cdecl]<nint>)funcTable[1018])();
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static ImGuiWindowPtr GetTopMostPopupModal()
|
|
{
|
|
ImGuiWindowPtr ret = GetTopMostPopupModalNative();
|
|
return ret;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static ImGuiWindow* GetTopMostAndVisiblePopupModalNative()
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
return ((delegate* unmanaged[Cdecl]<ImGuiWindow*>)funcTable[1019])();
|
|
#else
|
|
return (ImGuiWindow*)((delegate* unmanaged[Cdecl]<nint>)funcTable[1019])();
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static ImGuiWindowPtr GetTopMostAndVisiblePopupModal()
|
|
{
|
|
ImGuiWindowPtr ret = GetTopMostAndVisiblePopupModalNative();
|
|
return ret;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static void FindBestWindowPosForPopupNative(Vector2* pOut, ImGuiWindow* window)
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
((delegate* unmanaged[Cdecl]<Vector2*, ImGuiWindow*, void>)funcTable[1020])(pOut, window);
|
|
#else
|
|
((delegate* unmanaged[Cdecl]<nint, nint, void>)funcTable[1020])((nint)pOut, (nint)window);
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static Vector2 FindBestWindowPosForPopup(ImGuiWindowPtr window)
|
|
{
|
|
Vector2 ret;
|
|
FindBestWindowPosForPopupNative(&ret, window);
|
|
return ret;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void FindBestWindowPosForPopup(Vector2* pOut, ImGuiWindowPtr window)
|
|
{
|
|
FindBestWindowPosForPopupNative(pOut, window);
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void FindBestWindowPosForPopup(ref Vector2 pOut, ImGuiWindowPtr window)
|
|
{
|
|
fixed (Vector2* ppOut = &pOut)
|
|
{
|
|
FindBestWindowPosForPopupNative((Vector2*)ppOut, window);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static Vector2 FindBestWindowPosForPopup(ref ImGuiWindow window)
|
|
{
|
|
fixed (ImGuiWindow* pwindow = &window)
|
|
{
|
|
Vector2 ret;
|
|
FindBestWindowPosForPopupNative(&ret, (ImGuiWindow*)pwindow);
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void FindBestWindowPosForPopup(Vector2* pOut, ref ImGuiWindow window)
|
|
{
|
|
fixed (ImGuiWindow* pwindow = &window)
|
|
{
|
|
FindBestWindowPosForPopupNative(pOut, (ImGuiWindow*)pwindow);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void FindBestWindowPosForPopup(ref Vector2 pOut, ref ImGuiWindow window)
|
|
{
|
|
fixed (Vector2* ppOut = &pOut)
|
|
{
|
|
fixed (ImGuiWindow* pwindow = &window)
|
|
{
|
|
FindBestWindowPosForPopupNative((Vector2*)ppOut, (ImGuiWindow*)pwindow);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static void FindBestWindowPosForPopupExNative(Vector2* pOut, Vector2 refPos, Vector2 size, ImGuiDir* lastDir, ImRect rOuter, ImRect rAvoid, ImGuiPopupPositionPolicy policy)
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
((delegate* unmanaged[Cdecl]<Vector2*, Vector2, Vector2, ImGuiDir*, ImRect, ImRect, ImGuiPopupPositionPolicy, void>)funcTable[1021])(pOut, refPos, size, lastDir, rOuter, rAvoid, policy);
|
|
#else
|
|
((delegate* unmanaged[Cdecl]<nint, Vector2, Vector2, nint, ImRect, ImRect, ImGuiPopupPositionPolicy, void>)funcTable[1021])((nint)pOut, refPos, size, (nint)lastDir, rOuter, rAvoid, policy);
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static Vector2 FindBestWindowPosForPopupEx(Vector2 refPos, Vector2 size, ImGuiDir* lastDir, ImRect rOuter, ImRect rAvoid, ImGuiPopupPositionPolicy policy)
|
|
{
|
|
Vector2 ret;
|
|
FindBestWindowPosForPopupExNative(&ret, refPos, size, lastDir, rOuter, rAvoid, policy);
|
|
return ret;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void FindBestWindowPosForPopupEx(Vector2* pOut, Vector2 refPos, Vector2 size, ImGuiDir* lastDir, ImRect rOuter, ImRect rAvoid, ImGuiPopupPositionPolicy policy)
|
|
{
|
|
FindBestWindowPosForPopupExNative(pOut, refPos, size, lastDir, rOuter, rAvoid, policy);
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static void FindBestWindowPosForPopupEx(ref Vector2 pOut, Vector2 refPos, Vector2 size, ImGuiDir* lastDir, ImRect rOuter, ImRect rAvoid, ImGuiPopupPositionPolicy policy)
|
|
{
|
|
fixed (Vector2* ppOut = &pOut)
|
|
{
|
|
FindBestWindowPosForPopupExNative((Vector2*)ppOut, refPos, size, lastDir, rOuter, rAvoid, policy);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static byte BeginViewportSideBarNative(byte* name, ImGuiViewport* viewport, ImGuiDir dir, float size, ImGuiWindowFlags windowFlags)
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
return ((delegate* unmanaged[Cdecl]<byte*, ImGuiViewport*, ImGuiDir, float, ImGuiWindowFlags, byte>)funcTable[1022])(name, viewport, dir, size, windowFlags);
|
|
#else
|
|
return (byte)((delegate* unmanaged[Cdecl]<nint, nint, ImGuiDir, float, ImGuiWindowFlags, byte>)funcTable[1022])((nint)name, (nint)viewport, dir, size, windowFlags);
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginViewportSideBar(byte* name, ImGuiViewportPtr viewport, ImGuiDir dir, float size, ImGuiWindowFlags windowFlags)
|
|
{
|
|
byte ret = BeginViewportSideBarNative(name, viewport, dir, size, windowFlags);
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginViewportSideBar(ref byte name, ImGuiViewportPtr viewport, ImGuiDir dir, float size, ImGuiWindowFlags windowFlags)
|
|
{
|
|
fixed (byte* pname = &name)
|
|
{
|
|
byte ret = BeginViewportSideBarNative((byte*)pname, viewport, dir, size, windowFlags);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginViewportSideBar(ReadOnlySpan<byte> name, ImGuiViewportPtr viewport, ImGuiDir dir, float size, ImGuiWindowFlags windowFlags)
|
|
{
|
|
fixed (byte* pname = name)
|
|
{
|
|
byte ret = BeginViewportSideBarNative((byte*)pname, viewport, dir, size, windowFlags);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginViewportSideBar(string name, ImGuiViewportPtr viewport, ImGuiDir dir, float size, ImGuiWindowFlags windowFlags)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (name != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(name);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(name, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = BeginViewportSideBarNative(pStr0, viewport, dir, size, windowFlags);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginViewportSideBar(byte* name, ref ImGuiViewport viewport, ImGuiDir dir, float size, ImGuiWindowFlags windowFlags)
|
|
{
|
|
fixed (ImGuiViewport* pviewport = &viewport)
|
|
{
|
|
byte ret = BeginViewportSideBarNative(name, (ImGuiViewport*)pviewport, dir, size, windowFlags);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginViewportSideBar(ref byte name, ref ImGuiViewport viewport, ImGuiDir dir, float size, ImGuiWindowFlags windowFlags)
|
|
{
|
|
fixed (byte* pname = &name)
|
|
{
|
|
fixed (ImGuiViewport* pviewport = &viewport)
|
|
{
|
|
byte ret = BeginViewportSideBarNative((byte*)pname, (ImGuiViewport*)pviewport, dir, size, windowFlags);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginViewportSideBar(ReadOnlySpan<byte> name, ref ImGuiViewport viewport, ImGuiDir dir, float size, ImGuiWindowFlags windowFlags)
|
|
{
|
|
fixed (byte* pname = name)
|
|
{
|
|
fixed (ImGuiViewport* pviewport = &viewport)
|
|
{
|
|
byte ret = BeginViewportSideBarNative((byte*)pname, (ImGuiViewport*)pviewport, dir, size, windowFlags);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginViewportSideBar(string name, ref ImGuiViewport viewport, ImGuiDir dir, float size, ImGuiWindowFlags windowFlags)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (name != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(name);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(name, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (ImGuiViewport* pviewport = &viewport)
|
|
{
|
|
byte ret = BeginViewportSideBarNative(pStr0, (ImGuiViewport*)pviewport, dir, size, windowFlags);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static byte BeginMenuExNative(byte* label, byte* icon, byte enabled)
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
return ((delegate* unmanaged[Cdecl]<byte*, byte*, byte, byte>)funcTable[1023])(label, icon, enabled);
|
|
#else
|
|
return (byte)((delegate* unmanaged[Cdecl]<nint, nint, byte, byte>)funcTable[1023])((nint)label, (nint)icon, enabled);
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(byte* label, byte* icon, bool enabled)
|
|
{
|
|
byte ret = BeginMenuExNative(label, icon, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(byte* label, byte* icon)
|
|
{
|
|
byte ret = BeginMenuExNative(label, icon, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ref byte label, byte* icon, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte ret = BeginMenuExNative((byte*)plabel, icon, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ref byte label, byte* icon)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte ret = BeginMenuExNative((byte*)plabel, icon, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ReadOnlySpan<byte> label, byte* icon, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte ret = BeginMenuExNative((byte*)plabel, icon, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ReadOnlySpan<byte> label, byte* icon)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte ret = BeginMenuExNative((byte*)plabel, icon, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(string label, byte* icon, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = BeginMenuExNative(pStr0, icon, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(string label, byte* icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = BeginMenuExNative(pStr0, icon, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(byte* label, ref byte icon, bool enabled)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = BeginMenuExNative(label, (byte*)picon, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(byte* label, ref byte icon)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = BeginMenuExNative(label, (byte*)picon, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(byte* label, ReadOnlySpan<byte> icon, bool enabled)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = BeginMenuExNative(label, (byte*)picon, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(byte* label, ReadOnlySpan<byte> icon)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = BeginMenuExNative(label, (byte*)picon, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(byte* label, string icon, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = BeginMenuExNative(label, pStr0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(byte* label, string icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = BeginMenuExNative(label, pStr0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ref byte label, ref byte icon, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = BeginMenuExNative((byte*)plabel, (byte*)picon, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ref byte label, ref byte icon)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = BeginMenuExNative((byte*)plabel, (byte*)picon, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ReadOnlySpan<byte> label, ReadOnlySpan<byte> icon, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = BeginMenuExNative((byte*)plabel, (byte*)picon, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ReadOnlySpan<byte> label, ReadOnlySpan<byte> icon)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = BeginMenuExNative((byte*)plabel, (byte*)picon, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(string label, string icon, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte* pStr1 = null;
|
|
int pStrSize1 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize1 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
|
|
pStr1 = pStrStack1;
|
|
}
|
|
int pStrOffset1 = Utils.EncodeStringUTF8(icon, pStr1, pStrSize1);
|
|
pStr1[pStrOffset1] = 0;
|
|
}
|
|
byte ret = BeginMenuExNative(pStr0, pStr1, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr1);
|
|
}
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(string label, string icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte* pStr1 = null;
|
|
int pStrSize1 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize1 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
|
|
pStr1 = pStrStack1;
|
|
}
|
|
int pStrOffset1 = Utils.EncodeStringUTF8(icon, pStr1, pStrSize1);
|
|
pStr1[pStrOffset1] = 0;
|
|
}
|
|
byte ret = BeginMenuExNative(pStr0, pStr1, (byte)(1));
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr1);
|
|
}
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ref byte label, ReadOnlySpan<byte> icon, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = BeginMenuExNative((byte*)plabel, (byte*)picon, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ref byte label, ReadOnlySpan<byte> icon)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = BeginMenuExNative((byte*)plabel, (byte*)picon, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ref byte label, string icon, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = BeginMenuExNative((byte*)plabel, pStr0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ref byte label, string icon)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = BeginMenuExNative((byte*)plabel, pStr0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ReadOnlySpan<byte> label, ref byte icon, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = BeginMenuExNative((byte*)plabel, (byte*)picon, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ReadOnlySpan<byte> label, ref byte icon)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = BeginMenuExNative((byte*)plabel, (byte*)picon, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ReadOnlySpan<byte> label, string icon, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = BeginMenuExNative((byte*)plabel, pStr0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(ReadOnlySpan<byte> label, string icon)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = BeginMenuExNative((byte*)plabel, pStr0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(string label, ref byte icon, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = BeginMenuExNative(pStr0, (byte*)picon, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(string label, ref byte icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = BeginMenuExNative(pStr0, (byte*)picon, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(string label, ReadOnlySpan<byte> icon, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = BeginMenuExNative(pStr0, (byte*)picon, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool BeginMenuEx(string label, ReadOnlySpan<byte> icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = BeginMenuExNative(pStr0, (byte*)picon, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static byte MenuItemExNative(byte* label, byte* icon, byte* shortcut, byte selected, byte enabled)
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
return ((delegate* unmanaged[Cdecl]<byte*, byte*, byte*, byte, byte, byte>)funcTable[1024])(label, icon, shortcut, selected, enabled);
|
|
#else
|
|
return (byte)((delegate* unmanaged[Cdecl]<nint, nint, nint, byte, byte, byte>)funcTable[1024])((nint)label, (nint)icon, (nint)shortcut, selected, enabled);
|
|
#endif
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
byte ret = MenuItemExNative(label, icon, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon, byte* shortcut, bool selected)
|
|
{
|
|
byte ret = MenuItemExNative(label, icon, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon, byte* shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, icon, shortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon)
|
|
{
|
|
byte ret = MenuItemExNative(label, icon, (byte*)(default), (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon, bool selected)
|
|
{
|
|
byte ret = MenuItemExNative(label, icon, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon, bool selected, bool enabled)
|
|
{
|
|
byte ret = MenuItemExNative(label, icon, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon, byte* shortcut, bool selected)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon, byte* shortcut)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, shortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)(default), (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon, bool selected)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon, byte* shortcut, bool selected)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon, byte* shortcut)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, shortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)(default), (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon, bool selected)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, icon, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon, byte* shortcut, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, icon, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon, byte* shortcut)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, icon, shortcut, (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, icon, (byte*)(default), (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, icon, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, icon, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon, byte* shortcut, bool selected)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon, byte* shortcut)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, shortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)(default), (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon, bool selected)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ReadOnlySpan<byte> icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ReadOnlySpan<byte> icon, byte* shortcut, bool selected)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ReadOnlySpan<byte> icon, byte* shortcut)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, shortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ReadOnlySpan<byte> icon)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)(default), (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ReadOnlySpan<byte> icon, bool selected)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ReadOnlySpan<byte> icon, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, string icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, pStr0, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, string icon, byte* shortcut, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, pStr0, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, string icon, byte* shortcut)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, pStr0, shortcut, (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, string icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, pStr0, (byte*)(default), (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, string icon, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, pStr0, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, string icon, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, pStr0, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, ref byte icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, ref byte icon, byte* shortcut, bool selected)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, ref byte icon, byte* shortcut)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, shortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, ref byte icon)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, (byte*)(default), (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, ref byte icon, bool selected)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, ref byte icon, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, ReadOnlySpan<byte> icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, ReadOnlySpan<byte> icon, byte* shortcut, bool selected)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, ReadOnlySpan<byte> icon, byte* shortcut)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, shortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, ReadOnlySpan<byte> icon)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, (byte*)(default), (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, ReadOnlySpan<byte> icon, bool selected)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, ReadOnlySpan<byte> icon, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, string icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte* pStr1 = null;
|
|
int pStrSize1 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize1 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
|
|
pStr1 = pStrStack1;
|
|
}
|
|
int pStrOffset1 = Utils.EncodeStringUTF8(icon, pStr1, pStrSize1);
|
|
pStr1[pStrOffset1] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, pStr1, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr1);
|
|
}
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, string icon, byte* shortcut, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte* pStr1 = null;
|
|
int pStrSize1 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize1 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
|
|
pStr1 = pStrStack1;
|
|
}
|
|
int pStrOffset1 = Utils.EncodeStringUTF8(icon, pStr1, pStrSize1);
|
|
pStr1[pStrOffset1] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, pStr1, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr1);
|
|
}
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, string icon, byte* shortcut)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte* pStr1 = null;
|
|
int pStrSize1 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize1 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
|
|
pStr1 = pStrStack1;
|
|
}
|
|
int pStrOffset1 = Utils.EncodeStringUTF8(icon, pStr1, pStrSize1);
|
|
pStr1[pStrOffset1] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, pStr1, shortcut, (byte)(0), (byte)(1));
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr1);
|
|
}
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, string icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte* pStr1 = null;
|
|
int pStrSize1 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize1 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
|
|
pStr1 = pStrStack1;
|
|
}
|
|
int pStrOffset1 = Utils.EncodeStringUTF8(icon, pStr1, pStrSize1);
|
|
pStr1[pStrOffset1] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, pStr1, (byte*)(default), (byte)(0), (byte)(1));
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr1);
|
|
}
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, string icon, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte* pStr1 = null;
|
|
int pStrSize1 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize1 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
|
|
pStr1 = pStrStack1;
|
|
}
|
|
int pStrOffset1 = Utils.EncodeStringUTF8(icon, pStr1, pStrSize1);
|
|
pStr1[pStrOffset1] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, pStr1, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr1);
|
|
}
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, string icon, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte* pStr1 = null;
|
|
int pStrSize1 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize1 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
|
|
pStr1 = pStrStack1;
|
|
}
|
|
int pStrOffset1 = Utils.EncodeStringUTF8(icon, pStr1, pStrSize1);
|
|
pStr1[pStrOffset1] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, pStr1, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr1);
|
|
}
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, ReadOnlySpan<byte> icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, ReadOnlySpan<byte> icon, byte* shortcut, bool selected)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, ReadOnlySpan<byte> icon, byte* shortcut)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, shortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, ReadOnlySpan<byte> icon)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, (byte*)(default), (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, ReadOnlySpan<byte> icon, bool selected)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, ReadOnlySpan<byte> icon, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, string icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, pStr0, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, string icon, byte* shortcut, bool selected)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, pStr0, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, string icon, byte* shortcut)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, pStr0, shortcut, (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, string icon)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, pStr0, (byte*)(default), (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, string icon, bool selected)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, pStr0, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, string icon, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, pStr0, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, ref byte icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, ref byte icon, byte* shortcut, bool selected)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, ref byte icon, byte* shortcut)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, shortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, ref byte icon)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, (byte*)(default), (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, ref byte icon, bool selected)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, ref byte icon, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, string icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, pStr0, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, string icon, byte* shortcut, bool selected)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, pStr0, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, string icon, byte* shortcut)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, pStr0, shortcut, (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, string icon)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, pStr0, (byte*)(default), (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, string icon, bool selected)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, pStr0, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, string icon, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, pStr0, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, ref byte icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, ref byte icon, byte* shortcut, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, ref byte icon, byte* shortcut)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, (byte*)picon, shortcut, (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, ref byte icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, (byte*)picon, (byte*)(default), (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, ref byte icon, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, ref byte icon, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, ReadOnlySpan<byte> icon, byte* shortcut, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, ReadOnlySpan<byte> icon, byte* shortcut, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, (byte*)picon, shortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, ReadOnlySpan<byte> icon, byte* shortcut)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, (byte*)picon, shortcut, (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, ReadOnlySpan<byte> icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, (byte*)picon, (byte*)(default), (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, ReadOnlySpan<byte> icon, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, ReadOnlySpan<byte> icon, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, (byte*)picon, (byte*)(default), selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon, ref byte shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon, ref byte shortcut, bool selected)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon, ref byte shortcut)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, icon, (byte*)pshortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon, ReadOnlySpan<byte> shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon, ReadOnlySpan<byte> shortcut, bool selected)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon, ReadOnlySpan<byte> shortcut)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, icon, (byte*)pshortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon, string shortcut, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(shortcut, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, icon, pStr0, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon, string shortcut, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(shortcut, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, icon, pStr0, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, byte* icon, string shortcut)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(shortcut, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, icon, pStr0, (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon, ref byte shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon, ref byte shortcut, bool selected)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon, ref byte shortcut)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)pshortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon, ReadOnlySpan<byte> shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon, ReadOnlySpan<byte> shortcut, bool selected)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon, ReadOnlySpan<byte> shortcut)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)pshortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon, string shortcut, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte* pStr1 = null;
|
|
int pStrSize1 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize1 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
|
|
pStr1 = pStrStack1;
|
|
}
|
|
int pStrOffset1 = Utils.EncodeStringUTF8(shortcut, pStr1, pStrSize1);
|
|
pStr1[pStrOffset1] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, icon, pStr1, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr1);
|
|
}
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon, string shortcut, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte* pStr1 = null;
|
|
int pStrSize1 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize1 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
|
|
pStr1 = pStrStack1;
|
|
}
|
|
int pStrOffset1 = Utils.EncodeStringUTF8(shortcut, pStr1, pStrSize1);
|
|
pStr1[pStrOffset1] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, icon, pStr1, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr1);
|
|
}
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon, string shortcut)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte* pStr1 = null;
|
|
int pStrSize1 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize1 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
|
|
pStr1 = pStrStack1;
|
|
}
|
|
int pStrOffset1 = Utils.EncodeStringUTF8(shortcut, pStr1, pStrSize1);
|
|
pStr1[pStrOffset1] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(pStr0, icon, pStr1, (byte)(0), (byte)(1));
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr1);
|
|
}
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon, ReadOnlySpan<byte> shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon, ReadOnlySpan<byte> shortcut, bool selected)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon, ReadOnlySpan<byte> shortcut)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)pshortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon, string shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(shortcut, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, pStr0, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon, string shortcut, bool selected)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(shortcut, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, pStr0, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ref byte label, byte* icon, string shortcut)
|
|
{
|
|
fixed (byte* plabel = &label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(shortcut, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, pStr0, (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon, ref byte shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon, ref byte shortcut, bool selected)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon, ref byte shortcut)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, (byte*)pshortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon, string shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(shortcut, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, pStr0, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon, string shortcut, bool selected)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(shortcut, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, pStr0, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(ReadOnlySpan<byte> label, byte* icon, string shortcut)
|
|
{
|
|
fixed (byte* plabel = label)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(shortcut, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative((byte*)plabel, icon, pStr0, (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon, ref byte shortcut, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon, ref byte shortcut, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon, ref byte shortcut)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, icon, (byte*)pshortcut, (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon, ReadOnlySpan<byte> shortcut, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon, ReadOnlySpan<byte> shortcut, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, icon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(string label, byte* icon, ReadOnlySpan<byte> shortcut)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (label != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(label);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(label, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(pStr0, icon, (byte*)pshortcut, (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon, ref byte shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon, ref byte shortcut, bool selected)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon, ref byte shortcut)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)pshortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ReadOnlySpan<byte> icon, ReadOnlySpan<byte> shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ReadOnlySpan<byte> icon, ReadOnlySpan<byte> shortcut, bool selected)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ReadOnlySpan<byte> icon, ReadOnlySpan<byte> shortcut)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)pshortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, string icon, string shortcut, bool selected, bool enabled)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte* pStr1 = null;
|
|
int pStrSize1 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize1 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
|
|
pStr1 = pStrStack1;
|
|
}
|
|
int pStrOffset1 = Utils.EncodeStringUTF8(shortcut, pStr1, pStrSize1);
|
|
pStr1[pStrOffset1] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, pStr0, pStr1, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr1);
|
|
}
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, string icon, string shortcut, bool selected)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte* pStr1 = null;
|
|
int pStrSize1 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize1 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
|
|
pStr1 = pStrStack1;
|
|
}
|
|
int pStrOffset1 = Utils.EncodeStringUTF8(shortcut, pStr1, pStrSize1);
|
|
pStr1[pStrOffset1] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, pStr0, pStr1, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr1);
|
|
}
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, string icon, string shortcut)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (icon != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(icon);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(icon, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte* pStr1 = null;
|
|
int pStrSize1 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize1 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr1 = Utils.Alloc<byte>(pStrSize1 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack1 = stackalloc byte[pStrSize1 + 1];
|
|
pStr1 = pStrStack1;
|
|
}
|
|
int pStrOffset1 = Utils.EncodeStringUTF8(shortcut, pStr1, pStrSize1);
|
|
pStr1[pStrOffset1] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, pStr0, pStr1, (byte)(0), (byte)(1));
|
|
if (pStrSize1 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr1);
|
|
}
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon, ReadOnlySpan<byte> shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon, ReadOnlySpan<byte> shortcut, bool selected)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon, ReadOnlySpan<byte> shortcut)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
fixed (byte* pshortcut = shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)pshortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon, string shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(shortcut, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, (byte*)picon, pStr0, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon, string shortcut, bool selected)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(shortcut, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, (byte*)picon, pStr0, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ref byte icon, string shortcut)
|
|
{
|
|
fixed (byte* picon = &icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(shortcut, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, (byte*)picon, pStr0, (byte)(0), (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ReadOnlySpan<byte> icon, ref byte shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ReadOnlySpan<byte> icon, ref byte shortcut, bool selected)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)pshortcut, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ReadOnlySpan<byte> icon, ref byte shortcut)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
fixed (byte* pshortcut = &shortcut)
|
|
{
|
|
byte ret = MenuItemExNative(label, (byte*)picon, (byte*)pshortcut, (byte)(0), (byte)(1));
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ReadOnlySpan<byte> icon, string shortcut, bool selected, bool enabled)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(shortcut, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, (byte*)picon, pStr0, selected ? (byte)1 : (byte)0, enabled ? (byte)1 : (byte)0);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// To be documented.
|
|
/// </summary>
|
|
public static bool MenuItemEx(byte* label, ReadOnlySpan<byte> icon, string shortcut, bool selected)
|
|
{
|
|
fixed (byte* picon = icon)
|
|
{
|
|
byte* pStr0 = null;
|
|
int pStrSize0 = 0;
|
|
if (shortcut != null)
|
|
{
|
|
pStrSize0 = Utils.GetByteCountUTF8(shortcut);
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
pStr0 = Utils.Alloc<byte>(pStrSize0 + 1);
|
|
}
|
|
else
|
|
{
|
|
byte* pStrStack0 = stackalloc byte[pStrSize0 + 1];
|
|
pStr0 = pStrStack0;
|
|
}
|
|
int pStrOffset0 = Utils.EncodeStringUTF8(shortcut, pStr0, pStrSize0);
|
|
pStr0[pStrOffset0] = 0;
|
|
}
|
|
byte ret = MenuItemExNative(label, (byte*)picon, pStr0, selected ? (byte)1 : (byte)0, (byte)(1));
|
|
if (pStrSize0 >= Utils.MaxStackallocSize)
|
|
{
|
|
Utils.Free(pStr0);
|
|
}
|
|
return ret != 0;
|
|
}
|
|
}
|
|
}
|
|
}
|