Add IconTexture/Wrap to INotification (#1738) (#1739)

* Add IconTexture/Wrap to INotification (#1738)

Notification record and IActiveNotification interface now supports
setting or updating the texture wraps being used, and SetIconTexture has
gotten more overloads to support leaveOpen mechanism that can commonly
be found with Stream wrappers.

ImGui widget is updated to support testing setting "leaveOpen" and
updating "IconTexture" property via setter, making it possible to check
whether IDTW.Dispose is being called under given conditions.

Some changes to doccomments are made.

* typo
This commit is contained in:
srkizer 2024-03-22 22:47:50 +09:00 committed by GitHub
parent 12d70f0749
commit 55bd845a63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 231 additions and 40 deletions

View file

@ -0,0 +1,21 @@
using Dalamud.Interface.Internal;
namespace Dalamud.Interface.Textures;
/// <summary>Extension methods for <see cref="IDalamudTextureWrap"/>.</summary>
public static class DalamudTextureWrapExtensions
{
/// <summary>Checks if two instances of <see cref="IDalamudTextureWrap"/> point to a same underlying resource.
/// </summary>
/// <param name="a">The resource 1.</param>
/// <param name="b">The resource 2.</param>
/// <returns><c>true</c> if both instances point to a same underlying resource.</returns>
public static bool ResourceEquals(this IDalamudTextureWrap? a, IDalamudTextureWrap? b)
{
if (a is null != b is null)
return false;
if (a is null)
return false;
return a.ImGuiHandle == b.ImGuiHandle;
}
}