//
// Generated by Brutal.ImGui.Generator; do not edit by hand.
#nullable enable
namespace Brutal.ImGuiApi
{
public static partial class ImGuiSelectionBasicStorageExtensions
{
///
///
/// Apply selection requests coming from BeginMultiSelect() and EndMultiSelect() functions. It uses
/// 'items_count' passed to BeginMultiSelect()
///
///
/// C++:
/// imgui.h:3174
/// ,
/// imgui_widgets.cpp:8359
///
void ApplyRequests(ImGuiMultiSelectIO* ms_io)
///
///
///
///
/// Methods
///
///
/// Apply requests coming from BeginMultiSelect() and EndMultiSelect().
/// - Enable 'Demo->Tools->Debug Log->Selection' to see selection requests as they happen.
/// - Honoring SetRange requests requires that you can iterate/interpolate between RangeFirstItem and RangeLastItem.
/// - In this demo we often submit indices to SetNextItemSelectionUserData() + store the same indices in persistent selection.
/// - Your code may do differently. If you store pointers or objects ID in ImGuiSelectionUserData you may need to perform
/// a lookup in order to have some way to iterate/interpolate between two items.
/// - A full-featured application is likely to allow search/filtering which is likely to lead to using indices
/// and constructing a view index <> object id/ptr data structure anyway.
/// WHEN YOUR APPLICATION SETTLES ON A CHOICE, YOU WILL PROBABLY PREFER TO GET RID OF THIS UNNECESSARY 'ImGuiSelectionBasicStorage' INDIRECTION LOGIC.
/// Notice that with the simplest adapter (using indices everywhere), all functions return their parameters.
/// The most simple implementation (using indices everywhere) would look like:
/// for (ImGuiSelectionRequest& req : ms_io->Requests)
/// {
/// if (req.Type == ImGuiSelectionRequestType_SetAll) { Clear(); if (req.Selected) { for (int n = 0; n < items_count; n++) { SetItemSelected(n, true); } }
/// if (req.Type == ImGuiSelectionRequestType_SetRange) { for (int n = (int)ms_io->RangeFirstItem; n <= (int)ms_io->RangeLastItem; n++) { SetItemSelected(n, ms_io->Selected); } }
/// }
///
///
public static unsafe void ApplyRequests(
this ImGuiSelectionBasicStoragePtr target,
ImGuiMultiSelectIOPtr msIo
) => PInvoke.ImGuiSelectionBasicStorage_ApplyRequests(target, msIo);
///
///
/// Query if an item id is in selection.
///
///
/// C++:
/// imgui.h:3175
/// ,
/// imgui_widgets.cpp:8280
///
bool Contains(ImGuiID id) const
///
///
///
///
/// Methods
///
///
public static unsafe bool Contains(this ImGuiSelectionBasicStoragePtr target, ImGuiID id) =>
PInvoke.ImGuiSelectionBasicStorage_Contains(target, id);
///
///
/// Clear selection
///
///
/// C++:
/// imgui.h:3176
/// ,
/// imgui_widgets.cpp:8266
///
void Clear()
///
///
///
///
/// Methods
///
///
public static unsafe void Clear(this ImGuiSelectionBasicStoragePtr target) =>
PInvoke.ImGuiSelectionBasicStorage_Clear(target);
///
///
/// Swap two selections
///
///
/// C++:
/// imgui.h:3177
/// ,
/// imgui_widgets.cpp:8273
///
void Swap(ImGuiSelectionBasicStorage& r)
///
///
///
///
/// Methods
///
///
public static unsafe void Swap(this ImGuiSelectionBasicStoragePtr target, ImGuiSelectionBasicStoragePtr r) =>
PInvoke.ImGuiSelectionBasicStorage_Swap(target, r);
///
///
/// Add/remove an item from selection (generally done by ApplyRequests() function)
///
///
/// C++:
/// imgui.h:3178
/// ,
/// imgui_widgets.cpp:8314
///
void SetItemSelected(ImGuiID id, bool selected)
///
///
///
///
/// Methods
///
///
public static unsafe void SetItemSelected(
this ImGuiSelectionBasicStoragePtr target,
ImGuiID id,
bool selected
) => PInvoke.ImGuiSelectionBasicStorage_SetItemSelected(target, id, selected);
///
///
/// Iterate selection with 'void* it = NULL; ImGuiID id; while (selection.GetNextSelectedItem(&it,
/// &id)) { ... }'
///
///
/// C++:
/// imgui.h:3179
/// ,
/// imgui_widgets.cpp:8294
///
bool GetNextSelectedItem(void** opaque_it, ImGuiID* out_id)
///
///
///
///
/// Methods
///
///
/// GetNextSelectedItem() is an abstraction allowing us to change our underlying actual storage system without impacting user.
/// (e.g. store unselected vs compact down, compact down on demand, use raw ImVector<ImGuiID> instead of ImGuiStorage...)
///
///
public static unsafe bool GetNextSelectedItem(
this ImGuiSelectionBasicStoragePtr target,
Ptr opaqueIt,
out ImGuiID outId
)
{
fixed (ImGuiID* outId_fixed = &outId)
{
return PInvoke.ImGuiSelectionBasicStorage_GetNextSelectedItem(target, (void**)opaqueIt, outId_fixed);
}
}
///
///
/// Convert index to item id based on provided adapter.
///
///
/// C++:
/// imgui.h:3180
///
inline ImGuiID GetStorageIdFromIndex(int idx)
///
///
///
///
/// Methods
///
///
public static unsafe ImGuiID GetStorageIdFromIndex(this ImGuiSelectionBasicStoragePtr target, int idx) =>
PInvoke.ImGuiSelectionBasicStorage_GetStorageIdFromIndex(target, idx);
}
}