carb/simplegui/ISimpleGui.h

File members: carb/simplegui/ISimpleGui.h

// Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//

#pragma once

#include "SimpleGuiTypes.h"

#include "../Interface.h"

namespace carb
{
namespace simplegui
{

struct ISimpleGui
{
    CARB_PLUGIN_INTERFACE("carb::simplegui::ISimpleGui", 1, 2)

    Context*(CARB_ABI* createContext)(const ContextDesc& desc);

    void(CARB_ABI* destroyContext)(Context* ctx);

    void(CARB_ABI* setCurrentContext)(Context* ctx);

    Context*(CARB_ABI* getCurrentContext)();

    void(CARB_ABI* newFrame)();

    void(CARB_ABI* render)(float elapsedTime);

    void(CARB_ABI* setDisplaySize)(Float2 size);

    Float2(CARB_ABI* getDisplaySize)();

    Style*(CARB_ABI* getStyle)();

    void(CARB_ABI* showDemoWindow)(bool* open);

    void(CARB_ABI* showMetricsWindow)(bool* open);

    void(CARB_ABI* showStyleEditor)(Style* style);

    bool(CARB_ABI* showStyleSelector)(const char* label);

    void(CARB_ABI* showFontSelector)(const char* label);

    void(CARB_ABI* showUserGuide)();

    const char*(CARB_ABI* getImGuiVersion)();

    void(CARB_ABI* setStyleColors)(Style* style, StyleColorsPreset preset);

    bool(CARB_ABI* begin)(const char* label, bool* open, WindowFlags flags);

    void(CARB_ABI* end)();

    bool(CARB_ABI* beginChild)(const char* strId, Float2 size, bool border, WindowFlags flags);

    bool(CARB_ABI* beginChildId)(uint32_t id, Float2 size, bool border, WindowFlags flags);

    void(CARB_ABI* endChild)();

    bool(CARB_ABI* isWindowAppearing)();

    bool(CARB_ABI* isWindowCollapsed)();

    bool(CARB_ABI* isWindowFocused)(FocusedFlags flags);

    bool(CARB_ABI* isWindowHovered)(HoveredFlags flags);

    DrawList*(CARB_ABI* getWindowDrawList)();

    float(CARB_ABI* getWindowDpiScale)();

    Float2(CARB_ABI* getWindowPos)();

    Float2(CARB_ABI* getWindowSize)();

    float(CARB_ABI* getWindowWidth)();

    float(CARB_ABI* getWindowHeight)();

    Float2(CARB_ABI* getContentRegionMax)();

    Float2(CARB_ABI* getContentRegionAvail)();

    float(CARB_ABI* ContentRegionAvailWidth)();

    Float2(CARB_ABI* getWindowContentRegionMin)();

    Float2(CARB_ABI* getWindowContentRegionMax)();

    float(CARB_ABI* getWindowContentRegionWidth)();

    void(CARB_ABI* setNextWindowPos)(Float2 position, Condition cond, Float2 pivot);

    void(CARB_ABI* setNextWindowSize)(Float2 size, Condition cond);

    void(CARB_ABI* setNextWindowSizeConstraints)(const Float2& sizeMin, const Float2& sizeMax);

    void(CARB_ABI* setNextWindowContentSize)(const Float2& size);

    void(CARB_ABI* setNextWindowCollapsed)(bool collapsed, Condition cond);

    void(CARB_ABI* setNextWindowFocus)();

    void(CARB_ABI* setNextWindowBgAlpha)(float alpha);

    void(CARB_ABI* setWindowFontScale)(float scale);

    void(CARB_ABI* setWindowPos)(const char* name, const Float2& pos, Condition cond);

    void(CARB_ABI* setWindowSize)(const char* name, const Float2& size, Condition cond);

    void(CARB_ABI* setWindowCollapsed)(const char* name, bool collapsed, Condition cond);

    void(CARB_ABI* setWindowFocus)(const char* name);

    float(CARB_ABI* getScrollX)();

    float(CARB_ABI* getScrollY)();

    float(CARB_ABI* getScrollMaxX)();

    float(CARB_ABI* getScrollMaxY)();

    void(CARB_ABI* setScrollX)(float scrollX);

    void(CARB_ABI* setScrollY)(float scrollY);

    void(CARB_ABI* setScrollHereY)(float centerYRatio);

    void(CARB_ABI* setScrollFromPosY)(float posY, float centerYRatio);

    void(CARB_ABI* pushFont)(Font* font);

    void(CARB_ABI* popFont)();

    void(CARB_ABI* pushStyleColor)(StyleColor styleColorIndex, Float4 color);

    void(CARB_ABI* popStyleColor)();

    void(CARB_ABI* pushStyleVarFloat)(StyleVar styleVarIndex, float value);

    void(CARB_ABI* pushStyleVarFloat2)(StyleVar styleVarIndex, Float2 value);

    void(CARB_ABI* popStyleVar)();

    const Float4&(CARB_ABI* getStyleColorVec4)(StyleColor colorIndex);

    Font*(CARB_ABI* getFont)();

    float(CARB_ABI* getFontSize)();

    Float2(CARB_ABI* getFontTexUvWhitePixel)();

    uint32_t(CARB_ABI* getColorU32StyleColor)(StyleColor colorIndex, float alphaMul);

    uint32_t(CARB_ABI* getColorU32Vec4)(Float4 color);

    uint32_t(CARB_ABI* getColorU32)(uint32_t color);

    void(CARB_ABI* pushItemWidth)(float width);

    void(CARB_ABI* popItemWidth)();

    carb::Float2(CARB_ABI* calcItemSize)(carb::Float2 size, float defaultX, float defaultY);

    float(CARB_ABI* calcItemWidth)();

    void(CARB_ABI* pushItemFlag)(ItemFlags option, bool enabled);

    void(CARB_ABI* popItemFlag)();

    void(CARB_ABI* pushTextWrapPos)(float wrapPosX);

    void(CARB_ABI* popTextWrapPos)();

    void(CARB_ABI* pushAllowKeyboardFocus)(bool allow);

    void(CARB_ABI* popAllowKeyboardFocus)();

    void(CARB_ABI* pushButtonRepeat)(bool repeat);

    void(CARB_ABI* popButtonRepeat)();

    void(CARB_ABI* separator)();

    void sameLine();

    void(CARB_ABI* sameLineEx)(float posX, float spacingW);

    void(CARB_ABI* newLine)();

    void(CARB_ABI* spacing)();

    void(CARB_ABI* dummy)(Float2 size);

    void(CARB_ABI* indent)();

    void(CARB_ABI* indentEx)(float indentWidth);

    void(CARB_ABI* unindent)();

    void(CARB_ABI* beginGroup)();

    void(CARB_ABI* endGroup)();

    Float2(CARB_ABI* getCursorPos)();

    float(CARB_ABI* getCursorPosX)();

    float(CARB_ABI* getCursorPosY)();

    void(CARB_ABI* setCursorPos)(const Float2& localPos);

    void(CARB_ABI* setCursorPosX)(float x);

    void(CARB_ABI* setCursorPosY)(float y);

    Float2(CARB_ABI* getCursorStartPos)();

    Float2(CARB_ABI* getCursorScreenPos)();

    void(CARB_ABI* setCursorScreenPos)(const Float2& pos);

    void(CARB_ABI* alignTextToFramePadding)();

    float(CARB_ABI* getTextLineHeight)();

    float(CARB_ABI* getTextLineHeightWithSpacing)();

    float(CARB_ABI* getFrameHeight)();

    float(CARB_ABI* getFrameHeightWithSpacing)();

    void(CARB_ABI* pushIdString)(const char* id);

    void(CARB_ABI* pushIdStringBeginEnd)(const char* idBegin, const char* idEnd);

    void(CARB_ABI* pushIdInt)(int id);

    void(CARB_ABI* pushIdPtr)(const void* id);

    void(CARB_ABI* popId)();

    uint32_t(CARB_ABI* getIdString)(const char* id);

    uint32_t(CARB_ABI* getIdStringBeginEnd)(const char* idBegin, const char* idEnd);

    uint32_t(CARB_ABI* getIdPtr)(const void* id);

    void(CARB_ABI* textUnformatted)(const char* text);

    void(CARB_ABI* text)(const char* fmt, ...);

    void(CARB_ABI* textColored)(const Float4& color, const char* fmt, ...);

    void(CARB_ABI* textDisabled)(const char* fmt, ...);

    void(CARB_ABI* textWrapped)(const char* fmt, ...);

    void(CARB_ABI* labelText)(const char* label, const char* fmt, ...);

    void(CARB_ABI* bulletText)(const char* fmt, ...);

    bool(CARB_ABI* buttonEx)(const char* label, const Float2& size);

    bool button(const char* label);

    bool(CARB_ABI* smallButton)(const char* label);

    bool(CARB_ABI* invisibleButton)(const char* id, const Float2& size);

    bool(CARB_ABI* arrowButton)(const char* id, Direction dir);

    void(CARB_ABI* image)(TextureId userTextureId,
                          const Float2& size,
                          const Float2& uv0,
                          const Float2& uv1,
                          const Float4& tintColor,
                          const Float4& borderColor);

    bool(CARB_ABI* imageButton)(TextureId userTextureId,
                                const Float2& size,
                                const Float2& uv0,
                                const Float2& uv1,
                                int framePadding,
                                const Float4& bgColor,
                                const Float4& tintColor);

    bool(CARB_ABI* checkbox)(const char* label, bool* value);

    bool(CARB_ABI* checkboxFlags)(const char* label, uint32_t* flags, uint32_t flagsValue);

    bool(CARB_ABI* radioButton)(const char* label, bool active);

    bool(CARB_ABI* radioButtonEx)(const char* label, int* v, int vButton);

    void(CARB_ABI* progressBar)(float fraction, Float2 size, const char* overlay);

    void(CARB_ABI* bullet)();

    bool(CARB_ABI* beginCombo)(const char* label, const char* previewValue, ComboFlags flags);

    void(CARB_ABI* endCombo)();

    bool(CARB_ABI* combo)(const char* label, int* currentItem, const char* const* items, int itemCount);

    bool(CARB_ABI* dragFloat)(
        const char* label, float* v, float vSpeed, float vMin, float vMax, const char* displayFormat, float power);

    bool(CARB_ABI* dragFloat2)(
        const char* label, float v[2], float vSpeed, float vMin, float vMax, const char* displayFormat, float power);

    bool(CARB_ABI* dragFloat3)(
        const char* label, float v[3], float vSpeed, float vMin, float vMax, const char* displayFormat, float power);

    bool(CARB_ABI* dragFloat4)(
        const char* label, float v[4], float vSpeed, float vMin, float vMax, const char* displayFormat, float power);

    bool(CARB_ABI* dragFloatRange2)(const char* label,
                                    float* vCurrentMin,
                                    float* vCurrentMax,
                                    float vSpeed,
                                    float vMin,
                                    float vMax,
                                    const char* displayFormat,
                                    const char* displayFormatMax,
                                    float power);

    bool(CARB_ABI* dragInt)(const char* label, int* v, float vSpeed, int vMin, int vMax, const char* displayFormat);

    bool(CARB_ABI* dragInt2)(const char* label, int v[2], float vSpeed, int vMin, int vMax, const char* displayFormat);

    bool(CARB_ABI* dragInt3)(const char* label, int v[3], float vSpeed, int vMin, int vMax, const char* displayFormat);

    bool(CARB_ABI* dragInt4)(const char* label, int v[4], float vSpeed, int vMin, int vMax, const char* displayFormat);

    bool(CARB_ABI* dragIntRange2)(const char* label,
                                  int* vCurrentMin,
                                  int* vCurrentMax,
                                  float vSpeed,
                                  int vMin,
                                  int vMax,
                                  const char* displayFormat,
                                  const char* displayFormatMax);

    bool(CARB_ABI* dragScalar)(const char* label,
                               DataType dataType,
                               void* v,
                               float vSpeed,
                               const void* vMin,
                               const void* vMax,
                               const char* displayFormat,
                               float power);

    bool(CARB_ABI* dragScalarN)(const char* label,
                                DataType dataType,
                                void* v,
                                int components,
                                float vSpeed,
                                const void* vMin,
                                const void* vMax,
                                const char* displayFormat,
                                float power);

    bool(CARB_ABI* sliderFloat)(const char* label, float* v, float vMin, float vMax, const char* displayFormat, float power);

    bool(CARB_ABI* sliderFloat2)(
        const char* label, float v[2], float vMin, float vMax, const char* displayFormat, float power);

    bool(CARB_ABI* sliderFloat3)(
        const char* label, float v[3], float vMin, float vMax, const char* displayFormat, float power);

    bool(CARB_ABI* sliderFloat4)(
        const char* label, float v[4], float vMin, float vMax, const char* displayFormat, float power);

    bool(CARB_ABI* sliderAngle)(const char* label, float* vRad, float vDegreesMin, float vDegreesMax);

    bool(CARB_ABI* sliderInt)(const char* label, int* v, int vMin, int vMax, const char* displayFormat);

    bool(CARB_ABI* sliderInt2)(const char* label, int v[2], int vMin, int vMax, const char* displayFormat);

    bool(CARB_ABI* sliderInt3)(const char* label, int v[3], int vMin, int vMax, const char* displayFormat);

    bool(CARB_ABI* sliderInt4)(const char* label, int v[4], int vMin, int vMax, const char* displayFormat);

    bool(CARB_ABI* sliderScalar)(const char* label,
                                 DataType dataType,
                                 void* v,
                                 const void* vMin,
                                 const void* vMax,
                                 const char* displayFormat,
                                 float power);

    bool(CARB_ABI* sliderScalarN)(const char* label,
                                  DataType dataType,
                                  void* v,
                                  int components,
                                  const void* vMin,
                                  const void* vMax,
                                  const char* displayFormat,
                                  float power);

    bool(CARB_ABI* vSliderFloat)(
        const char* label, const Float2& size, float* v, float vMin, float vMax, const char* displayFormat, float power);

    bool(CARB_ABI* vSliderInt)(const char* label, const Float2& size, int* v, int vMin, int vMax, const char* displayFormat);

    bool(CARB_ABI* vSliderScalar)(const char* label,
                                  const Float2& size,
                                  DataType dataType,
                                  void* v,
                                  const void* vMin,
                                  const void* vMax,
                                  const char* displayFormat,
                                  float power);

    bool(CARB_ABI* inputText)(
        const char* label, char* buf, size_t bufSize, InputTextFlags flags, TextEditCallback callback, void* userData);

    bool(CARB_ABI* inputTextMultiline)(const char* label,
                                       char* buf,
                                       size_t bufSize,
                                       const Float2& size,
                                       InputTextFlags flags,
                                       TextEditCallback callback,
                                       void* userData);

    bool(CARB_ABI* inputFloat)(
        const char* label, float* v, float step, float stepFast, int decimalPrecision, InputTextFlags extraFlags);

    bool(CARB_ABI* inputFloat2)(const char* label, float v[2], int decimalPrecision, InputTextFlags extraFlags);

    bool(CARB_ABI* inputFloat3)(const char* label, float v[3], int decimalPrecision, InputTextFlags extraFlags);

    bool(CARB_ABI* inputFloat4)(const char* label, float v[4], int decimalPrecision, InputTextFlags extraFlags);

    bool(CARB_ABI* inputInt)(const char* label, int* v, int step, int stepFast, InputTextFlags extraFlags);

    bool(CARB_ABI* inputInt2)(const char* label, int v[2], InputTextFlags extraFlags);

    bool(CARB_ABI* inputInt3)(const char* label, int v[3], InputTextFlags extraFlags);

    bool(CARB_ABI* inputInt4)(const char* label, int v[4], InputTextFlags extraFlags);

    bool(CARB_ABI* inputDouble)(
        const char* label, double* v, double step, double stepFast, const char* displayFormat, InputTextFlags extraFlags);

    bool(CARB_ABI* inputScalar)(const char* label,
                                DataType dataType,
                                void* v,
                                const void* step,
                                const void* stepFast,
                                const char* displayFormat,
                                InputTextFlags extraFlags);

    bool(CARB_ABI* inputScalarN)(const char* label,
                                 DataType dataType,
                                 void* v,
                                 int components,
                                 const void* step,
                                 const void* stepFast,
                                 const char* displayFormat,
                                 InputTextFlags extraFlags);

    bool(CARB_ABI* colorEdit3)(const char* label, float col[3], ColorEditFlags flags);

    bool(CARB_ABI* colorEdit4)(const char* label, float col[4], ColorEditFlags flags);

    bool(CARB_ABI* colorPicker3)(const char* label, float col[3], ColorEditFlags flags);

    bool(CARB_ABI* colorPicker4)(const char* label, float col[4], ColorEditFlags flags, const float* refCol);

    bool(CARB_ABI* colorButton)(const char* descId, const Float4& col, ColorEditFlags flags, Float2 size);

    void(CARB_ABI* setColorEditOptions)(ColorEditFlags flags);

    bool(CARB_ABI* treeNode)(const char* label);

    bool(CARB_ABI* treeNodeString)(const char* strId, const char* fmt, ...);

    bool(CARB_ABI* treeNodePtr)(const void* ptrId, const char* fmt, ...);

    bool(CARB_ABI* treeNodeEx)(const char* label, TreeNodeFlags flags);

    bool(CARB_ABI* treeNodeStringEx)(const char* strId, TreeNodeFlags flags, const char* fmt, ...);

    bool(CARB_ABI* treeNodePtrEx)(const void* ptrId, TreeNodeFlags flags, const char* fmt, ...);

    void(CARB_ABI* treePushString)(const char* strId);

    void(CARB_ABI* treePushPtr)(const void* ptrId);

    void(CARB_ABI* treePop)();

    void(CARB_ABI* treeAdvanceToLabelPos)();

    float(CARB_ABI* getTreeNodeToLabelSpacing)();

    void(CARB_ABI* setNextTreeNodeOpen)(bool isOpen, Condition cond);

    bool(CARB_ABI* collapsingHeader)(const char* label, TreeNodeFlags flags);

    bool(CARB_ABI* collapsingHeaderEx)(const char* label, bool* open, TreeNodeFlags flags);

    bool(CARB_ABI* selectable)(const char* label,
                               bool selected /* = false*/,
                               SelectableFlags flags /* = 0*/,
                               const Float2& size /* = Float2(0,0)*/);

    bool(CARB_ABI* selectableEx)(const char* label,
                                 bool* selected,
                                 SelectableFlags flags /* = 0*/,
                                 const Float2& size /* = Float2(0,0)*/);

    bool(CARB_ABI* listBox)(
        const char* label, int* currentItem, const char* const items[], int itemCount, int heightInItems /* = -1*/);

    bool(CARB_ABI* listBoxEx)(const char* label,
                              int* currentItem,
                              bool (*itemsGetterFn)(void* data, int idx, const char** out_text),
                              void* data,
                              int itemCount,
                              int heightInItems /* = -1*/);

    bool(CARB_ABI* listBoxHeader)(const char* label, const Float2& size /* = Float2(0,0)*/);

    bool(CARB_ABI* listBoxHeaderEx)(const char* label, int itemCount, int heightInItems /* = -1*/);

    void(CARB_ABI* listBoxFooter)();

    void(CARB_ABI* plotLines)(const char* label,
                              const float* values,
                              int valuesCount,
                              int valuesOffset,
                              const char* overlayText,
                              float scaleMin,
                              float scaleMax,
                              Float2 graphSize,
                              int stride);

    void(CARB_ABI* plotLinesEx)(const char* label,
                                float (*valuesGetterFn)(void* data, int idx),
                                void* data,
                                int valuesCount,
                                int valuesOffset,
                                const char* overlayText,
                                float scaleMin,
                                float scaleMax,
                                Float2 graphSize);

    void(CARB_ABI* plotHistogram)(const char* label,
                                  const float* values,
                                  int valuesCount,
                                  int valuesOffset,
                                  const char* overlayText,
                                  float scaleMin,
                                  float scaleMax,
                                  Float2 graphSize,
                                  int stride);

    void(CARB_ABI* plotHistogramEx)(const char* label,
                                    float (*valuesGetterFn)(void* data, int idx),
                                    void* data,
                                    int valuesCount,
                                    int valuesOffset,
                                    const char* overlayText,
                                    float scaleMin,
                                    float scaleMax,
                                    Float2 graphSize);

    void(CARB_ABI* valueBool)(const char* prefix, bool b);

    void(CARB_ABI* valueInt)(const char* prefix, int v);

    void(CARB_ABI* valueUInt32)(const char* prefix, uint32_t v);

    void(CARB_ABI* valueFloat)(const char* prefix, float v, const char* floatFormat /* = nullptr*/);

    bool(CARB_ABI* beginMainMenuBar)();

    void(CARB_ABI* endMainMenuBar)();

    bool(CARB_ABI* beginMenuBar)();

    void(CARB_ABI* endMenuBar)();

    bool(CARB_ABI* beginMenu)(const char* label, bool enabled /* = true*/);

    void(CARB_ABI* endMenu)();

    bool(CARB_ABI* menuItem)(const char* label,
                             const char* shortcut /* = NULL*/,
                             bool selected /* = false*/,
                             bool enabled /* = true*/);

    bool(CARB_ABI* menuItemEx)(const char* label, const char* shortcut, bool* pSelected, bool enabled /* = true*/);

    void(CARB_ABI* setTooltip)(const char* fmt, ...);

    void(CARB_ABI* beginTooltip)();

    void(CARB_ABI* endTooltip)();

    void(CARB_ABI* openPopup)(const char* strId);

    bool(CARB_ABI* beginPopup)(const char* strId, WindowFlags flags /* = 0*/);

    bool(CARB_ABI* beginPopupContextItem)(const char* strId /* = NULL*/, int mouseButton /* = 1*/);

    bool(CARB_ABI* beginPopupContextWindow)(const char* strId /* = NULL*/,
                                            int mouseButton /* = 1*/,
                                            bool alsoOverItems /* = true*/);

    bool(CARB_ABI* beginPopupContextVoid)(const char* strId /* = NULL*/, int mouseButton /* = 1*/);

    bool(CARB_ABI* beginPopupModal)(const char* name, bool* open /* = NULL*/, WindowFlags flags /* = 0*/);

    void(CARB_ABI* endPopup)();

    bool(CARB_ABI* openPopupOnItemClick)(const char* strId /* = NULL*/, int mouseButton /* = 1*/);

    bool(CARB_ABI* isPopupOpen)(const char* strId);

    void(CARB_ABI* closeCurrentPopup)();

    void(CARB_ABI* columns)(int count /* = 1*/, const char* id /* = NULL*/, bool border /* = true*/);

    void(CARB_ABI* nextColumn)();

    int(CARB_ABI* getColumnIndex)();

    float(CARB_ABI* getColumnWidth)(int columnIndex /* = -1*/);

    void(CARB_ABI* setColumnWidth)(int columnIndex, float width);

    float(CARB_ABI* getColumnOffset)(int columnIndex /* = -1*/);

    void(CARB_ABI* setColumnOffset)(int columnIndex, float offsetX);

    int(CARB_ABI* getColumnsCount)();

    bool(CARB_ABI* beginTabBar)(const char* strId, TabBarFlags flags);

    void(CARB_ABI* endTabBar)();

    bool(CARB_ABI* beginTabItem)(const char* label, bool* open, TabItemFlags flags);

    void(CARB_ABI* endTabItem)();

    void(CARB_ABI* setTabItemClosed)(const char* tabOrDockedWindowLabel);

    void(CARB_ABI* dockSpace)(uint32_t id, const Float2& size, DockNodeFlags flags, const WindowClass* windowClass);

    uint32_t(CARB_ABI* dockSpaceOverViewport)(Viewport* viewport,
                                              DockNodeFlags dockspaceFlags,
                                              const WindowClass* windowClass);

    void(CARB_ABI* setNextWindowDockId)(uint32_t dockId, Condition cond);

    void(CARB_ABI* setNextWindowClass)(const WindowClass* windowClass);

    uint32_t(CARB_ABI* getWindowDockId)();

    bool(CARB_ABI* isWindowDocked)();

    bool(CARB_ABI* beginDragDropSource)(DragDropFlags flags);

    bool(CARB_ABI* setDragDropPayload)(const char* type, const void* data, size_t size, Condition cond);

    void(CARB_ABI* endDragDropSource)();

    bool(CARB_ABI* beginDragDropTarget)();

    const Payload*(CARB_ABI* acceptDragDropPayload)(const char* type, DragDropFlags flags);

    void(CARB_ABI* endDragDropTarget)();

    const Payload*(CARB_ABI* getDragDropPayload)();

    void(CARB_ABI* pushClipRect)(const Float2& clipRectMin, const Float2& clipRectMax, bool intersectWithCurrentClipRect);

    void(CARB_ABI* popClipRect)();

    void(CARB_ABI* setItemDefaultFocus)();

    void(CARB_ABI* setKeyboardFocusHere)(int offset /* = 0*/);

    void(CARB_ABI* clearActiveId)();

    bool(CARB_ABI* isItemHovered)(HoveredFlags flags /* = 0*/);

    bool(CARB_ABI* isItemActive)();

    bool(CARB_ABI* isItemFocused)();

    bool(CARB_ABI* isItemClicked)(int mouseButton /* = 0*/);

    bool(CARB_ABI* isItemVisible)();

    bool(CARB_ABI* isItemEdited)();

    bool(CARB_ABI* isItemDeactivated)();

    bool(CARB_ABI* isItemDeactivatedAfterEdit)();

    bool(CARB_ABI* isAnyItemHovered)();

    bool(CARB_ABI* isAnyItemActive)();

    bool(CARB_ABI* isAnyItemFocused)();

    bool(CARB_ABI* isItemIdActive)(uint32_t id);

    Float2(CARB_ABI* getItemRectMin)();

    Float2(CARB_ABI* getItemRectMax)();

    Float2(CARB_ABI* getItemRectSize)();

    void(CARB_ABI* setItemAllowOverlap)();

    bool(CARB_ABI* isRectVisible)(const Float2& size);

    bool(CARB_ABI* isRectVisibleEx)(const Float2& rectMin, const Float2& rectMax);

    float(CARB_ABI* getTime)();

    int(CARB_ABI* getFrameCount)();

    DrawList*(CARB_ABI* getOverlayDrawList)();

    const char*(CARB_ABI* getStyleColorName)(StyleColor color);

    Float2(CARB_ABI* calcTextSize)(const char* text,
                                   const char* textEnd /* = nullptr*/,
                                   bool hideTextAfterDoubleHash /* = false*/,
                                   float wrap_width /* = -1.0f*/);

    void(CARB_ABI* calcListClipping)(int itemCount, float itemsHeight, int* outItemsDisplayStart, int* outItemsDisplayEnd);

    bool(CARB_ABI* beginChildFrame)(uint32_t id, const Float2& size, WindowFlags flags /* = 0*/);

    void(CARB_ABI* endChildFrame)();

    Float4(CARB_ABI* colorConvertU32ToFloat4)(uint32_t in);

    uint32_t(CARB_ABI* colorConvertFloat4ToU32)(const Float4& in);

    void(CARB_ABI* colorConvertRGBtoHSV)(float r, float g, float b, float& outH, float& outS, float& outV);

    void(CARB_ABI* colorConvertHSVtoRGB)(float h, float s, float v, float& outR, float& outG, float& outB);

    int(CARB_ABI* getKeyIndex)(int imguiKey);

    bool(CARB_ABI* isKeyDown)(int userKeyIndex);

    bool(CARB_ABI* isKeyPressed)(int userKeyIndex, bool repeat /* = true*/);

    bool(CARB_ABI* isKeyReleased)(int userKeyIndex);

    int(CARB_ABI* getKeyPressedAmount)(int keyIndex, float repeatDelay, float rate);

    KeyModifiers(CARB_ABI* getKeyModifiers)();

    bool(CARB_ABI* isMouseDown)(int button);

    bool(CARB_ABI* isAnyMouseDown)();

    bool(CARB_ABI* isMouseClicked)(int button, bool repeat /* = false*/);

    bool(CARB_ABI* isMouseDoubleClicked)(int button);

    bool(CARB_ABI* isMouseReleased)(int button);

    bool(CARB_ABI* isMouseDragging)(int button /* = 0*/, float lockThreshold /* = -1.0f*/);

    bool(CARB_ABI* isMouseHoveringRect)(const Float2& rMin, const Float2& rMax, bool clip /* = true*/);

    bool(CARB_ABI* isMousePosValid)(const Float2* mousePos /* = nullptr*/);

    Float2(CARB_ABI* getMousePos)();

    Float2(CARB_ABI* getMousePosOnOpeningCurrentPopup)();

    Float2(CARB_ABI* getMouseDragDelta)(int button /* = 0*/, float lockThreshold /* = -1.0f*/);

    void(CARB_ABI* resetMouseDragDelta)(int button /* = 0*/);

    carb::Float2(CARB_ABI* getMouseWheel)();

    MouseCursor(CARB_ABI* getMouseCursor)();

    void(CARB_ABI* setMouseCursor)(MouseCursor type);

    void(CARB_ABI* captureKeyboardFromApp)(bool capture /* = true*/);

    void(CARB_ABI* captureMouseFromApp)(bool capture /* = true*/);

    const char*(CARB_ABI* getClipboardText)();

    void(CARB_ABI* setClipboardText)(const char* text);

    bool(CARB_ABI* getWantSaveIniSettings)();

    void(CARB_ABI* setWantSaveIniSettings)(bool wantSaveIniSettings);

    void(CARB_ABI* loadIniSettingsFromMemory)(const char* iniData, size_t iniSize);

    const char*(CARB_ABI* saveIniSettingsToMemory)(size_t* iniSize);

    Viewport*(CARB_ABI* getMainViewport)();

    void(CARB_ABI* dockBuilderDockWindow)(const char* windowName, uint32_t nodeId);

    DockNode*(CARB_ABI* dockBuilderGetNode)(uint32_t nodeId);

    void(CARB_ABI* dockBuilderAddNode)(uint32_t nodeId, DockNodeFlags flags);

    void(CARB_ABI* dockBuilderRemoveNode)(uint32_t nodeId);

    void(CARB_ABI* dockBuilderRemoveNodeDockedWindows)(uint32_t nodeId, bool clearPersistentDockingReferences);

    void(CARB_ABI* dockBuilderRemoveNodeChildNodes)(uint32_t nodeId);

    uint32_t(CARB_ABI* dockBuilderSplitNode)(
        uint32_t nodeId, Direction splitDir, float sizeRatioForNodeAtDir, uint32_t* outIdDir, uint32_t* outIdOther);

    void(CARB_ABI* dockBuilderFinish)(uint32_t nodeId);

    Font*(CARB_ABI* addFont)(const FontConfig* fontConfig);

    Font*(CARB_ABI* addFontDefault)(const FontConfig* fontConfig /* = NULL */);

    Font*(CARB_ABI* addFontFromFileTTF)(const char* filename,
                                        float sizePixels,
                                        const FontConfig* fontCfg /*= NULL */,
                                        const Wchar* glyphRanges /*= NULL*/);

    Font*(CARB_ABI* addFontFromMemoryTTF)(void* fontData,
                                          int fontSize,
                                          float sizePixels,
                                          const FontConfig* fontCfg /* = NULL */,
                                          const Wchar* glyphRanges /* = NULL */);

    Font*(CARB_ABI* addFontFromMemoryCompressedTTF)(const void* compressedFontData,
                                                    int compressedFontSize,
                                                    float sizePixels,
                                                    const FontConfig* fontCfg /* = NULL */,
                                                    const Wchar* glyphRanges /*= NULL */);

    Font*(CARB_ABI* addFontFromMemoryCompressedBase85TTF)(const char* compressedFontDataBase85,
                                                          float sizePixels,
                                                          const FontConfig* fontCfg /* = NULL */,
                                                          const Wchar* glyphRanges /* = NULL */);

    int(CARB_ABI* addFontCustomRectGlyph)(
        Font* font, Wchar id, int width, int height, float advanceX, const carb::Float2& offset /* (0, 0) */);

    const FontCustomRect*(CARB_ABI* getFontCustomRectByIndex)(int index);

    bool(CARB_ABI* buildFont)();

    bool(CARB_ABI* isFontBuilt)();

    void(CARB_ABI* getFontTexDataAsAlpha8)(unsigned char** outPixels, int* outWidth, int* outHeight);

    void(CARB_ABI* clearFontInputData)();

    void(CARB_ABI* clearFontTexData)();

    void(CARB_ABI* clearFonts)();

    void(CARB_ABI* clearFontInputOutput)();

    const Wchar*(CARB_ABI* getFontGlyphRangesDefault)();

    const Wchar*(CARB_ABI* getFontGlyphRangesKorean)();

    const Wchar*(CARB_ABI* getFontGlyphRangesJapanese)();

    const Wchar*(CARB_ABI* getFontGlyphRangesChineseFull)();

    const Wchar*(CARB_ABI* getGlyphRangesChineseSimplifiedCommon)();

    const Wchar*(CARB_ABI* getFontGlyphRangesCyrillic)();

    const Wchar*(CARB_ABI* getFontGlyphRangesThai)();

    void(CARB_ABI* setFontGlobalScale)(float scale);

    void(CARB_ABI* addWindowDrawCallback)(DrawCallback callback, void* userData);

    void(CARB_ABI* addLine)(DrawList* drawList, const carb::Float2& a, const carb::Float2& b, uint32_t col, float thickness);

    void(CARB_ABI* addRect)(DrawList* drawList,
                            const carb::Float2& a,
                            const carb::Float2& b,
                            uint32_t col,
                            float rounding,
                            DrawCornerFlags roundingCornersFlags,
                            float thickness);

    void(CARB_ABI* addRectFilled)(DrawList* drawList,
                                  const carb::Float2& a,
                                  const carb::Float2& b,
                                  uint32_t col,
                                  float rounding,
                                  DrawCornerFlags roundingCornersFlags);

    void(CARB_ABI* addRectFilledMultiColor)(DrawList* drawList,
                                            const carb::Float2& a,
                                            const carb::Float2& b,
                                            uint32_t colUprLeft,
                                            uint32_t colUprRight,
                                            uint32_t colBotRight,
                                            uint32_t colBotLeft);
    void(CARB_ABI* addQuad)(DrawList* drawList,
                            const carb::Float2& a,
                            const carb::Float2& b,
                            const carb::Float2& c,
                            const carb::Float2& d,
                            uint32_t col,
                            float thickness);

    void(CARB_ABI* addQuadFilled)(DrawList* drawList,
                                  const carb::Float2& a,
                                  const carb::Float2& b,
                                  const carb::Float2& c,
                                  const carb::Float2& d,
                                  uint32_t col);

    void(CARB_ABI* addTriangle)(DrawList* drawList,
                                const carb::Float2& a,
                                const carb::Float2& b,
                                const carb::Float2& c,
                                uint32_t col,
                                float thickness);

    void(CARB_ABI* addTriangleFilled)(
        DrawList* drawList, const carb::Float2& a, const carb::Float2& b, const carb::Float2& c, uint32_t col);

    void(CARB_ABI* addCircle)(
        DrawList* drawList, const carb::Float2& centre, float radius, uint32_t col, int32_t numSegments, float thickness);

    void(CARB_ABI* addCircleFilled)(
        DrawList* drawList, const carb::Float2& centre, float radius, uint32_t col, int32_t numSegments);

    void(CARB_ABI* addText)(
        DrawList* drawList, const carb::Float2& pos, uint32_t col, const char* textBegin, const char* textEnd);

    void(CARB_ABI* addTextEx)(DrawList* drawList,
                              const Font* font,
                              float fontSize,
                              const carb::Float2& pos,
                              uint32_t col,
                              const char* textBegin,
                              const char* textEnd,
                              float wrapWidth,
                              const carb::Float4* cpuFineClipRect);

    void(CARB_ABI* addImage)(DrawList* drawList,
                             TextureId textureId,
                             const carb::Float2& a,
                             const carb::Float2& b,
                             const carb::Float2& uvA,
                             const carb::Float2& uvB,
                             uint32_t col);

    void(CARB_ABI* addImageQuad)(DrawList* drawList,
                                 TextureId textureId,
                                 const carb::Float2& a,
                                 const carb::Float2& b,
                                 const carb::Float2& c,
                                 const carb::Float2& d,
                                 const carb::Float2& uvA,
                                 const carb::Float2& uvB,
                                 const carb::Float2& uvC,
                                 const carb::Float2& uvD,
                                 uint32_t col);

    void(CARB_ABI* addImageRounded)(DrawList* drawList,
                                    TextureId textureId,
                                    const carb::Float2& a,
                                    const carb::Float2& b,
                                    const carb::Float2& uvA,
                                    const carb::Float2& uvB,
                                    uint32_t col,
                                    float rounding,
                                    DrawCornerFlags roundingCorners);

    void(CARB_ABI* addPolyline)(DrawList* drawList,
                                const carb::Float2* points,
                                const int32_t numPoints,
                                uint32_t col,
                                bool closed,
                                float thickness);

    void(CARB_ABI* addConvexPolyFilled)(DrawList* drawList,
                                        const carb::Float2* points,
                                        const int32_t numPoints,
                                        uint32_t col);

    void(CARB_ABI* addBezierCurve)(DrawList* drawList,
                                   const carb::Float2& pos0,
                                   const carb::Float2& cp0,
                                   const carb::Float2& cp1,
                                   const carb::Float2& pos1,
                                   uint32_t col,
                                   float thickness,
                                   int32_t numSegments);

    ListClipper*(CARB_ABI* createListClipper)(int32_t itemsCount, float itemsHeight);

    bool(CARB_ABI* stepListClipper)(ListClipper* listClipper);

    void(CARB_ABI* destroyListClipper)(ListClipper* listClipper);

    bool(CARB_ABI* feedKeyboardEvent)(Context* ctx, const input::KeyboardEvent& event);

    bool(CARB_ABI* feedMouseEvent)(Context* ctx, const input::MouseEvent& event);

    void(CARB_ABI* enumerateFonts)(FontEnumFn func, void* user);

    const char*(CARB_ABI* getFontName)(const Font* font);

    Font*(CARB_ABI* getDefaultFont)();

    Font*(CARB_ABI* setDefaultFont)(Font* font);
};

inline void ISimpleGui::sameLine()
{
    sameLineEx(0, -1.0f);
}

inline bool ISimpleGui::button(const char* label)
{
    return buttonEx(label, { 0, 0 });
}

} // namespace simplegui
} // namespace carb