// Configuration flags stored in io.ConfigFlags. Set by user/application.
// Configuration flags stored in io.ConfigFlags. Set by user/application.
enumImGuiConfigFlags_
enumImGuiConfigFlags_
{
{
ImGuiConfigFlags_None=0,
ImGuiConfigFlags_NavEnableKeyboard=1<<0,// Master keyboard navigation enable flag. NewFrame() will automatically fill io.NavInputs[] based on io.KeysDown[].
ImGuiConfigFlags_NavEnableKeyboard=1<<0,// Master keyboard navigation enable flag. NewFrame() will automatically fill io.NavInputs[] based on io.KeysDown[].
ImGuiConfigFlags_NavEnableGamepad=1<<1,// Master gamepad navigation enable flag. This is mostly to instruct your imgui back-end to fill io.NavInputs[]. Back-end also needs to set ImGuiBackendFlags_HasGamepad.
ImGuiConfigFlags_NavEnableGamepad=1<<1,// Master gamepad navigation enable flag. This is mostly to instruct your imgui back-end to fill io.NavInputs[]. Back-end also needs to set ImGuiBackendFlags_HasGamepad.
ImGuiConfigFlags_NavEnableSetMousePos=1<<2,// Instruct navigation to move the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your binding, otherwise ImGui will react as if the mouse is jumping around back and forth.
ImGuiConfigFlags_NavEnableSetMousePos=1<<2,// Instruct navigation to move the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your binding, otherwise ImGui will react as if the mouse is jumping around back and forth.
@ -907,6 +940,7 @@ enum ImGuiConfigFlags_
// Back-end capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom back-end.
// Back-end capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom back-end.
enumImGuiBackendFlags_
enumImGuiBackendFlags_
{
{
ImGuiBackendFlags_None=0,
ImGuiBackendFlags_HasGamepad=1<<0,// Back-end supports gamepad and currently has one connected.
ImGuiBackendFlags_HasGamepad=1<<0,// Back-end supports gamepad and currently has one connected.
ImGuiBackendFlags_HasMouseCursors=1<<1,// Back-end supports honoring GetMouseCursor() value to change the OS cursor shape.
ImGuiBackendFlags_HasMouseCursors=1<<1,// Back-end supports honoring GetMouseCursor() value to change the OS cursor shape.
ImGuiBackendFlags_HasSetMousePos=1<<2,// Back-end supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set).
ImGuiBackendFlags_HasSetMousePos=1<<2,// Back-end supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set).
// Condition for ImGui::SetWindow***(), SetNextWindow***(), SetNextTreeNode***() functions
// Enumateration for ImGui::SetWindow***(), SetNextWindow***(), SetNextTreeNode***() functions
// Represent a condition.
// Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ImGuiCond_Always.
// Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ImGuiCond_Always.
// You may modify the ImGui::GetStyle() main instance during initialization and before NewFrame().
// You may modify the ImGui::GetStyle() main instance during initialization and before NewFrame().
// During the frame, use ImGui::PushStyleVar(ImGuiStyleVar_XXXX)/PopStyleVar() to alter the main style values, and ImGui::PushStyleColor(ImGuiCol_XXX)/PopStyleColor() for colors.
// During the frame, use ImGui::PushStyleVar(ImGuiStyleVar_XXXX)/PopStyleVar() to alter the main style values,
// and ImGui::PushStyleColor(ImGuiCol_XXX)/PopStyleColor() for colors.
// Shared state of InputText(), passed as an argument to your callback when a ImGuiInputTextFlags_Callback* flag is used.
// The callback function should return 0 by default.
// Callbacks (follow a flag name and see comments in ImGuiInputTextFlags_ declarations for more details)
// - ImGuiInputTextFlags_CallbackCompletion: Callback on pressing TAB
// - ImGuiInputTextFlags_CallbackHistory: Callback on pressing Up/Down arrows
// - ImGuiInputTextFlags_CallbackAlways: Callback on each iteration
// - ImGuiInputTextFlags_CallbackCharFilter: Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard.
// - ImGuiInputTextFlags_CallbackResize: Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow.
structImGuiInputTextCallbackData
{
ImGuiInputTextFlagsEventFlag;// One ImGuiInputTextFlags_Callback* // Read-only
ImGuiInputTextFlagsFlags;// What user passed to InputText() // Read-only
void*UserData;// What user passed to InputText() // Read-only
// Arguments for the different callback events
// - To modify the text buffer in a callback, prefer using the InsertChars() / DeleteChars() function. InsertChars() will take care of calling the resize callback if necessary.
// - If you know your edits are not going to resize the underlying buffer allocation, you may modify the contents of 'Buf[]' directly. You need to update 'BufTextLen' accordingly (0 <= BufTextLen < BufSize) and set 'BufDirty'' to true so InputText can update its internal state.
ImWcharEventChar;// Character input // Read-write // [CharFilter] Replace character with another one, or set to zero to drop. return 1 is equivalent to setting EventChar=0;
char*Buf;// Text buffer // Read-write // [Resize] Can replace pointer / [Completion,History,Always] Only write to pointed data, don't replace the actual pointer!
intBufTextLen;// Text length (in bytes) // Read-write // [Resize,Completion,History,Always] Exclude zero-terminator storage. In C land: == strlen(some_text), in C++ land: string.length()
intBufSize;// Buffer size (in bytes) = capacity+1 // Read-only // [Resize,Completion,History,Always] Include zero-terminator storage. In C land == ARRAYSIZE(my_char_array), in C++ land: string.capacity()+1
boolBufDirty;// Set if you modify Buf/BufTextLen! // Write // [Completion,History,Always]
// Shared state of InputText(), passed as an argument to your callback when a ImGuiInputTextFlags_Callback* flag is used.
// Helper: Manually clip large list of items.
// The callback function should return 0 by default.
// If you are submitting lots of evenly spaced items and you have a random access to the list, you can perform coarse clipping based on visibility to save yourself from processing those items at all.
// Callbacks (follow a flag name and see comments in ImGuiInputTextFlags_ declarations for more details)
// The clipper calculates the range of visible items and advance the cursor to compensate for the non-visible items we have skipped.
// - ImGuiInputTextFlags_CallbackCompletion: Callback on pressing TAB
// ImGui already clip items based on their bounds but it needs to measure text size to do so. Coarse clipping before submission makes this cost and your own data fetching/submission cost null.
// - ImGuiInputTextFlags_CallbackHistory: Callback on pressing Up/Down arrows
// Usage:
// - ImGuiInputTextFlags_CallbackAlways: Callback on each iteration
// ImGuiListClipper clipper(1000); // we have 1000 elements, evenly spaced.
// - ImGuiInputTextFlags_CallbackCharFilter: Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard.
// while (clipper.Step())
// - ImGuiInputTextFlags_CallbackResize: Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow.
// for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
structImGuiInputTextCallbackData
// ImGui::Text("line number %d", i);
{
// - Step 0: the clipper let you process the first element, regardless of it being visible or not, so we can measure the element height (step skipped if we passed a known height as second arg to constructor).
ImGuiInputTextFlagsEventFlag;// One ImGuiInputTextFlags_Callback* // Read-only
// - Step 1: the clipper infer height from first element, calculate the actual range of elements to display, and position the cursor before the first element.
ImGuiInputTextFlagsFlags;// What user passed to InputText() // Read-only
// - (Step 2: dummy step only required if an explicit items_height was passed to constructor or Begin() and user call Step(). Does nothing and switch to Step 3.)
void*UserData;// What user passed to InputText() // Read-only
// - Step 3: the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd), advance the cursor to the end of the list and then returns 'false' to end the loop.
structImGuiListClipper
// Arguments for the different callback events
// - To modify the text buffer in a callback, prefer using the InsertChars() / DeleteChars() function. InsertChars() will take care of calling the resize callback if necessary.
// - If you know your edits are not going to resize the underlying buffer allocation, you may modify the contents of 'Buf[]' directly. You need to update 'BufTextLen' accordingly (0 <= BufTextLen < BufSize) and set 'BufDirty'' to true so InputText can update its internal state.
ImWcharEventChar;// Character input // Read-write // [CharFilter] Replace character with another one, or set to zero to drop. return 1 is equivalent to setting EventChar=0;
char*Buf;// Text buffer // Read-write // [Resize] Can replace pointer / [Completion,History,Always] Only write to pointed data, don't replace the actual pointer!
intBufTextLen;// Text length (in bytes) // Read-write // [Resize,Completion,History,Always] Exclude zero-terminator storage. In C land: == strlen(some_text), in C++ land: string.length()
intBufSize;// Buffer size (in bytes) = capacity+1 // Read-only // [Resize,Completion,History,Always] Include zero-terminator storage. In C land == ARRAYSIZE(my_char_array), in C++ land: string.capacity()+1
boolBufDirty;// Set if you modify Buf/BufTextLen! // Write // [Completion,History,Always]
// Resizing callback data to apply custom constraint. As enabled by SetNextWindowSizeConstraints(). Callback is called during the next Begin().
// NB: For basic min/max size constraint on each axis you don't need to use the callback! The SetNextWindowSizeConstraints() parameters are enough.
structImGuiSizeCallbackData
{
void*UserData;// Read-only. What user passed to SetNextWindowSizeConstraints()
ImVec2Pos;// Read-only. Window position, for reference.
ImVec2CurrentSize;// Read-only. Current window size.
ImVec2DesiredSize;// Read-write. Desired size, based on user's mouse position. Write to this field to restrain resizing.
};
// Data payload for Drag and Drop operations
structImGuiPayload
{
{
// Members
floatStartPosY;
void*Data;// Data (copied and owned by dear imgui)
floatItemsHeight;
intDataSize;// Data size
intItemsCount,StepNo,DisplayStart,DisplayEnd;
// [Internal]
// items_count: Use -1 to ignore (you can call Begin later). Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step).
ImGuiIDSourceId;// Source item id
// items_height: Use -1.0f to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing().
ImGuiIDSourceParentId;// Source parent id (if available)
// If you don't specify an items_height, you NEED to call Step(). If you specify items_height you may call the old Begin()/End() api directly, but prefer calling Step().
intDataFrameCount;// Data timestamp
ImGuiListClipper(intitems_count=-1,floatitems_height=-1.0f){Begin(items_count,items_height);}// NB: Begin() initialize every fields (as we allow user to call Begin/End multiple times on a same instance if they want).
charDataType[32+1];// Data type tag (short user-supplied string, 32 characters max)
~ImGuiListClipper(){IM_ASSERT(ItemsCount==-1);}// Assert if user forgot to call End() or Step() until false.
boolPreview;// Set when AcceptDragDropPayload() was called and mouse has been hovering the target item (nb: handle overlapping drag targets)
boolDelivery;// Set when AcceptDragDropPayload() was called and mouse button is released over the target item.
ImGuiPayload(){Clear();}
IMGUI_APIboolStep();// Call until it returns false. The DisplayStart/DisplayEnd fields will be set and you can process/draw those items.
// If you are submitting lots of evenly spaced items and you have a random access to the list, you can perform coarse clipping based on visibility to save yourself from processing those items at all.
// The clipper calculates the range of visible items and advance the cursor to compensate for the non-visible items we have skipped.
// ImGui already clip items based on their bounds but it needs to measure text size to do so. Coarse clipping before submission makes this cost and your own data fetching/submission cost null.
// Usage:
// ImGuiListClipper clipper(1000); // we have 1000 elements, evenly spaced.
// while (clipper.Step())
// for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
// ImGui::Text("line number %d", i);
// - Step 0: the clipper let you process the first element, regardless of it being visible or not, so we can measure the element height (step skipped if we passed a known height as second arg to constructor).
// - Step 1: the clipper infer height from first element, calculate the actual range of elements to display, and position the cursor before the first element.
// - (Step 2: dummy step only required if an explicit items_height was passed to constructor or Begin() and user call Step(). Does nothing and switch to Step 3.)
// - Step 3: the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd), advance the cursor to the end of the list and then returns 'false' to end the loop.
structImGuiListClipper
{
floatStartPosY;
floatItemsHeight;
intItemsCount,StepNo,DisplayStart,DisplayEnd;
// items_count: Use -1 to ignore (you can call Begin later). Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step).
// items_height: Use -1.0f to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing().
// If you don't specify an items_height, you NEED to call Step(). If you specify items_height you may call the old Begin()/End() api directly, but prefer calling Step().
ImGuiListClipper(intitems_count=-1,floatitems_height=-1.0f){Begin(items_count,items_height);}// NB: Begin() initialize every fields (as we allow user to call Begin/End multiple times on a same instance if they want).
~ImGuiListClipper(){IM_ASSERT(ItemsCount==-1);}// Assert if user forgot to call End() or Step() until false.
IMGUI_APIboolStep();// Call until it returns false. The DisplayStart/DisplayEnd fields will be set and you can process/draw those items.
IMGUI_APIvoidBegin(intitems_count,floatitems_height=-1.0f);// Automatically called by constructor if you passed 'items_count' or by Step() in Step 1.
IMGUI_APIvoidEnd();// Automatically called on the last call of Step() that returns false.
IMGUI_APIvoidScaleClipRects(constImVec2&sc);// Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.
IMGUI_APIvoidScaleClipRects(constImVec2&sc);// Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.