UNPKG

@mori2003/jsimgui

Version:

JavaScript bindings for Dear ImGui.

1,156 lines 214 kB
/* @ts-self-types="./mod.d.ts" */ /** biome-ignore-all lint/correctness/noUnusedVariables: . */ /** biome-ignore-all lint/suspicious/noExplicitAny: . */ /** * jsimgui - TypeScript/JavaScript bindings for * {@link https://github.com/ocornut/imgui | Dear ImGui}. * * This module provides the TypeScript/JavaScript API for jsimgui. {@linkcode ImGuiImplWeb} provides * methods for easily initializing and integrating jsimgui. * The ImGui functions and enums can be accessed via the exported {@linkcode ImGui} object. * * For more information, see the {@link https://github.com/mori2003/jsimgui | GitHub Repository}. * * File structure: * [1.] Emscripten Module Interface * [2.] ImGui Typedefs - GENERATED * [3.] ImGui Structs/Classes - GENERATED * [4.] ImGui Functions and Enums - GENERATED * [5.] ImGui WebGL/WebGL2/WebGPU Backend Functions * [6.] Web Implementation */ // ------------------------------------------------------------------------------------------------- // [1.] Emscripten Module Interface // ------------------------------------------------------------------------------------------------- /** * Object wrapping the exported Emscripten module. Used to access any of the exported functions * or runtime methods. */ const Mod = { /** * The Emscripten module exports. */ _export: null, /** * Initialize the Emscripten module by loading and instantiating it. * * This method loads the Emscripten module from the specified path and makes its exports * available through the {@linkcode Mod.export} getter. It will be called by * {@linkcode ImGuiImplWeb.Init}. * * @param loaderPath Path to the Emscripten module loader (e.g. `jsimgui-webgl-tt.js`). * @throws {Error} Throws error if the module is already initialized. */ async init(loaderPath) { if (Mod._export) { throw new Error("jsimgui: Emscripten module is already initialized."); } const MainExport = await import(loaderPath); const module = await MainExport.default(); Mod._export = module; }, /** * Access to the Emscripten module exports. * * Provides access to all exported functions, classes and runtime methods from the * Emscripten module. * * @throws {Error} Throws error if the module has not been initialized via {@linkcode Mod.init}. * @returns Object containing all exported functions, classes and runtime methods. */ get export() { if (!Mod._export) { throw new Error( "jsimgui: Emscripten module is not initialized. Did you call ImGuiImplWeb.Init()?", ); } return this._export; }, }; /** * Finalizer that deletes the underlying C++ struct/class when the JavaScript wrapper is garbage * collected. */ const finalizer = new FinalizationRegistry((ptr) => { ptr?.delete(); }); /** * A class that wraps an underlying exported C++ struct/class. This will be inherited by * all struct/class bindings. */ class StructBinding { /** * The underlying C++ struct/class. */ _ptr; /** * Create a new instance of an underlying C++ struct/class. * * @param name The name of the Emscripten exported C++ struct/class. */ constructor(name) { this._ptr = new Mod.export[name](); finalizer.register(this, this._ptr); } /** * Wrap a new C++ struct/class into a JavaScript wrapper. This is used by the generated bindings * code when for example a function returns a new struct/class. * * @param ptr An instance of the underlying C++ struct/class. * @returns The JavaScript wrapped object. */ static wrap(ptr) { // We use `this` here to call the constructor of the parent class. // TODO: Find a better way to do this. // biome-ignore lint/complexity/noThisInStatic: See the explanation above. const wrap = Reflect.construct(this, []); wrap._ptr = ptr; return wrap; } } /* -------------------------------------------------------------------------- */ /* 3. Structs */ /* -------------------------------------------------------------------------- */ /** Data shared among multiple draw lists (typically owned by parent ImGui context, but you may create one yourself) */ export class ImDrawListSharedData extends StructBinding { constructor() { super("ImDrawListSharedData"); } } /** Dear ImGui context (opaque structure, unless including imgui_internal.h) */ export class ImGuiContext extends StructBinding { constructor() { super("ImGuiContext"); } } /** 2D vector used to store positions, sizes etc. */ export class ImVec2 extends StructBinding { constructor(x = 0, y = 0) { super("ImVec2"); this.x = x; this.y = y; } get x() { return this._ptr.get_x(); } set x(v) { this._ptr.set_x(v); } get y() { return this._ptr.get_y(); } set y(v) { this._ptr.set_y(v); } } /** 4D vector used to store clipping rectangles, colors etc. */ export class ImVec4 extends StructBinding { constructor(x = 0, y = 0, z = 0, w = 0) { super("ImVec4"); this.x = x; this.y = y; this.z = z; this.w = w; } get x() { return this._ptr.get_x(); } set x(v) { this._ptr.set_x(v); } get y() { return this._ptr.get_y(); } set y(v) { this._ptr.set_y(v); } get z() { return this._ptr.get_z(); } set z(v) { this._ptr.set_z(v); } get w() { return this._ptr.get_w(); } set w(v) { this._ptr.set_w(v); } } /** ImTextureRef = higher-level identifier for a texture. */ export class ImTextureRef extends StructBinding { constructor(id) { super("ImTextureRef"); this._TexID = id; } /** _OR_ Low-level backend texture identifier, if already uploaded or created by user\/app. Generally provided to e.g. ImGui::Image() calls. */ get _TexID() { return this._ptr.get__TexID(); } set _TexID(v) { this._ptr.set__TexID(v); } /** == (_TexData ? _TexData->TexID : _TexID) \/\/ Implemented below in the file. */ GetTexID() { return this._ptr.ImTextureRef_GetTexID(); } } /** Sorting specifications for a table (often handling sort specs for a single column, occasionally more) */ export class ImGuiTableSortSpecs extends StructBinding { constructor() { super("ImGuiTableSortSpecs"); } } /** Sorting specification for one column of a table (sizeof == 12 bytes) */ export class ImGuiTableColumnSortSpecs extends StructBinding { constructor() { super("ImGuiTableColumnSortSpecs"); } } /** Runtime data for styling/colors. */ export class ImGuiStyle extends StructBinding { constructor() { super("ImGuiStyle"); } /** Current base font size before external global factors are applied. Use PushFont(NULL, size) to modify. Use ImGui::GetFontSize() to obtain scaled value. */ get FontSizeBase() { return this._ptr.get_FontSizeBase(); } set FontSizeBase(v) { this._ptr.set_FontSizeBase(v); } /** Main global scale factor. May be set by application once, or exposed to end-user. */ get FontScaleMain() { return this._ptr.get_FontScaleMain(); } set FontScaleMain(v) { this._ptr.set_FontScaleMain(v); } /** Additional global scale factor from viewport\/monitor contents scale. When io.ConfigDpiScaleFonts is enabled, this is automatically overwritten when changing monitor DPI. */ get FontScaleDpi() { return this._ptr.get_FontScaleDpi(); } set FontScaleDpi(v) { this._ptr.set_FontScaleDpi(v); } /** Global alpha applies to everything in Dear ImGui. */ get Alpha() { return this._ptr.get_Alpha(); } set Alpha(v) { this._ptr.set_Alpha(v); } /** Additional alpha multiplier applied by BeginDisabled(). Multiply over current value of Alpha. */ get DisabledAlpha() { return this._ptr.get_DisabledAlpha(); } set DisabledAlpha(v) { this._ptr.set_DisabledAlpha(v); } /** Padding within a window. */ get WindowPadding() { return ImVec2.wrap(this._ptr.get_WindowPadding()); } set WindowPadding(v) { this._ptr.set_WindowPadding(v._ptr); } /** Radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended. */ get WindowRounding() { return this._ptr.get_WindowRounding(); } set WindowRounding(v) { this._ptr.set_WindowRounding(v); } /** Thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU\/GPU costly). */ get WindowBorderSize() { return this._ptr.get_WindowBorderSize(); } set WindowBorderSize(v) { this._ptr.set_WindowBorderSize(v); } /** Hit-testing extent outside\/inside resizing border. Also extend determination of hovered window. Generally meaningfully larger than WindowBorderSize to make it easy to reach borders. */ get WindowBorderHoverPadding() { return this._ptr.get_WindowBorderHoverPadding(); } set WindowBorderHoverPadding(v) { this._ptr.set_WindowBorderHoverPadding(v); } /** Minimum window size. This is a global setting. If you want to constrain individual windows, use SetNextWindowSizeConstraints(). */ get WindowMinSize() { return ImVec2.wrap(this._ptr.get_WindowMinSize()); } set WindowMinSize(v) { this._ptr.set_WindowMinSize(v._ptr); } /** Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered. */ get WindowTitleAlign() { return ImVec2.wrap(this._ptr.get_WindowTitleAlign()); } set WindowTitleAlign(v) { this._ptr.set_WindowTitleAlign(v._ptr); } /** Side of the collapsing\/docking button in the title bar (None\/Left\/Right). Defaults to ImGuiDir_Left. */ get WindowMenuButtonPosition() { return this._ptr.get_WindowMenuButtonPosition(); } set WindowMenuButtonPosition(v) { this._ptr.set_WindowMenuButtonPosition(v); } /** Radius of child window corners rounding. Set to 0.0f to have rectangular windows. */ get ChildRounding() { return this._ptr.get_ChildRounding(); } set ChildRounding(v) { this._ptr.set_ChildRounding(v); } /** Thickness of border around child windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU\/GPU costly). */ get ChildBorderSize() { return this._ptr.get_ChildBorderSize(); } set ChildBorderSize(v) { this._ptr.set_ChildBorderSize(v); } /** Radius of popup window corners rounding. (Note that tooltip windows use WindowRounding) */ get PopupRounding() { return this._ptr.get_PopupRounding(); } set PopupRounding(v) { this._ptr.set_PopupRounding(v); } /** Thickness of border around popup\/tooltip windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU\/GPU costly). */ get PopupBorderSize() { return this._ptr.get_PopupBorderSize(); } set PopupBorderSize(v) { this._ptr.set_PopupBorderSize(v); } /** Padding within a framed rectangle (used by most widgets). */ get FramePadding() { return ImVec2.wrap(this._ptr.get_FramePadding()); } set FramePadding(v) { this._ptr.set_FramePadding(v._ptr); } /** Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets). */ get FrameRounding() { return this._ptr.get_FrameRounding(); } set FrameRounding(v) { this._ptr.set_FrameRounding(v); } /** Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU\/GPU costly). */ get FrameBorderSize() { return this._ptr.get_FrameBorderSize(); } set FrameBorderSize(v) { this._ptr.set_FrameBorderSize(v); } /** Horizontal and vertical spacing between widgets\/lines. */ get ItemSpacing() { return ImVec2.wrap(this._ptr.get_ItemSpacing()); } set ItemSpacing(v) { this._ptr.set_ItemSpacing(v._ptr); } /** Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label). */ get ItemInnerSpacing() { return ImVec2.wrap(this._ptr.get_ItemInnerSpacing()); } set ItemInnerSpacing(v) { this._ptr.set_ItemInnerSpacing(v._ptr); } /** Padding within a table cell. Cellpadding.x is locked for entire table. CellPadding.y may be altered between different rows. */ get CellPadding() { return ImVec2.wrap(this._ptr.get_CellPadding()); } set CellPadding(v) { this._ptr.set_CellPadding(v._ptr); } /** Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much! */ get TouchExtraPadding() { return ImVec2.wrap(this._ptr.get_TouchExtraPadding()); } set TouchExtraPadding(v) { this._ptr.set_TouchExtraPadding(v._ptr); } /** Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2). */ get IndentSpacing() { return this._ptr.get_IndentSpacing(); } set IndentSpacing(v) { this._ptr.set_IndentSpacing(v); } /** Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1). */ get ColumnsMinSpacing() { return this._ptr.get_ColumnsMinSpacing(); } set ColumnsMinSpacing(v) { this._ptr.set_ColumnsMinSpacing(v); } /** Width of the vertical scrollbar, Height of the horizontal scrollbar. */ get ScrollbarSize() { return this._ptr.get_ScrollbarSize(); } set ScrollbarSize(v) { this._ptr.set_ScrollbarSize(v); } /** Radius of grab corners for scrollbar. */ get ScrollbarRounding() { return this._ptr.get_ScrollbarRounding(); } set ScrollbarRounding(v) { this._ptr.set_ScrollbarRounding(v); } /** Minimum width\/height of a grab box for slider\/scrollbar. */ get GrabMinSize() { return this._ptr.get_GrabMinSize(); } set GrabMinSize(v) { this._ptr.set_GrabMinSize(v); } /** Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs. */ get GrabRounding() { return this._ptr.get_GrabRounding(); } set GrabRounding(v) { this._ptr.set_GrabRounding(v); } /** The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero. */ get LogSliderDeadzone() { return this._ptr.get_LogSliderDeadzone(); } set LogSliderDeadzone(v) { this._ptr.set_LogSliderDeadzone(v); } /** Thickness of border around Image() calls. */ get ImageBorderSize() { return this._ptr.get_ImageBorderSize(); } set ImageBorderSize(v) { this._ptr.set_ImageBorderSize(v); } /** Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs. */ get TabRounding() { return this._ptr.get_TabRounding(); } set TabRounding(v) { this._ptr.set_TabRounding(v); } /** Thickness of border around tabs. */ get TabBorderSize() { return this._ptr.get_TabBorderSize(); } set TabBorderSize(v) { this._ptr.set_TabBorderSize(v); } /** -1: always visible. 0.0f: visible when hovered. >0.0f: visible when hovered if minimum width. */ get TabCloseButtonMinWidthSelected() { return this._ptr.get_TabCloseButtonMinWidthSelected(); } set TabCloseButtonMinWidthSelected(v) { this._ptr.set_TabCloseButtonMinWidthSelected(v); } /** -1: always visible. 0.0f: visible when hovered. >0.0f: visible when hovered if minimum width. FLT_MAX: never show close button when unselected. */ get TabCloseButtonMinWidthUnselected() { return this._ptr.get_TabCloseButtonMinWidthUnselected(); } set TabCloseButtonMinWidthUnselected(v) { this._ptr.set_TabCloseButtonMinWidthUnselected(v); } /** Thickness of tab-bar separator, which takes on the tab active color to denote focus. */ get TabBarBorderSize() { return this._ptr.get_TabBarBorderSize(); } set TabBarBorderSize(v) { this._ptr.set_TabBarBorderSize(v); } /** Thickness of tab-bar overline, which highlights the selected tab-bar. */ get TabBarOverlineSize() { return this._ptr.get_TabBarOverlineSize(); } set TabBarOverlineSize(v) { this._ptr.set_TabBarOverlineSize(v); } /** Angle of angled headers (supported values range from -50.0f degrees to +50.0f degrees). */ get TableAngledHeadersAngle() { return this._ptr.get_TableAngledHeadersAngle(); } set TableAngledHeadersAngle(v) { this._ptr.set_TableAngledHeadersAngle(v); } /** Alignment of angled headers within the cell */ get TableAngledHeadersTextAlign() { return ImVec2.wrap(this._ptr.get_TableAngledHeadersTextAlign()); } set TableAngledHeadersTextAlign(v) { this._ptr.set_TableAngledHeadersTextAlign(v._ptr); } /** Default way to draw lines connecting TreeNode hierarchy. ImGuiTreeNodeFlags_DrawLinesNone or ImGuiTreeNodeFlags_DrawLinesFull or ImGuiTreeNodeFlags_DrawLinesToNodes. */ get TreeLinesFlags() { return this._ptr.get_TreeLinesFlags(); } set TreeLinesFlags(v) { this._ptr.set_TreeLinesFlags(v); } /** Thickness of outlines when using ImGuiTreeNodeFlags_DrawLines. */ get TreeLinesSize() { return this._ptr.get_TreeLinesSize(); } set TreeLinesSize(v) { this._ptr.set_TreeLinesSize(v); } /** Radius of lines connecting child nodes to the vertical line. */ get TreeLinesRounding() { return this._ptr.get_TreeLinesRounding(); } set TreeLinesRounding(v) { this._ptr.set_TreeLinesRounding(v); } /** Side of the color button in the ColorEdit4 widget (left\/right). Defaults to ImGuiDir_Right. */ get ColorButtonPosition() { return this._ptr.get_ColorButtonPosition(); } set ColorButtonPosition(v) { this._ptr.set_ColorButtonPosition(v); } /** Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered). */ get ButtonTextAlign() { return ImVec2.wrap(this._ptr.get_ButtonTextAlign()); } set ButtonTextAlign(v) { this._ptr.set_ButtonTextAlign(v._ptr); } /** Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line. */ get SelectableTextAlign() { return ImVec2.wrap(this._ptr.get_SelectableTextAlign()); } set SelectableTextAlign(v) { this._ptr.set_SelectableTextAlign(v._ptr); } /** Thickness of border in SeparatorText() */ get SeparatorTextBorderSize() { return this._ptr.get_SeparatorTextBorderSize(); } set SeparatorTextBorderSize(v) { this._ptr.set_SeparatorTextBorderSize(v); } /** Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center). */ get SeparatorTextAlign() { return ImVec2.wrap(this._ptr.get_SeparatorTextAlign()); } set SeparatorTextAlign(v) { this._ptr.set_SeparatorTextAlign(v._ptr); } /** Horizontal offset of text from each edge of the separator + spacing on other axis. Generally small values. .y is recommended to be == FramePadding.y. */ get SeparatorTextPadding() { return ImVec2.wrap(this._ptr.get_SeparatorTextPadding()); } set SeparatorTextPadding(v) { this._ptr.set_SeparatorTextPadding(v._ptr); } /** Apply to regular windows: amount which we enforce to keep visible when moving near edges of your screen. */ get DisplayWindowPadding() { return ImVec2.wrap(this._ptr.get_DisplayWindowPadding()); } set DisplayWindowPadding(v) { this._ptr.set_DisplayWindowPadding(v._ptr); } /** Apply to every windows, menus, popups, tooltips: amount where we avoid displaying contents. Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured). */ get DisplaySafeAreaPadding() { return ImVec2.wrap(this._ptr.get_DisplaySafeAreaPadding()); } set DisplaySafeAreaPadding(v) { this._ptr.set_DisplaySafeAreaPadding(v._ptr); } /** Thickness of resizing border between docked windows */ get DockingSeparatorSize() { return this._ptr.get_DockingSeparatorSize(); } set DockingSeparatorSize(v) { this._ptr.set_DockingSeparatorSize(v); } /** Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). We apply per-monitor DPI scaling over this scale. May be removed later. */ get MouseCursorScale() { return this._ptr.get_MouseCursorScale(); } set MouseCursorScale(v) { this._ptr.set_MouseCursorScale(v); } /** Enable anti-aliased lines\/borders. Disable if you are really tight on CPU\/GPU. Latched at the beginning of the frame (copied to ImDrawList). */ get AntiAliasedLines() { return this._ptr.get_AntiAliasedLines(); } set AntiAliasedLines(v) { this._ptr.set_AntiAliasedLines(v); } /** Enable anti-aliased lines\/borders using textures where possible. Require backend to render with bilinear filtering (NOT point\/nearest filtering). Latched at the beginning of the frame (copied to ImDrawList). */ get AntiAliasedLinesUseTex() { return this._ptr.get_AntiAliasedLinesUseTex(); } set AntiAliasedLinesUseTex(v) { this._ptr.set_AntiAliasedLinesUseTex(v); } /** Enable anti-aliased edges around filled shapes (rounded rectangles, circles, etc.). Disable if you are really tight on CPU\/GPU. Latched at the beginning of the frame (copied to ImDrawList). */ get AntiAliasedFill() { return this._ptr.get_AntiAliasedFill(); } set AntiAliasedFill(v) { this._ptr.set_AntiAliasedFill(v); } /** Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality. */ get CurveTessellationTol() { return this._ptr.get_CurveTessellationTol(); } set CurveTessellationTol(v) { this._ptr.set_CurveTessellationTol(v); } /** Maximum error (in pixels) allowed when using AddCircle()\/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry. */ get CircleTessellationMaxError() { return this._ptr.get_CircleTessellationMaxError(); } set CircleTessellationMaxError(v) { this._ptr.set_CircleTessellationMaxError(v); } /** Delay for IsItemHovered(ImGuiHoveredFlags_Stationary). Time required to consider mouse stationary. */ get HoverStationaryDelay() { return this._ptr.get_HoverStationaryDelay(); } set HoverStationaryDelay(v) { this._ptr.set_HoverStationaryDelay(v); } /** Delay for IsItemHovered(ImGuiHoveredFlags_DelayShort). Usually used along with HoverStationaryDelay. */ get HoverDelayShort() { return this._ptr.get_HoverDelayShort(); } set HoverDelayShort(v) { this._ptr.set_HoverDelayShort(v); } /** Delay for IsItemHovered(ImGuiHoveredFlags_DelayNormal). " */ get HoverDelayNormal() { return this._ptr.get_HoverDelayNormal(); } set HoverDelayNormal(v) { this._ptr.set_HoverDelayNormal(v); } /** Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()\/SetItemTooltip() while using mouse. */ get HoverFlagsForTooltipMouse() { return this._ptr.get_HoverFlagsForTooltipMouse(); } set HoverFlagsForTooltipMouse(v) { this._ptr.set_HoverFlagsForTooltipMouse(v); } /** Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()\/SetItemTooltip() while using keyboard\/gamepad. */ get HoverFlagsForTooltipNav() { return this._ptr.get_HoverFlagsForTooltipNav(); } set HoverFlagsForTooltipNav(v) { this._ptr.set_HoverFlagsForTooltipNav(v); } /** Scale all spacing\/padding\/thickness values. Do not scale fonts. */ ScaleAllSizes(scale_factor) { return this._ptr.ImGuiStyle_ScaleAllSizes(scale_factor); } } /** Main configuration and I/O between your application and ImGui. */ export class ImGuiIO extends StructBinding { constructor() { super("ImGuiIO"); } /** = 0 \/\/ See ImGuiConfigFlags_ enum. Set by user\/application. Keyboard\/Gamepad navigation options, etc. */ get ConfigFlags() { return this._ptr.get_ConfigFlags(); } set ConfigFlags(v) { this._ptr.set_ConfigFlags(v); } /** = 0 \/\/ See ImGuiBackendFlags_ enum. Set by backend (imgui_impl_xxx files or custom backend) to communicate features supported by the backend. */ get BackendFlags() { return this._ptr.get_BackendFlags(); } set BackendFlags(v) { this._ptr.set_BackendFlags(v); } /** <unset> \/\/ Main display size, in pixels (== GetMainViewport()->Size). May change every frame. */ get DisplaySize() { return ImVec2.wrap(this._ptr.get_DisplaySize()); } set DisplaySize(v) { this._ptr.set_DisplaySize(v._ptr); } /** = (1, 1) \/\/ Main display density. For retina display where window coordinates are different from framebuffer coordinates. This will affect font density + will end up in ImDrawData::FramebufferScale. */ get DisplayFramebufferScale() { return ImVec2.wrap(this._ptr.get_DisplayFramebufferScale()); } set DisplayFramebufferScale(v) { this._ptr.set_DisplayFramebufferScale(v._ptr); } /** = 1.0f\/60.0f \/\/ Time elapsed since last frame, in seconds. May change every frame. */ get DeltaTime() { return this._ptr.get_DeltaTime(); } set DeltaTime(v) { this._ptr.set_DeltaTime(v); } /** = 5.0f \/\/ Minimum time between saving positions\/sizes to .ini file, in seconds. */ get IniSavingRate() { return this._ptr.get_IniSavingRate(); } set IniSavingRate(v) { this._ptr.set_IniSavingRate(v); } /** <auto> \/\/ Font atlas: load, rasterize and pack one or more fonts into a single texture. */ get Fonts() { return ImFontAtlas.wrap(this._ptr.get_Fonts()); } set Fonts(v) { this._ptr.set_Fonts(v._ptr); } /** = NULL \/\/ Font to use on NewFrame(). Use NULL to uses Fonts->Fonts[0]. */ get FontDefault() { return ImFont.wrap(this._ptr.get_FontDefault()); } set FontDefault(v) { this._ptr.set_FontDefault(v._ptr); } /** = false \/\/ [OBSOLETE] Allow user scaling text of individual window with CTRL+Wheel. */ get FontAllowUserScaling() { return this._ptr.get_FontAllowUserScaling(); } set FontAllowUserScaling(v) { this._ptr.set_FontAllowUserScaling(v); } /** = false \/\/ Swap Activate<>Cancel (A<>B) buttons, matching typical "Nintendo\/Japanese style" gamepad layout. */ get ConfigNavSwapGamepadButtons() { return this._ptr.get_ConfigNavSwapGamepadButtons(); } set ConfigNavSwapGamepadButtons(v) { this._ptr.set_ConfigNavSwapGamepadButtons(v); } /** = false \/\/ Directional\/tabbing navigation teleports the mouse cursor. May be useful on TV\/console systems where moving a virtual mouse is difficult. Will update io.MousePos and set io.WantSetMousePos=true. */ get ConfigNavMoveSetMousePos() { return this._ptr.get_ConfigNavMoveSetMousePos(); } set ConfigNavMoveSetMousePos(v) { this._ptr.set_ConfigNavMoveSetMousePos(v); } /** = true \/\/ Sets io.WantCaptureKeyboard when io.NavActive is set. */ get ConfigNavCaptureKeyboard() { return this._ptr.get_ConfigNavCaptureKeyboard(); } set ConfigNavCaptureKeyboard(v) { this._ptr.set_ConfigNavCaptureKeyboard(v); } /** = true \/\/ Pressing Escape can clear focused item + navigation id\/highlight. Set to false if you want to always keep highlight on. */ get ConfigNavEscapeClearFocusItem() { return this._ptr.get_ConfigNavEscapeClearFocusItem(); } set ConfigNavEscapeClearFocusItem(v) { this._ptr.set_ConfigNavEscapeClearFocusItem(v); } /** = false \/\/ Pressing Escape can clear focused window as well (super set of io.ConfigNavEscapeClearFocusItem). */ get ConfigNavEscapeClearFocusWindow() { return this._ptr.get_ConfigNavEscapeClearFocusWindow(); } set ConfigNavEscapeClearFocusWindow(v) { this._ptr.set_ConfigNavEscapeClearFocusWindow(v); } /** = true \/\/ Using directional navigation key makes the cursor visible. Mouse click hides the cursor. */ get ConfigNavCursorVisibleAuto() { return this._ptr.get_ConfigNavCursorVisibleAuto(); } set ConfigNavCursorVisibleAuto(v) { this._ptr.set_ConfigNavCursorVisibleAuto(v); } /** = false \/\/ Navigation cursor is always visible. */ get ConfigNavCursorVisibleAlways() { return this._ptr.get_ConfigNavCursorVisibleAlways(); } set ConfigNavCursorVisibleAlways(v) { this._ptr.set_ConfigNavCursorVisibleAlways(v); } /** = false \/\/ Simplified docking mode: disable window splitting, so docking is limited to merging multiple windows together into tab-bars. */ get ConfigDockingNoSplit() { return this._ptr.get_ConfigDockingNoSplit(); } set ConfigDockingNoSplit(v) { this._ptr.set_ConfigDockingNoSplit(v); } /** = false \/\/ Enable docking with holding Shift key (reduce visual noise, allows dropping in wider space) */ get ConfigDockingWithShift() { return this._ptr.get_ConfigDockingWithShift(); } set ConfigDockingWithShift(v) { this._ptr.set_ConfigDockingWithShift(v); } /** = false \/\/ [BETA] [FIXME: This currently creates regression with auto-sizing and general overhead] Make every single floating window display within a docking node. */ get ConfigDockingAlwaysTabBar() { return this._ptr.get_ConfigDockingAlwaysTabBar(); } set ConfigDockingAlwaysTabBar(v) { this._ptr.set_ConfigDockingAlwaysTabBar(v); } /** = false \/\/ [BETA] Make window or viewport transparent when docking and only display docking boxes on the target viewport. Useful if rendering of multiple viewport cannot be synced. Best used with ConfigViewportsNoAutoMerge. */ get ConfigDockingTransparentPayload() { return this._ptr.get_ConfigDockingTransparentPayload(); } set ConfigDockingTransparentPayload(v) { this._ptr.set_ConfigDockingTransparentPayload(v); } /** = false; \/\/ Set to make all floating imgui windows always create their own viewport. Otherwise, they are merged into the main host viewports when overlapping it. May also set ImGuiViewportFlags_NoAutoMerge on individual viewport. */ get ConfigViewportsNoAutoMerge() { return this._ptr.get_ConfigViewportsNoAutoMerge(); } set ConfigViewportsNoAutoMerge(v) { this._ptr.set_ConfigViewportsNoAutoMerge(v); } /** = false \/\/ Disable default OS task bar icon flag for secondary viewports. When a viewport doesn't want a task bar icon, ImGuiViewportFlags_NoTaskBarIcon will be set on it. */ get ConfigViewportsNoTaskBarIcon() { return this._ptr.get_ConfigViewportsNoTaskBarIcon(); } set ConfigViewportsNoTaskBarIcon(v) { this._ptr.set_ConfigViewportsNoTaskBarIcon(v); } /** = true \/\/ Disable default OS window decoration flag for secondary viewports. When a viewport doesn't want window decorations, ImGuiViewportFlags_NoDecoration will be set on it. Enabling decoration can create subsequent issues at OS levels (e.g. minimum window size). */ get ConfigViewportsNoDecoration() { return this._ptr.get_ConfigViewportsNoDecoration(); } set ConfigViewportsNoDecoration(v) { this._ptr.set_ConfigViewportsNoDecoration(v); } /** = false \/\/ Disable default OS parenting to main viewport for secondary viewports. By default, viewports are marked with ParentViewportId = <main_viewport>, expecting the platform backend to setup a parent\/child relationship between the OS windows (some backend may ignore this). Set to true if you want the default to be 0, then all viewports will be top-level OS windows. */ get ConfigViewportsNoDefaultParent() { return this._ptr.get_ConfigViewportsNoDefaultParent(); } set ConfigViewportsNoDefaultParent(v) { this._ptr.set_ConfigViewportsNoDefaultParent(v); } /** = false \/\/ [EXPERIMENTAL] Automatically overwrite style.FontScaleDpi when Monitor DPI changes. This will scale fonts but _NOT_ scale sizes\/padding for now. */ get ConfigDpiScaleFonts() { return this._ptr.get_ConfigDpiScaleFonts(); } set ConfigDpiScaleFonts(v) { this._ptr.set_ConfigDpiScaleFonts(v); } /** = false \/\/ [EXPERIMENTAL] Scale Dear ImGui and Platform Windows when Monitor DPI changes. */ get ConfigDpiScaleViewports() { return this._ptr.get_ConfigDpiScaleViewports(); } set ConfigDpiScaleViewports(v) { this._ptr.set_ConfigDpiScaleViewports(v); } /** = false \/\/ Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by backend implementations. */ get MouseDrawCursor() { return this._ptr.get_MouseDrawCursor(); } set MouseDrawCursor(v) { this._ptr.set_MouseDrawCursor(v); } /** = defined(__APPLE__) \/\/ Swap Cmd<>Ctrl keys + OS X style text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd\/Super instead of Ctrl, Line\/Text Start and End using Cmd+Arrows instead of Home\/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd\/Super instead of Ctrl. */ get ConfigMacOSXBehaviors() { return this._ptr.get_ConfigMacOSXBehaviors(); } set ConfigMacOSXBehaviors(v) { this._ptr.set_ConfigMacOSXBehaviors(v); } /** = true \/\/ Enable input queue trickling: some types of events submitted during the same frame (e.g. button down + up) will be spread over multiple frames, improving interactions with low framerates. */ get ConfigInputTrickleEventQueue() { return this._ptr.get_ConfigInputTrickleEventQueue(); } set ConfigInputTrickleEventQueue(v) { this._ptr.set_ConfigInputTrickleEventQueue(v); } /** = true \/\/ Enable blinking cursor (optional as some users consider it to be distracting). */ get ConfigInputTextCursorBlink() { return this._ptr.get_ConfigInputTextCursorBlink(); } set ConfigInputTextCursorBlink(v) { this._ptr.set_ConfigInputTextCursorBlink(v); } /** = false \/\/ [BETA] Pressing Enter will keep item active and select contents (single-line only). */ get ConfigInputTextEnterKeepActive() { return this._ptr.get_ConfigInputTextEnterKeepActive(); } set ConfigInputTextEnterKeepActive(v) { this._ptr.set_ConfigInputTextEnterKeepActive(v); } /** = false \/\/ [BETA] Enable turning DragXXX widgets into text input with a simple mouse click-release (without moving). Not desirable on devices without a keyboard. */ get ConfigDragClickToInputText() { return this._ptr.get_ConfigDragClickToInputText(); } set ConfigDragClickToInputText(v) { this._ptr.set_ConfigDragClickToInputText(v); } /** = true \/\/ Enable resizing of windows from their edges and from the lower-left corner. This requires ImGuiBackendFlags_HasMouseCursors for better mouse cursor feedback. (This used to be a per-window ImGuiWindowFlags_ResizeFromAnySide flag) */ get ConfigWindowsResizeFromEdges() { return this._ptr.get_ConfigWindowsResizeFromEdges(); } set ConfigWindowsResizeFromEdges(v) { this._ptr.set_ConfigWindowsResizeFromEdges(v); } /** = false \/\/ Enable allowing to move windows only when clicking on their title bar. Does not apply to windows without a title bar. */ get ConfigWindowsMoveFromTitleBarOnly() { return this._ptr.get_ConfigWindowsMoveFromTitleBarOnly(); } set ConfigWindowsMoveFromTitleBarOnly(v) { this._ptr.set_ConfigWindowsMoveFromTitleBarOnly(v); } /** = false \/\/ [EXPERIMENTAL] CTRL+C copy the contents of focused window into the clipboard. Experimental because: (1) has known issues with nested Begin\/End pairs (2) text output quality varies (3) text output is in submission order rather than spatial order. */ get ConfigWindowsCopyContentsWithCtrlC() { return this._ptr.get_ConfigWindowsCopyContentsWithCtrlC(); } set ConfigWindowsCopyContentsWithCtrlC(v) { this._ptr.set_ConfigWindowsCopyContentsWithCtrlC(v); } /** = true \/\/ Enable scrolling page by page when clicking outside the scrollbar grab. When disabled, always scroll to clicked location. When enabled, Shift+Click scrolls to clicked location. */ get ConfigScrollbarScrollByPage() { return this._ptr.get_ConfigScrollbarScrollByPage(); } set ConfigScrollbarScrollByPage(v) { this._ptr.set_ConfigScrollbarScrollByPage(v); } /** = 60.0f \/\/ Timer (in seconds) to free transient windows\/tables memory buffers when unused. Set to -1.0f to disable. */ get ConfigMemoryCompactTimer() { return this._ptr.get_ConfigMemoryCompactTimer(); } set ConfigMemoryCompactTimer(v) { this._ptr.set_ConfigMemoryCompactTimer(v); } /** = 0.30f \/\/ Time for a double-click, in seconds. */ get MouseDoubleClickTime() { return this._ptr.get_MouseDoubleClickTime(); } set MouseDoubleClickTime(v) { this._ptr.set_MouseDoubleClickTime(v); } /** = 6.0f \/\/ Distance threshold to stay in to validate a double-click, in pixels. */ get MouseDoubleClickMaxDist() { return this._ptr.get_MouseDoubleClickMaxDist(); } set MouseDoubleClickMaxDist(v) { this._ptr.set_MouseDoubleClickMaxDist(v); } /** = 6.0f \/\/ Distance threshold before considering we are dragging. */ get MouseDragThreshold() { return this._ptr.get_MouseDragThreshold(); } set MouseDragThreshold(v) { this._ptr.set_MouseDragThreshold(v); } /** = 0.275f \/\/ When holding a key\/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.). */ get KeyRepeatDelay() { return this._ptr.get_KeyRepeatDelay(); } set KeyRepeatDelay(v) { this._ptr.set_KeyRepeatDelay(v); } /** = 0.050f \/\/ When holding a key\/button, rate at which it repeats, in seconds. */ get KeyRepeatRate() { return this._ptr.get_KeyRepeatRate(); } set KeyRepeatRate(v) { this._ptr.set_KeyRepeatRate(v); } /** = true \/\/ Enable error recovery support. Some errors won't be detected and lead to direct crashes if recovery is disabled. */ get ConfigErrorRecovery() { return this._ptr.get_ConfigErrorRecovery(); } set ConfigErrorRecovery(v) { this._ptr.set_ConfigErrorRecovery(v); } /** = true \/\/ Enable asserts on recoverable error. By default call IM_ASSERT() when returning from a failing IM_ASSERT_USER_ERROR() */ get ConfigErrorRecoveryEnableAssert() { return this._ptr.get_ConfigErrorRecoveryEnableAssert(); } set ConfigErrorRecoveryEnableAssert(v) { this._ptr.set_ConfigErrorRecoveryEnableAssert(v); } /** = true \/\/ Enable debug log output on recoverable errors. */ get ConfigErrorRecoveryEnableDebugLog() { return this._ptr.get_ConfigErrorRecoveryEnableDebugLog(); } set ConfigErrorRecoveryEnableDebugLog(v) { this._ptr.set_ConfigErrorRecoveryEnableDebugLog(v); } /** = true \/\/ Enable tooltip on recoverable errors. The tooltip include a way to enable asserts if they were disabled. */ get ConfigErrorRecoveryEnableTooltip() { return this._ptr.get_ConfigErrorRecoveryEnableTooltip(); } set ConfigErrorRecoveryEnableTooltip(v) { this._ptr.set_ConfigErrorRecoveryEnableTooltip(v); } /** = false \/\/ Enable various tools calling IM_DEBUG_BREAK(). */ get ConfigDebugIsDebuggerPresent() { return this._ptr.get_ConfigDebugIsDebuggerPresent(); } set ConfigDebugIsDebuggerPresent(v) { this._ptr.set_ConfigDebugIsDebuggerPresent(v); } /** = true \/\/ Highlight and show an error message popup when multiple items have conflicting identifiers. */ get ConfigDebugHighlightIdConflicts() { return this._ptr.get_ConfigDebugHighlightIdConflicts(); } set ConfigDebugHighlightIdConflicts(v) { this._ptr.set_ConfigDebugHighlightIdConflicts(v); } /** true \/\/ Show "Item Picker" button in aforementioned popup. */ get ConfigDebugHighlightIdConflictsShowItemPicker() { return this._ptr.get_ConfigDebugHighlightIdConflictsShowItemPicker(); } set ConfigDebugHighlightIdConflictsShowItemPicker(v) { this._ptr.set_ConfigDebugHighlightIdConflictsShowItemPicker(v); } /** = false \/\/ First-time calls to Begin()\/BeginChild() will return false. NEEDS TO BE SET AT APPLICATION BOOT TIME if you don't want to miss windows. */ get ConfigDebugBeginReturnValueOnce() { return this._ptr.get_ConfigDebugBeginReturnValueOnce(); } set ConfigDebugBeginReturnValueOnce(v) { this._ptr.set_ConfigDebugBeginReturnValueOnce(v); } /** = false \/\/ Some calls to Begin()\/BeginChild() will return false. Will cycle through window depths then repeat. Suggested use: add "io.ConfigDebugBeginReturnValue = io.KeyShift" in your main loop then occasionally press SHIFT. Windows should be flickering while running. */ get ConfigDebugBeginReturnValueLoop() { return this._ptr.get_ConfigDebugBeginReturnValueLoop(); } set ConfigDebugBeginReturnValueLoop(v) { this._ptr.set_ConfigDebugBeginReturnValueLoop(v); } /** = false \/\/ Ignore io.AddFocusEvent(false), consequently not calling io.ClearInputKeys()\/io.ClearInputMouse() in input processing. */ get ConfigDebugIgnoreFocusLoss() { return this._ptr.get_ConfigDebugIgnoreFocusLoss(); } set ConfigDebugIgnoreFocusLoss(v) { this._ptr.set_ConfigDebugIgnoreFocusLoss(v); } /** = false \/\/ Save .ini data with extra comments (particularly helpful for Docking, but makes saving slower) */ get ConfigDebugIniSettings() { return this._ptr.get_ConfigDebugIniSettings(); } set ConfigDebugIniSettings(v) { this._ptr.set_ConfigDebugIniSettings(v); } /** Set when Dear ImGui will use mouse inputs, in this case do not dispatch them to your main game\/application (either way, always pass on mouse inputs to imgui). (e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.). */ get WantCaptureMouse() { return this._ptr.get_WantCaptureMouse(); } set WantCaptureMouse(v) { this._ptr.set_WantCaptureMouse(v); } /** Set when Dear ImGui will use keyboard inputs, in this case do not dispatch them to your main game\/application (either way, always pass keyboard inputs to imgui). (e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.). */ get WantCaptureKeyboard() { return this._ptr.get_WantCaptureKeyboard(); } set WantCaptureKeyboard(v) { this._ptr.set_WantCaptureKeyboard(v); } /** Mobile\/console: when set, you may display an on-screen keyboard. This is set by Dear ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active). */ get WantTextInput() { return this._ptr.get_WantTextInput(); } set WantTextInput(v) { this._ptr.set_WantTextInput(v); } /** MousePos has been altered, backend should reposition mouse on next frame. Rarely used! Set only when io.ConfigNavMoveSetMousePos is enabled. */ get WantSetMousePos() { return this._ptr.get_WantSetMousePos(); } set WantSetMousePos(v) { this._ptr.set_WantSetMousePos(v); } /** When manual .ini load\/save is active (io.IniFilename == NULL), this will be set to notify your application that you can call SaveIniSettingsToMemory() and save yourself. Important: clear io.WantSaveIniSettings yourself after saving! */ get WantSaveIniSettings() { return this._ptr.get_WantSaveIniSettings(); } set WantSaveIniSettings(v) { this._ptr.set_WantSaveIniSettings(v); } /** Keyboard\/Gamepad navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag. */ get NavActive() { return this._ptr.get_NavActive(); } set NavActive(v) { this._ptr.set_NavActive(v); } /** Keyboard\/Gamepad navigation highlight is visible and allowed (will handle ImGuiKey_NavXXX events). */ get NavVisible() { return this._ptr.get_NavVisible(); } set NavVisible(v) { this._ptr.set_NavVisible(v); } /** Estimate of application framerate (rolling average over 60 frames, based on io.DeltaTime), in frame per second. Solely for convenience. Slow applications may not want to use a moving average or may want to reset underlying buffers occasionally. */ get Framerate() { return this._ptr.get_Framerate(); } set Framerate(v) { this._ptr.set_Framerate(v); } /** Vertices output during last call to Render() */ get MetricsRenderVertices() { return this._ptr.get_MetricsRenderVertices(); } set MetricsRenderVertices(v) { this._ptr.set_MetricsRenderVertices(v); } /** Indices output during last call to Render() = number of triangles * 3 */ get MetricsRenderIndices() { return this._ptr.get_MetricsRenderIndices(); } set MetricsRenderIndices(v) { this._ptr.set_MetricsRenderIndices(v); } /** Number of visible windows */ get MetricsRenderWindows() { return this._ptr.get_MetricsRenderWindows(); } set MetricsRenderWindows(v) { this._ptr.set_MetricsRenderWindows(v); } /** Number of active windows */ get MetricsActiveWindows() { return this._ptr.get_MetricsActiveWindows(); } set MetricsActiveWindows(v) { this._ptr.set_MetricsActiveWindows(v); } /** Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing\/reappearing mouse won't have a huge delta. */ get MouseDelta() { return ImVec2.wrap(this._ptr.get_MouseDelta()); } set MouseDelta(v) { this._ptr.set_MouseDelta(v._ptr); } /** Parent UI context (needs to be set explicitly by parent). */ get Ctx() { return ImGuiContext.wrap(this._ptr.get_Ctx()); } set Ctx(v) { this._ptr.set_Ctx(v._ptr); } /** Mouse position, in pixels. Set to ImVec2(-FLT_MAX, -FLT_MAX) if mouse is unavailable (on another screen, etc.) */ get MousePos() { return ImVec2.wrap(this._ptr.get_MousePos()); } set MousePos(v) { this._ptr.set_MousePos(v._ptr); } /** Mouse wheel Vertical: 1 unit scrolls about 5 lines text. >0 scrolls Up, <0 scrolls Down. Hold SHIFT to turn vertical scroll into horizontal scroll. */ get MouseWheel() { return this._ptr.get_MouseWheel(); } set MouseWheel(v) { this._ptr.set_MouseWheel(v); } /** Mouse wheel Horizontal. >0 scrolls Left, <0 scrolls Right. Most users don't have a mouse with a horizontal wheel, may not be filled by all backends. */ get MouseWheelH() { return this._ptr.get_MouseWheelH(); } set MouseWheelH(v) { this._ptr.set_MouseWheelH(v); } /** Mouse actual input peripheral (Mouse\/TouchScreen\/Pen). */ get MouseSource() { return this._ptr.get_MouseSource(); } set MouseSource(v) { this._ptr.set_MouseSource(v); } /** (Optional) Modify using io.AddMouseViewportEvent(). With multi-viewports: viewport the OS mouse is hovering. If possible _IGNORING_ viewports with the ImGuiViewportFlags_NoInputs flag is much better (few backends can handle that). Set io.BackendFlags |= ImGuiBackendFlags_HasMouseHoveredViewport if you can provide this info. If you don't imgui will infer the value using t