imgui

package
v0.0.0-...-697b985 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2019 License: BSD-3-Clause, Zlib Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FONT_ATLAS_DEFAULT_TEX_DATA_W_HALF = 90
	FONT_ATLAS_DEFAULT_TEX_DATA_H      = 27
	FONT_ATLAS_DEFAULT_TEX_DATA_ID     = 0x80000000
)

A work of art lies ahead! (. = white layer, X = black layer, others are blank) The white texels on the top left are the ones we'll use everywhere in ImGui to render filled shapes.

View Source
const (
	PlotTypeLines = iota
	PlotTypeHistogram
)

Variables

View Source
var FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA = [MouseCursorCOUNT][3]f64.Vec2{

	{f64.Vec2{0, 3}, f64.Vec2{12, 19}, f64.Vec2{0, 0}},
	{f64.Vec2{13, 0}, f64.Vec2{7, 16}, f64.Vec2{4, 8}},
	{f64.Vec2{31, 0}, f64.Vec2{23, 23}, f64.Vec2{11, 11}},
	{f64.Vec2{21, 0}, f64.Vec2{9, 23}, f64.Vec2{5, 11}},
	{f64.Vec2{55, 18}, f64.Vec2{23, 9}, f64.Vec2{11, 5}},
	{f64.Vec2{73, 0}, f64.Vec2{17, 17}, f64.Vec2{9, 9}},
	{f64.Vec2{55, 0}, f64.Vec2{17, 17}, f64.Vec2{9, 9}},
}
View Source
var FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS = []byte(
	"..-         -XXXXXXX-    X    -           X           -XXXXXXX          -          XXXXXXX" +
		"..-         -X.....X-   X.X   -          X.X          -X.....X          -          X.....X" +
		"---         -XXX.XXX-  X...X  -         X...X         -X....X           -           X....X" +
		"X           -  X.X  - X.....X -        X.....X        -X...X            -            X...X" +
		"XX          -  X.X  -X.......X-       X.......X       -X..X.X           -           X.X..X" +
		"X.X         -  X.X  -XXXX.XXXX-       XXXX.XXXX       -X.X X.X          -          X.X X.X" +
		"X..X        -  X.X  -   X.X   -          X.X          -XX   X.X         -         X.X   XX" +
		"X...X       -  X.X  -   X.X   -    XX    X.X    XX    -      X.X        -        X.X      " +
		"X....X      -  X.X  -   X.X   -   X.X    X.X    X.X   -       X.X       -       X.X       " +
		"X.....X     -  X.X  -   X.X   -  X..X    X.X    X..X  -        X.X      -      X.X        " +
		"X......X    -  X.X  -   X.X   - X...XXXXXX.XXXXXX...X -         X.X   XX-XX   X.X         " +
		"X.......X   -  X.X  -   X.X   -X.....................X-          X.X X.X-X.X X.X          " +
		"X........X  -  X.X  -   X.X   - X...XXXXXX.XXXXXX...X -           X.X..X-X..X.X           " +
		"X.........X -XXX.XXX-   X.X   -  X..X    X.X    X..X  -            X...X-X...X            " +
		"X..........X-X.....X-   X.X   -   X.X    X.X    X.X   -           X....X-X....X           " +
		"X......XXXXX-XXXXXXX-   X.X   -    XX    X.X    XX    -          X.....X-X.....X          " +
		"X...X..X    ---------   X.X   -          X.X          -          XXXXXXX-XXXXXXX          " +
		"X..X X..X   -       -XXXX.XXXX-       XXXX.XXXX       ------------------------------------" +
		"X.X  X..X   -       -X.......X-       X.......X       -    XX           XX    -           " +
		"XX    X..X  -       - X.....X -        X.....X        -   X.X           X.X   -           " +
		"      X..X          -  X...X  -         X...X         -  X..X           X..X  -           " +
		"       XX           -   X.X   -          X.X          - X...XXXXXXXXXXXXX...X -           " +
		"------------        -    X    -           X           -X.....................X-           " +
		"                    ----------------------------------- X...XXXXXXXXXXXXX...X -           " +
		"                                                      -  X..X           X..X  -           " +
		"                                                      -   X.X           X.X   -           " +
		"                                                      -    XX           XX    -           ")

Functions

func Acos01

func Acos01(x float64) float64

func CharIsSpace

func CharIsSpace(c rune) bool

func DataTypeApplyOp

func DataTypeApplyOp(op int, output, arg1, arg2 interface{})

func DataTypeApplyOpFromText

func DataTypeApplyOpFromText(buf []byte, initial_value_buf string, data interface{}, scalar_format string) bool

User can input math operators (e.g. +100) to edit a numerical values. NB: This is _not_ a full expression evaluator. We should probably add one though..

func DataTypeFormatString

func DataTypeFormatString(data interface{}, format string) []byte

func Decode85

func Decode85(src, dst []byte)

func Decode85Byte

func Decode85Byte(c byte) uint

func F32_TO_INT8_UNBOUND

func F32_TO_INT8_UNBOUND(v float64) int

func GetDefaultCompressedFontDataTTFBase85

func GetDefaultCompressedFontDataTTFBase85() []byte

func GetMinimumStepAtDecimalPrecision

func GetMinimumStepAtDecimalPrecision(decimal_precision int) float64

func ImeSetInputScreenPosFn_DefaultImpl

func ImeSetInputScreenPosFn_DefaultImpl(x, y int)

func InputTextCalcTextLenAndLineCount

func InputTextCalcTextLenAndLineCount(text string) int

func InvLength

func InvLength(lhs f64.Vec2, fail_value float64) float64

func LineClosestPoint

func LineClosestPoint(a, b, p f64.Vec2) f64.Vec2

func ParseFormatPrecision

func ParseFormatPrecision(format string, default_precision int) int

Parse display precision back from the display format string FIXME: This is still used by some navigation code path to infer a minimum tweak step, but we should aim to rework widgets so it isn't needed.

func ParseFormatTrimDecorations

func ParseFormatTrimDecorations(format string) string

Extract the format out of a format string with leading or trailing decorations

fmt = "blah blah"  -> return fmt
fmt = "%.3f"       -> return fmt
fmt = "hello %.3f" -> return fmt + 6
fmt = "%.3f hello" -> return buf written with "%.3f"

func ParseFormatTrimDecorationsLeading

func ParseFormatTrimDecorationsLeading(format string) string

func Rotate

func Rotate(v f64.Vec2, cos_a, sin_a float64) f64.Vec2

func RoundScalarWithFormat

func RoundScalarWithFormat(format string, value float64) float64

func StrbolW

func StrbolW(buf []rune, buf_mid_line, buf_begin int) int

find beginning-of-line

func TextCountUtf8BytesFromStr

func TextCountUtf8BytesFromStr(r []rune) int

func TriangleBarycentricCoords

func TriangleBarycentricCoords(a, b, c, p f64.Vec2) (out_u, out_v, out_w float64)

func TriangleClosestPoint

func TriangleClosestPoint(a, b, c, p f64.Vec2) f64.Vec2

func TriangleContainsPoint

func TriangleContainsPoint(a, b, c, p f64.Vec2) bool

func UpperPowerOfTwo

func UpperPowerOfTwo(v int) int

Types

type Axis

type Axis int
const (
	AxisNone Axis = -1
	AxisX    Axis = 0
	AxisY    Axis = 1
)

type BackendFlags

type BackendFlags int
const (
	BackendFlagsHasGamepad      BackendFlags = 1 << 0 // Back-end supports and has a connected gamepad.
	BackendFlagsHasMouseCursors BackendFlags = 1 << 1 // Back-end supports reading GetMouseCursor() to change the OS cursor shape.
	BackendFlagsHasSetMousePos  BackendFlags = 1 << 2 // Back-end supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set).
)

type ButtonFlags

type ButtonFlags int
const (
	ButtonFlagsRepeat                ButtonFlags = 1 << 0  // hold to repeat
	ButtonFlagsPressedOnClickRelease ButtonFlags = 1 << 1  // return true on click + release on same item [DEFAULT if no PressedOn* flag is set]
	ButtonFlagsPressedOnClick        ButtonFlags = 1 << 2  // return true on click (default requires click+release)
	ButtonFlagsPressedOnRelease      ButtonFlags = 1 << 3  // return true on release (default requires click+release)
	ButtonFlagsPressedOnDoubleClick  ButtonFlags = 1 << 4  // return true on double-click (default requires click+release)
	ButtonFlagsFlattenChildren       ButtonFlags = 1 << 5  // allow interactions even if a child window is overlapping
	ButtonFlagsAllowItemOverlap      ButtonFlags = 1 << 6  // require previous frame HoveredId to either match id or be null before being usable use along with SetItemAllowOverlap()
	ButtonFlagsDontClosePopups       ButtonFlags = 1 << 7  // disable automatically closing parent popup on press // [UNUSED]
	ButtonFlagsDisabled              ButtonFlags = 1 << 8  // disable interactions
	ButtonFlagsAlignTextBaseLine     ButtonFlags = 1 << 9  // vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton() not possible currently because of DC.CursorPosPrevLine
	ButtonFlagsNoKeyModifiers        ButtonFlags = 1 << 10 // disable interaction if a key modifier is held
	ButtonFlagsNoHoldingActiveID     ButtonFlags = 1 << 11 // don't set ActiveId while holding the mouse (ButtonFlagsPressedOnClick only)
	ButtonFlagsPressedOnDragDropHold ButtonFlags = 1 << 12 // press when held into while we are drag and dropping another item (used by e.g. tree nodes collapsing headers)
	ButtonFlagsNoNavFocus            ButtonFlags = 1 << 13 // don't override navigation focus when activated
)

type Col

type Col int
const (
	ColText Col = iota
	ColTextDisabled
	ColWindowBg // Background of normal windows
	ColChildBg  // Background of child windows
	ColPopupBg  // Background of popups menus tooltips windows
	ColBorder
	ColBorderShadow
	ColFrameBg // Background of checkbox radio button plot slider text input
	ColFrameBgHovered
	ColFrameBgActive
	ColTitleBg
	ColTitleBgActive
	ColTitleBgCollapsed
	ColMenuBarBg
	ColScrollbarBg
	ColScrollbarGrab
	ColScrollbarGrabHovered
	ColScrollbarGrabActive
	ColCheckMark
	ColSliderGrab
	ColSliderGrabActive
	ColButton
	ColButtonHovered
	ColButtonActive
	ColHeader
	ColHeaderHovered
	ColHeaderActive
	ColSeparator
	ColSeparatorHovered
	ColSeparatorActive
	ColResizeGrip
	ColResizeGripHovered
	ColResizeGripActive
	ColPlotLines
	ColPlotLinesHovered
	ColPlotHistogram
	ColPlotHistogramHovered
	ColTextSelectedBg
	ColModalWindowDarkening // Darken/colorize entire screen behind a modal window, when one is active
	ColDragDropTarget
	ColNavHighlight          // Gamepad/keyboard: current highlighted item
	ColNavWindowingHighlight // Gamepad/keyboard: when holding NavMenu to focus/move/resize windows
	ColCOUNT
)

type ColMod

type ColMod struct {
	Col         Col
	BackupValue f64.Vec4
}

type ColorEditFlags

type ColorEditFlags int
const (
	ColorEditFlagsNoAlpha        ColorEditFlags = 1 << 1 //              // ColorEdit ColorPicker ColorButton: ignore Alpha component (read 3 components from the input pointer).
	ColorEditFlagsNoPicker       ColorEditFlags = 1 << 2 //              // ColorEdit: disable picker when clicking on colored square.
	ColorEditFlagsNoOptions      ColorEditFlags = 1 << 3 //              // ColorEdit: disable toggling options menu when right-clicking on inputs/small preview.
	ColorEditFlagsNoSmallPreview ColorEditFlags = 1 << 4 //              // ColorEdit ColorPicker: disable colored square preview next to the inputs. (e.g. to show only the inputs)
	ColorEditFlagsNoInputs       ColorEditFlags = 1 << 5 //              // ColorEdit ColorPicker: disable inputs sliders/text widgets (e.g. to show only the small preview colored square).
	ColorEditFlagsNoTooltip      ColorEditFlags = 1 << 6 //              // ColorEdit ColorPicker ColorButton: disable tooltip when hovering the preview.
	ColorEditFlagsNoLabel        ColorEditFlags = 1 << 7 //              // ColorEdit ColorPicker: disable display of inline text label (the label is still forwarded to the tooltip and picker).
	ColorEditFlagsNoSidePreview  ColorEditFlags = 1 << 8 //              // ColorPicker: disable bigger color preview on right side of the picker use small colored square preview instead.

	// User Options (right-click on widget to change some of them). You can set application defaults using SetColorEditOptions(). The idea is that you probably don't want to override them in most of your calls let the user choose and/or call SetColorEditOptions() during startup.
	ColorEditFlagsAlphaBar         ColorEditFlags = 1 << 9  //              // ColorEdit ColorPicker: show vertical alpha bar/gradient in picker.
	ColorEditFlagsAlphaPreview     ColorEditFlags = 1 << 10 //              // ColorEdit ColorPicker ColorButton: display preview as a transparent color over a checkerboard instead of opaque.
	ColorEditFlagsAlphaPreviewHalf ColorEditFlags = 1 << 11 //              // ColorEdit ColorPicker ColorButton: display half opaque / half checkerboard instead of opaque.
	ColorEditFlagsHDR              ColorEditFlags = 1 << 12 //              // (WIP) ColorEdit: Currently only disable 0.0f..1.0f limits in RGBA edition (note: you probably want to use ColorEditFlagsFloat flag as well).
	ColorEditFlagsRGB              ColorEditFlags = 1 << 13 // [Inputs]     // ColorEdit: choose one among RGB/HSV/HEX. ColorPicker: choose any combination using RGB/HSV/HEX.
	ColorEditFlagsHSV              ColorEditFlags = 1 << 14 // [Inputs]     // "
	ColorEditFlagsHEX              ColorEditFlags = 1 << 15 // [Inputs]     // "
	ColorEditFlagsUint8            ColorEditFlags = 1 << 16 // [DataType]   // ColorEdit ColorPicker ColorButton: _display_ values formatted as 0..255.
	ColorEditFlagsFloat            ColorEditFlags = 1 << 17 // [DataType]   // ColorEdit ColorPicker ColorButton: _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers.
	ColorEditFlagsPickerHueBar     ColorEditFlags = 1 << 18 // [PickerMode] // ColorPicker: bar for Hue rectangle for Sat/Value.
	ColorEditFlagsPickerHueWheel   ColorEditFlags = 1 << 19 // [PickerMode] // ColorPicker: wheel for Hue triangle for Sat/Value.

	// Internals/Masks
	ColorEditFlags_InputsMask     ColorEditFlags = ColorEditFlagsRGB | ColorEditFlagsHSV | ColorEditFlagsHEX
	ColorEditFlags_DataTypeMask   ColorEditFlags = ColorEditFlagsUint8 | ColorEditFlagsFloat
	ColorEditFlags_PickerMask     ColorEditFlags = ColorEditFlagsPickerHueWheel | ColorEditFlagsPickerHueBar
	ColorEditFlags_OptionsDefault ColorEditFlags = ColorEditFlagsUint8 | ColorEditFlagsRGB | ColorEditFlagsPickerHueBar // Change application default using SetColorEditOptions()
)

type ColumnData

type ColumnData struct {
	OffsetNorm             float64 // Column start offset, normalized 0.0 (far left) -> 1.0 (far right)
	OffsetNormBeforeResize float64
	Flags                  ColumnsFlags // Not exposed
	ClipRect               f64.Rectangle
}

func (*ColumnData) Init

func (c *ColumnData) Init()

type ColumnsFlags

type ColumnsFlags int
const (
	// Default: 0
	ColumnsFlagsNoBorder               ColumnsFlags = 1 << 0 // Disable column dividers
	ColumnsFlagsNoResize               ColumnsFlags = 1 << 1 // Disable resizing columns when clicking on the dividers
	ColumnsFlagsNoPreserveWidths       ColumnsFlags = 1 << 2 // Disable column width preservation when adjusting columns
	ColumnsFlagsNoForceWithinWindow    ColumnsFlags = 1 << 3 // Disable forcing columns to fit within window
	ColumnsFlagsGrowParentContentsSize ColumnsFlags = 1 << 4 // (WIP) Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove.
)

type ColumnsSet

type ColumnsSet struct {
	ID                 ID
	Flags              ColumnsFlags
	IsFirstFrame       bool
	IsBeingResized     bool
	Current            int
	Count              int
	MinX, MaxX         float64
	LineMinY, LineMaxY float64
	StartPosY          float64
	StartMaxPosX       float64 // Backup of CursorMaxPos
	CellMinY, CellMaxY float64
	Columns            []ColumnData
}

func (*ColumnsSet) Clear

func (c *ColumnsSet) Clear()

func (*ColumnsSet) Init

func (c *ColumnsSet) Init()

type ComboFlags

type ComboFlags int
const (
	ComboFlagsPopupAlignLeft ComboFlags = 1 << 0 // Align the popup toward the left by default
	ComboFlagsHeightSmall    ComboFlags = 1 << 1 // Max ~4 items visible. Tip: If you want your combo popup to be a specific size you can use SetNextWindowSizeConstraints() prior to calling BeginCombo()
	ComboFlagsHeightRegular  ComboFlags = 1 << 2 // Max ~8 items visible (default)
	ComboFlagsHeightLarge    ComboFlags = 1 << 3 // Max ~20 items visible
	ComboFlagsHeightLargest  ComboFlags = 1 << 4 // As many fitting items as possible
	ComboFlagsNoArrowButton  ComboFlags = 1 << 5 // Display on the preview box without the square arrow button
	ComboFlagsNoPreview      ComboFlags = 1 << 6 // Display only a square arrow button
	ComboFlagsHeightMask_    ComboFlags = ComboFlagsHeightSmall | ComboFlagsHeightRegular | ComboFlagsHeightLarge | ComboFlagsHeightLargest
)

type Cond

type Cond int
const (
	CondAlways       Cond = 1 << 0 // Set the variable
	CondOnce         Cond = 1 << 1 // Set the variable once per runtime session (only the first call with succeed)
	CondFirstUseEver Cond = 1 << 2 // Set the variable if the window has no saved data (if doesn't exist in the .ini file)
	CondAppearing    Cond = 1 << 3 // Set the variable if the window is appearing after being hidden/inactive (or the first time)
)

type ConfigFlags

type ConfigFlags uint
const (
	ConfigFlagsNavEnableKeyboard    ConfigFlags = 1 << 0 // Master keyboard navigation enable flag. NewFrame() will automatically fill io.NavInputs[] based on io.KeysDown[].
	ConfigFlagsNavEnableGamepad     ConfigFlags = 1 << 1 // Master gamepad navigation enable flag. This is mostly to instruct your imgui back-end to fill io.NavInputs[].
	ConfigFlagsNavEnableSetMousePos ConfigFlags = 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.
	ConfigFlagsNavNoCaptureKeyboard ConfigFlags = 1 << 3 // Instruct navigation to not set the io.WantCaptureKeyboard flag with io.NavActive is set.
	ConfigFlagsNoMouse              ConfigFlags = 1 << 4 // Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information back-end
	ConfigFlagsNoMouseCursorChange  ConfigFlags = 1 << 5 // Instruct back-end to not alter mouse cursor shape and visibility.

	// User storage (to allow your back-end/engine to communicate to code that may be shared between multiple projects. Those flags are not used by core ImGui)
	ConfigFlagsIsSRGB        ConfigFlags = 1 << 20 // Back-end is SRGB-aware.
	ConfigFlagsIsTouchScreen ConfigFlags = 1 << 21 // Back-end is using a touch screen instead of a mouse.
)

type Context

type Context struct {
	Initialized             bool
	FontAtlasOwnedByContext bool // Io.Fonts-> is owned by the ImGuiContext and will be destructed along with it.
	IO                      IO
	Style                   Style
	Font                    *Font   // (Shortcut) == FontStack.empty() ? IO.Font : FontStack.back()
	FontSize                float64 // (Shortcut) == FontBaseSize * g.CurrentWindow->FontWindowScale == window->FontSize(). Text height for current window.
	FontBaseSize            float64 // (Shortcut) == IO.FontGlobalScale * Font->Scale * Font->FontSize. Base text height.
	DrawListSharedData      DrawListSharedData

	Time                     float64
	FrameCount               int
	FrameCountEnded          int
	FrameCountRendered       int
	Windows                  []*Window
	WindowsSortBuffer        []*Window
	CurrentWindowStack       []*Window
	WindowsById              map[string]*Window
	WindowsActiveCount       int
	CurrentWindow            *Window // Being drawn into
	HoveredWindow            *Window // Will catch mouse inputs
	HoveredRootWindow        *Window // Will catch mouse inputs (for focus/move only)
	HoveredId                ID      // Hovered widget
	HoveredIdAllowOverlap    bool
	HoveredIdPreviousFrame   ID
	HoveredIdTimer           float64
	ActiveId                 ID // Active widget
	ActiveIdPreviousFrame    ID
	ActiveIdTimer            float64
	ActiveIdIsAlive          bool     // Active widget has been seen this frame
	ActiveIdIsJustActivated  bool     // Set at the time of activation for one frame
	ActiveIdAllowOverlap     bool     // Active widget allows another widget to steal active id (generally for overlapping widgets, but not always)
	ActiveIdAllowNavDirFlags int      // Active widget allows using directional navigation (e.g. can activate a button and move away from it)
	ActiveIdClickOffset      f64.Vec2 // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
	ActiveIdWindow           *Window
	ActiveIdSource           InputSource    // Activating with mouse or nav (gamepad/keyboard)
	MovingWindow             *Window        // Track the window we clicked on (in order to preserve focus). The actually window that is moved is generally MovingWindow->RootWindow.
	ColorModifiers           []ColMod       // Stack for PushStyleColor()/PopStyleColor()
	StyleModifiers           []StyleMod     // Stack for PushStyleVar()/PopStyleVar()
	FontStack                []*Font        // Stack for PushFont()/PopFont()
	OpenPopupStack           []PopupRef     // Which popups are open (persistent)
	CurrentPopupStack        []PopupRef     // Which level of BeginPopup() we are in (reset every frame)
	NextWindowData           NextWindowData // Storage for SetNextWindow** functions
	NextTreeNodeOpenVal      bool           // Storage for SetNextTreeNode** functions
	NextTreeNodeOpenCond     Cond

	// Navigation data (for gamepad/keyboard)
	NavWindow                  *Window       // Focused window for navigation. Could be called 'FocusWindow'
	NavId                      ID            // Focused item for navigation
	NavActivateId              ID            // ~~ (g.ActiveId == 0) && IsNavInputPressed(ImGuiNavInput_Activate) ? NavId : 0, also set when calling ActivateItem()
	NavActivateDownId          ID            // ~~ IsNavInputDown(ImGuiNavInput_Activate) ? NavId : 0
	NavActivatePressedId       ID            // ~~ IsNavInputPressed(ImGuiNavInput_Activate) ? NavId : 0
	NavInputId                 ID            // ~~ IsNavInputPressed(ImGuiNavInput_Input) ? NavId : 0
	NavJustTabbedId            ID            // Just tabbed to this id.
	NavNextActivateId          ID            // Set by ActivateItem(), queued until next frame
	NavJustMovedToId           ID            // Just navigated to this id (result of a successfully MoveRequest)
	NavInputSource             InputSource   // Keyboard or Gamepad mode?
	NavScoringRectScreen       f64.Rectangle // Rectangle used for scoring, in screen space. Based of window->DC.NavRefRectRel[], modified for directional navigation scoring.
	NavScoringCount            int           // Metrics for debugging
	NavWindowingTarget         *Window       // When selecting a window (holding Menu+FocusPrev/Next, or equivalent of CTRL-TAB) this window is temporarily displayed front-most.
	NavWindowingHighlightTimer float64
	NavWindowingHighlightAlpha float64
	NavWindowingToggleLayer    bool
	NavWindowingInputSource    InputSource // Gamepad or keyboard mode
	NavLayer                   int         // Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later.
	NavIdTabCounter            int         // == NavWindow->DC.FocusIdxTabCounter at time of NavId processing
	NavIdIsAlive               bool        // Nav widget has been seen this frame ~~ NavRefRectRel is valid
	NavMousePosDirty           bool        // When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavMoveMouse) if set (NB: this not enabled by default)
	NavDisableHighlight        bool        // When user starts using mouse, we hide gamepad/keyboard highlight (NB: but they are still available, which is why NavDisableHighlight isn't always != NavDisableMouseHover)
	NavDisableMouseHover       bool        // When user starts using gamepad/keyboard, we hide mouse hovering highlight until mouse is touched again.
	NavAnyRequest              bool        // ~~ NavMoveRequest || NavInitRequest
	NavInitRequest             bool        // Init request for appearing window to select first item
	NavInitRequestFromMove     bool
	NavInitResultId            ID
	NavInitResultRectRel       f64.Rectangle
	NavMoveFromClampedRefRect  bool          // Set by manual scrolling, if we scroll to a point where NavId isn't visible we reset navigation from visible items
	NavMoveRequest             bool          // Move request for this frame
	NavMoveRequestForward      NavForward    // None / ForwardQueued / ForwardActive (this is used to navigate sibling parent menus from a child menu)
	NavMoveDir, NavMoveDirLast Dir           // Direction of the move request (left/right/up/down), direction of the previous move request
	NavMoveResultLocal         NavMoveResult // Best move request candidate within NavWindow
	NavMoveResultOther         NavMoveResult // Best move request candidate within NavWindow's flattened hierarchy (when using the NavFlattened flag)

	// Render
	DrawData                  DrawData // Main ImDrawData instance to pass render information to the user
	DrawDataBuilder           DrawDataBuilder
	ModalWindowDarkeningRatio float64
	OverlayDrawList           DrawList // Optional software render of mouse cursors, if io.MouseDrawCursor is set + a few debug overlays
	MouseCursor               MouseCursor

	// Drag and Drop
	DragDropActive                  bool
	DragDropSourceFlags             DragDropFlags
	DragDropMouseButton             int
	DragDropPayload                 Payload
	DragDropTargetRect              f64.Rectangle
	DragDropTargetId                ID
	DragDropAcceptIdCurrRectSurface float64
	DragDropAcceptIdCurr            ID      // Target item id (set at the time of accepting the payload)
	DragDropAcceptIdPrev            ID      // Target item id from previous frame (we need to store this to allow for overlapping drag and drop targets)
	DragDropAcceptFrameCount        int     // Last time a target expressed a desire to accept the source
	DragDropPayloadBufHeap          []uint8 // We don't expose the ImVector<> directly
	DragDropPayloadBufLocal         [8]uint8

	// Widget state
	InputTextState                     TextEditState
	InputTextPasswordFont              Font
	ScalarAsInputTextId                ID             // Temporary text input when CTRL+clicking on a slider, etc.
	ColorEditOptions                   ColorEditFlags // Store user options for color edit widgets
	ColorPickerRef                     f64.Vec4
	DragCurrentValue                   float64 // Currently dragged value, always float, not rounded by end-user precision settings
	DragLastMouseDelta                 f64.Vec2
	DragSpeedDefaultRatio              float64 // If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio
	DragSpeedScaleSlow                 float64
	DragSpeedScaleFast                 float64
	ScrollbarClickDeltaToGrabCenter    f64.Vec2 // Distance between mouse and center of grab box, normalized in parent space. Use storage?
	TooltipOverrideCount               int
	PrivateClipboard                   string   // If no custom clipboard handler is defined
	PlatformImePos, PlatformImeLastPos f64.Vec2 // Cursor position request & last passed to the OS Input Method Editor

	// Settings
	SettingsLoaded     bool
	SettingsDirtyTimer float64                     // Save .ini Settings on disk when time reaches zero
	SettingsWindows    map[string]*WindowSettings  // .ini settings for ImGuiWindow
	SettingsHandlers   map[string]*SettingsHandler // List of .ini settings handlers

	// Logging
	LogEnabled            bool
	LogFile               *os.File // If != NULL log to stdout/ file
	LogClipboard          []rune   // Else log to clipboard. This is pointer so our GImGui static constructor doesn't call heap allocators.
	LogStartDepth         int
	LogAutoExpandMaxDepth int

	// Misc
	FramerateSecPerFrame         [120]float64 // Calculate estimate of framerate for user over the last 2 seconds.
	FramerateSecPerFrameIdx      int
	FramerateSecPerFrameAccum    float64
	WantCaptureMouseNextFrame    int // Explicit capture via CaptureKeyboardFromApp()/CaptureMouseFromApp() sets those flags
	WantCaptureKeyboardNextFrame int
	WantTextInputNextFrame       int
}

func CreateContext

func CreateContext() *Context

func CreateContextEx

func CreateContextEx(shared_font_atlas *FontAtlas) *Context

func (*Context) AddDrawListToDrawData

func (c *Context) AddDrawListToDrawData(out_list *[]*DrawList, draw_list *DrawList)

func (*Context) AddWindowSettings

func (c *Context) AddWindowSettings(name string) *WindowSettings

func (*Context) AddWindowToDrawData

func (c *Context) AddWindowToDrawData(out_render_list *[]*DrawList, window *Window)

func (*Context) AddWindowToDrawDataSelectLayer

func (c *Context) AddWindowToDrawDataSelectLayer(window *Window)

func (*Context) AddWindowToSortedBuffer

func (c *Context) AddWindowToSortedBuffer(out_sorted_windows *[]*Window, window *Window)

func (*Context) AlignTextToFramePadding

func (c *Context) AlignTextToFramePadding()

func (*Context) ArrowButton

func (c *Context) ArrowButton(str_id string, dir Dir) bool

func (*Context) Begin

func (c *Context) Begin(name string) bool

func (*Context) BeginChild

func (c *Context) BeginChild(str_id string) bool

func (*Context) BeginChildEx

func (c *Context) BeginChildEx(str_id string, size_arg f64.Vec2, border bool, extra_flags WindowFlags) bool

func (*Context) BeginChildFrame

func (c *Context) BeginChildFrame(id ID, size f64.Vec2, extra_flags WindowFlags) bool

func (*Context) BeginChildID

func (c *Context) BeginChildID(id ID) bool

func (*Context) BeginChildIDEx

func (c *Context) BeginChildIDEx(id ID, size_arg f64.Vec2, border bool, extra_flags WindowFlags) bool

func (*Context) BeginColumns

func (c *Context) BeginColumns(str_id string, columns_count int, flags ColumnsFlags)

func (*Context) BeginCombo

func (c *Context) BeginCombo(label, preview_value string) bool

func (*Context) BeginComboEx

func (c *Context) BeginComboEx(label, preview_value string, flags ComboFlags) bool

func (*Context) BeginDragDropSource

func (c *Context) BeginDragDropSource() bool

func (*Context) BeginDragDropTarget

func (c *Context) BeginDragDropTarget() bool

We don't use BeginDragDropTargetCustom() and duplicate its code because: 1) we use LastItemRectHoveredRect which handles items that pushes a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them. 2) and it's faster. as this code may be very frequently called, we want to early out as fast as we can. Also note how the HoveredWindow test is positioned differently in both functions (in both functions we optimize for the cheapest early out case)

func (*Context) BeginDragDropTargetCustom

func (c *Context) BeginDragDropTargetCustom(bb f64.Rectangle, id ID) bool

func (*Context) BeginEx

func (c *Context) BeginEx(name string, p_open *bool, flags WindowFlags) bool

Push a new ImGui window to add widgets to.

  • A default window called "Debug" is automatically stacked at the beginning of every frame so you can use widgets without explicitly calling a Begin/End pair.
  • Begin/End can be called multiple times during the frame with the same window name to append content.
  • The window name is used as a unique identifier to preserve window information across frames (and save rudimentary information to the .ini file). You can use the "##" or "###" markers to use the same label with different id, or same id with different label. See documentation at the top of this file.
  • Return false when window is collapsed, so you can early out in your code. You always need to call ImGui::End() even if false is returned.
  • Passing 'bool* p_open' displays a Close button on the upper-right corner of the window, the pointed value will be set to false when the button is pressed.

func (*Context) BeginGroup

func (c *Context) BeginGroup()

Lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.)

func (*Context) BeginMainMenuBar

func (c *Context) BeginMainMenuBar() bool

For the main menu bar, which cannot be moved, we honor g.Style.DisplaySafeAreaPadding to ensure text can be visible on a TV set.

func (*Context) BeginMenu

func (c *Context) BeginMenu(label string) bool

func (*Context) BeginMenuBar

func (c *Context) BeginMenuBar() bool

func (*Context) BeginMenuEx

func (c *Context) BeginMenuEx(label string, enabled bool) bool

func (*Context) BeginPopup

func (c *Context) BeginPopup(str_id string) bool

func (*Context) BeginPopupContextItem

func (c *Context) BeginPopupContextItem() bool

func (*Context) BeginPopupContextItemEx

func (c *Context) BeginPopupContextItemEx(str_id string, mouse_button int) bool

This is a helper to handle the simplest case of associating one named popup to one given widget. You may want to handle this on user side if you have specific needs (e.g. tweaking IsItemHovered() parameters). You can pass a NULL str_id to use the identifier of the last item.

func (*Context) BeginPopupContextWindow

func (c *Context) BeginPopupContextWindow() bool

func (*Context) BeginPopupContextWindowEx

func (c *Context) BeginPopupContextWindowEx(str_id string, mouse_button int, also_over_items bool) bool

func (*Context) BeginPopupEx

func (c *Context) BeginPopupEx(id ID, extra_flags WindowFlags) bool

func (*Context) BeginPopupModal

func (c *Context) BeginPopupModal(name string) bool

func (*Context) BeginPopupModalEx

func (c *Context) BeginPopupModalEx(name string, p_open *bool, flags WindowFlags) bool

func (*Context) BeginPopupWindow

func (c *Context) BeginPopupWindow(str_id string, flags WindowFlags) bool

func (*Context) BeginTooltip

func (c *Context) BeginTooltip()

func (*Context) BeginTooltipEx

func (c *Context) BeginTooltipEx(extra_flags WindowFlags, override_previous_tooltip bool)

func (*Context) BringWindowToFront

func (c *Context) BringWindowToFront(window *Window)

func (*Context) Bullet

func (c *Context) Bullet()

func (*Context) BulletText

func (c *Context) BulletText(format string, args ...interface{})

Text with a little bullet aligned to the typical tree node.

func (*Context) Button

func (c *Context) Button(label string) bool

func (*Context) ButtonBehavior

func (c *Context) ButtonBehavior(bb f64.Rectangle, id ID, flags ButtonFlags) (hovered, held, pressed bool)

func (*Context) ButtonEx

func (c *Context) ButtonEx(label string, size_arg f64.Vec2, flags ButtonFlags) bool

func (*Context) CalcItemSize

func (c *Context) CalcItemSize(size f64.Vec2, default_x, default_y float64) f64.Vec2

func (*Context) CalcItemWidth

func (c *Context) CalcItemWidth() float64

func (*Context) CalcListClipping

func (c *Context) CalcListClipping(items_count int, items_height float64) (out_items_display_start int, out_items_display_end int)

Helper to calculate coarse clipping of large list of evenly sized items. NB: Prefer using the ImGuiListClipper higher-level helper if you can! Read comments and instructions there on how those use this sort of pattern. NB: 'items_count' is only used to clamp the result, if you don't know your count you can use INT_MAX

func (*Context) CalcMaxPopupHeightFromItemCount

func (c *Context) CalcMaxPopupHeightFromItemCount(items_count int) float64

func (*Context) CalcNextScrollFromScrollTargetAndClamp

func (c *Context) CalcNextScrollFromScrollTargetAndClamp(window *Window) f64.Vec2

func (*Context) CalcResizePosSizeFromAnyCorner

func (c *Context) CalcResizePosSizeFromAnyCorner(window *Window, corner_target f64.Vec2, corner_norm f64.Vec2) (out_pos, out_size f64.Vec2)

func (*Context) CalcSizeAfterConstraint

func (c *Context) CalcSizeAfterConstraint(window *Window, new_size f64.Vec2) f64.Vec2

func (*Context) CalcSizeAutoFit

func (c *Context) CalcSizeAutoFit(window *Window, size_contents f64.Vec2) f64.Vec2

func (*Context) CalcSizeContents

func (c *Context) CalcSizeContents(window *Window) f64.Vec2

func (*Context) CalcTextSize

func (c *Context) CalcTextSize(text string) f64.Vec2

func (*Context) CalcTextSizeEx

func (c *Context) CalcTextSizeEx(text string, hide_text_after_double_hash bool, wrap_width float64) f64.Vec2

Calculate text size. Text can be multi-line. Optionally ignore text after a ## marker. CalcTextSize("") should return ImVec2(0.0f, GImGui->FontSize)

func (*Context) CalcTypematicPressedRepeatAmount

func (c *Context) CalcTypematicPressedRepeatAmount(t, t_prev, repeat_delay, repeat_rate float64) int

func (*Context) CalcWrapWidthForPos

func (c *Context) CalcWrapWidthForPos(pos f64.Vec2, wrap_pos_x float64) float64

func (*Context) CaptureKeyboardFromApp

func (c *Context) CaptureKeyboardFromApp(capture bool)

func (*Context) CaptureMouseFromApp

func (c *Context) CaptureMouseFromApp(capture bool)

func (*Context) Checkbox

func (c *Context) Checkbox(label string, v *bool) bool

func (*Context) CheckboxFlags

func (c *Context) CheckboxFlags(label string, flags *uint, flags_value uint) bool

func (*Context) ClearActiveID

func (c *Context) ClearActiveID()

func (*Context) ClearDragDrop

func (c *Context) ClearDragDrop()

func (*Context) CloseButton

func (c *Context) CloseButton(id ID, pos f64.Vec2, radius float64) bool

Button to close a window

func (*Context) CloseCurrentPopup

func (c *Context) CloseCurrentPopup()

func (*Context) ClosePopup

func (c *Context) ClosePopup(id ID)

func (*Context) ClosePopupToLevel

func (c *Context) ClosePopupToLevel(remaining int)

func (*Context) ClosePopupsOverWindow

func (c *Context) ClosePopupsOverWindow(ref_window *Window)

func (*Context) CollapsingHeader

func (c *Context) CollapsingHeader(label string) bool

func (*Context) CollapsingHeaderEx

func (c *Context) CollapsingHeaderEx(label string, flags TreeNodeFlags) bool

func (*Context) CollapsingHeaderOpen

func (c *Context) CollapsingHeaderOpen(label string, p_open *bool) bool

func (*Context) CollapsingHeaderOpenEx

func (c *Context) CollapsingHeaderOpenEx(label string, p_open *bool, flags TreeNodeFlags) bool

func (*Context) ColorButton

func (c *Context) ColorButton(desc_id string, col color.RGBA) bool

func (*Context) ColorButtonEx

func (c *Context) ColorButtonEx(desc_id string, col color.RGBA, flags ColorEditFlags, size f64.Vec2) bool

func (*Context) ColorButtonV

func (c *Context) ColorButtonV(desc_id string, colv f64.Vec4) bool

func (*Context) ColorButtonVEx

func (c *Context) ColorButtonVEx(desc_id string, colv f64.Vec4, flags ColorEditFlags, size f64.Vec2) bool

func (*Context) ColorEdit3

func (c *Context) ColorEdit3(label string, col *color.RGBA) bool

func (*Context) ColorEdit3Ex

func (c *Context) ColorEdit3Ex(label string, col *color.RGBA, flags ColorEditFlags) bool

func (*Context) ColorEdit4

func (c *Context) ColorEdit4(label string, col *color.RGBA) bool

func (*Context) ColorEdit4Ex

func (c *Context) ColorEdit4Ex(label string, col *color.RGBA, flags ColorEditFlags) bool

func (*Context) ColorEditOptionsPopup

func (c *Context) ColorEditOptionsPopup(col color.RGBA, flags ColorEditFlags)

func (*Context) ColorEditOptionsPopupV

func (c *Context) ColorEditOptionsPopupV(col f64.Vec4, flags ColorEditFlags)

func (*Context) ColorEditV3

func (c *Context) ColorEditV3(label string, col *f64.Vec4) bool

func (*Context) ColorEditV3Ex

func (c *Context) ColorEditV3Ex(label string, col *f64.Vec4, flags ColorEditFlags) bool

func (*Context) ColorEditV4

func (c *Context) ColorEditV4(label string, col *f64.Vec4) bool

func (*Context) ColorEditV4Ex

func (c *Context) ColorEditV4Ex(label string, col *f64.Vec4, flags ColorEditFlags) bool

Edit colors components (each component in 0.0f..1.0f range). See enum ImGuiColorEditFlags_ for available options. e.g. Only access 3 floats if ImGuiColorEditFlags_NoAlpha flag is set. With typical options: Left-click on colored square to open color picker. Right-click to open option menu. CTRL-Click over input fields to edit them and TAB to go to next item.

func (*Context) ColorPicker3

func (c *Context) ColorPicker3(label string, col *color.RGBA) bool

func (*Context) ColorPicker3Ex

func (c *Context) ColorPicker3Ex(label string, col *color.RGBA, flags ColorEditFlags) bool

func (*Context) ColorPicker4

func (c *Context) ColorPicker4(label string, col *color.RGBA) bool

func (*Context) ColorPicker4Ex

func (c *Context) ColorPicker4Ex(label string, col *color.RGBA, flags ColorEditFlags, ref_col *color.RGBA) bool

func (*Context) ColorPickerOptionsPopup

func (c *Context) ColorPickerOptionsPopup(flags ColorEditFlags, ref_col *color.RGBA)

func (*Context) ColorPickerOptionsPopupV

func (c *Context) ColorPickerOptionsPopupV(flags ColorEditFlags, ref_col *f64.Vec4)

func (*Context) ColorPickerV3

func (c *Context) ColorPickerV3(label string, col *f64.Vec4) bool

func (*Context) ColorPickerV3Ex

func (c *Context) ColorPickerV3Ex(label string, col *f64.Vec4, flags ColorEditFlags) bool

func (*Context) ColorPickerV4

func (c *Context) ColorPickerV4(label string, col *f64.Vec4) bool

func (*Context) ColorPickerV4Ex

func (c *Context) ColorPickerV4Ex(label string, col *f64.Vec4, flags ColorEditFlags, ref_col *f64.Vec4) bool

ColorPicker Note: only access 3 floats if ImGuiColorEditFlags_NoAlpha flag is set. FIXME: we adjust the big color square height based on item width, which may cause a flickering feedback loop (if automatic height makes a vertical scrollbar appears, affecting automatic width..)

func (*Context) ColorTooltip

func (c *Context) ColorTooltip(text string, col color.RGBA, flags ColorEditFlags)

func (*Context) ColorTooltipV

func (c *Context) ColorTooltipV(text string, col f64.Vec4, flags ColorEditFlags)

Note: only access 3 floats if ImGuiColorEditFlags_NoAlpha flag is set.

func (*Context) Columns

func (c *Context) Columns(columns_count int, id string, border bool)

[2018-03: This is currently the only public API, while we are working on making BeginColumns/EndColumns user-facing]

func (*Context) ComboItem

func (c *Context) ComboItem(label string, current_item *int, items_getter func(idx int) (string, bool), item_counts int) bool

func (*Context) ComboItemEx

func (c *Context) ComboItemEx(label string, current_item *int, items_getter func(idx int) (string, bool), items_count int, popup_max_height_in_items int) bool

func (*Context) ComboString

func (c *Context) ComboString(label string, current_item *int, items []string) bool

func (*Context) ComboStringEx

func (c *Context) ComboStringEx(label string, current_item *int, items []string, popup_max_height_in_items int) bool

func (*Context) CreateNewWindow

func (c *Context) CreateNewWindow(name string, size f64.Vec2, flags WindowFlags) *Window

func (*Context) DragBehavior

func (c *Context) DragBehavior(frame_bb f64.Rectangle, id ID, v *float64, v_speed, v_min, v_max float64, format string, power float64) bool

func (*Context) DragFloat

func (c *Context) DragFloat(label string, v *float64) bool

func (*Context) DragFloat2

func (c *Context) DragFloat2(label string, v []float64) bool

func (*Context) DragFloat2Ex

func (c *Context) DragFloat2Ex(label string, v []float64, v_speed, v_min, v_max float64, format string, power float64) bool

func (*Context) DragFloat3

func (c *Context) DragFloat3(label string, v []float64) bool

func (*Context) DragFloat3Ex

func (c *Context) DragFloat3Ex(label string, v []float64, v_speed, v_min, v_max float64, format string, power float64) bool

func (*Context) DragFloat4

func (c *Context) DragFloat4(label string, v []float64) bool

func (*Context) DragFloat4Ex

func (c *Context) DragFloat4Ex(label string, v []float64, v_speed, v_min, v_max float64, format string, power float64) bool

func (*Context) DragFloatEx

func (c *Context) DragFloatEx(label string, v *float64, v_speed, v_min, v_max float64, format string, power float64) bool

func (*Context) DragFloatN

func (c *Context) DragFloatN(label string, v []float64, v_speed, v_min, v_max float64, format string, power float64) bool

func (*Context) DragFloatRange2

func (c *Context) DragFloatRange2(label string, v_current_min, v_current_max *float64) bool

func (*Context) DragFloatRange2Ex

func (c *Context) DragFloatRange2Ex(label string, v_current_min, v_current_max *float64, v_speed, v_min, v_max float64, format, format_max string, power float64) bool

func (*Context) DragInt

func (c *Context) DragInt(label string, v *int) bool

func (*Context) DragInt2

func (c *Context) DragInt2(label string, v []int) bool

func (*Context) DragInt2Ex

func (c *Context) DragInt2Ex(label string, v []int, v_speed float64, v_min, v_max int, format string) bool

func (*Context) DragInt3

func (c *Context) DragInt3(label string, v []int) bool

func (*Context) DragInt3Ex

func (c *Context) DragInt3Ex(label string, v []int, v_speed float64, v_min, v_max int, format string) bool

func (*Context) DragInt4

func (c *Context) DragInt4(label string, v []int) bool

func (*Context) DragInt4Ex

func (c *Context) DragInt4Ex(label string, v []int, v_speed float64, v_min, v_max int, format string) bool

func (*Context) DragIntEx

func (c *Context) DragIntEx(label string, v *int, v_speed float64, v_min, v_max int, format string) bool

NB: v_speed is float to allow adjusting the drag speed with more precision

func (*Context) DragIntN

func (c *Context) DragIntN(label string, v []int, v_speed float64, v_min, v_max int, format string) bool

func (*Context) DragIntRange2

func (c *Context) DragIntRange2(label string, v_current_min, v_current_max *int) bool

func (*Context) DragIntRange2Ex

func (c *Context) DragIntRange2Ex(label string, v_current_min, v_current_max *int, v_speed float64, v_min, v_max int, format, format_max string) bool

func (*Context) DragV2

func (c *Context) DragV2(label string, v *f64.Vec2) bool

func (*Context) DragV2Ex

func (c *Context) DragV2Ex(label string, v *f64.Vec2, v_speed, v_min, v_max float64, format string, power float64) bool

func (*Context) DragV3

func (c *Context) DragV3(label string, v *f64.Vec3) bool

func (*Context) DragV3Ex

func (c *Context) DragV3Ex(label string, v *f64.Vec3, v_speed, v_min, v_max float64, format string, power float64) bool

func (*Context) DragV4

func (c *Context) DragV4(label string, v *f64.Vec4) bool

func (*Context) DragV4Ex

func (c *Context) DragV4Ex(label string, v *f64.Vec4, v_speed, v_min, v_max float64, format string, power float64) bool

func (*Context) Dummy

func (c *Context) Dummy(size f64.Vec2)

func (*Context) End

func (c *Context) End()

func (*Context) EndChild

func (c *Context) EndChild()

func (*Context) EndChildFrame

func (c *Context) EndChildFrame()

func (*Context) EndColumns

func (c *Context) EndColumns()

func (*Context) EndCombo

func (c *Context) EndCombo()

func (*Context) EndDragDropSource

func (c *Context) EndDragDropSource()

func (*Context) EndDragDropTarget

func (c *Context) EndDragDropTarget()

We don't really use/need this now, but added it for the sake of consistency and because we might need it later.

func (*Context) EndFrame

func (c *Context) EndFrame()

This is normally called by Render(). You may want to call it directly if you want to avoid calling Render() but the gain will be very minimal.

func (*Context) EndGroup

func (c *Context) EndGroup()

func (*Context) EndMainMenuBar

func (c *Context) EndMainMenuBar()

func (*Context) EndMenu

func (c *Context) EndMenu()

func (*Context) EndMenuBar

func (c *Context) EndMenuBar()

func (*Context) EndPopup

func (c *Context) EndPopup()

func (*Context) EndTooltip

func (c *Context) EndTooltip()

func (*Context) FindAllowedExtentRectForWindow

func (c *Context) FindAllowedExtentRectForWindow(window *Window) f64.Rectangle

func (*Context) FindBestWindowPosForPopup

func (c *Context) FindBestWindowPosForPopup(window *Window) f64.Vec2

func (*Context) FindBestWindowPosForPopupEx

func (c *Context) FindBestWindowPosForPopupEx(ref_pos, size f64.Vec2, last_dir *Dir, r_outer, r_avoid f64.Rectangle, policy PopupPositionPolicy) f64.Vec2

r_avoid = the rectangle to avoid (e.g. for tooltip it is a rectangle around the mouse cursor which we want to avoid. for popups it's a small point around the cursor.) r_outer = the visible area rectangle, minus safe area padding. If our popup size won't fit because of safe area padding we ignore it.

func (*Context) FindHoveredWindow

func (c *Context) FindHoveredWindow() *Window

Find window given position, search front-to-back FIXME: Note that we have a lag here because WindowRectClipped is updated in Begin() so windows moved by user via SetWindowPos() and not SetNextWindowPos() will have that rectangle lagging by a frame at the time FindHoveredWindow() is called, aka before the next Begin(). Moving window thankfully isn't affected.

func (*Context) FindOrAddColumnsSet

func (c *Context) FindOrAddColumnsSet(window *Window, id ID) *ColumnsSet

func (*Context) FindRenderedTextEnd

func (c *Context) FindRenderedTextEnd(text string) int

func (*Context) FindSettingsHandler

func (c *Context) FindSettingsHandler(typ string) *SettingsHandler

func (*Context) FindWindowByName

func (c *Context) FindWindowByName(name string) *Window

func (*Context) FindWindowIndex

func (c *Context) FindWindowIndex(window *Window) int

FIXME-OPT O(N)

func (*Context) FindWindowNavigable

func (c *Context) FindWindowNavigable(i_start, i_stop, dir int) *Window

FIXME-OPT O(N)

func (*Context) FindWindowSettings

func (c *Context) FindWindowSettings(name string) *WindowSettings

func (*Context) FocusFrontMostActiveWindow

func (c *Context) FocusFrontMostActiveWindow(ignore_window *Window)

func (*Context) FocusWindow

func (c *Context) FocusWindow(window *Window)

Moving window to front of display and set focus (which happens to be back of our sorted list)

func (*Context) FocusableItemRegister

func (c *Context) FocusableItemRegister(window *Window, id ID) bool

func (*Context) FocusableItemRegisterEx

func (c *Context) FocusableItemRegisterEx(window *Window, id ID, tab_stop bool) bool

func (*Context) FocusableItemUnregister

func (c *Context) FocusableItemUnregister(window *Window)

func (*Context) GetBorderRect

func (c *Context) GetBorderRect(window *Window, border_n int, perp_padding, thickness float64) f64.Rectangle

func (*Context) GetClipboardText

func (c *Context) GetClipboardText() string

func (*Context) GetClipboardTextFn_DefaultImpl

func (c *Context) GetClipboardTextFn_DefaultImpl() string

func (*Context) GetColorFromStyle

func (c *Context) GetColorFromStyle(idx Col) color.RGBA

func (*Context) GetColorFromStyleWithAlpha

func (c *Context) GetColorFromStyleWithAlpha(idx Col, alpha_mul float64) color.RGBA

func (*Context) GetColumnIndex

func (c *Context) GetColumnIndex() int

func (*Context) GetColumnOffset

func (c *Context) GetColumnOffset(column_index int) float64

func (*Context) GetColumnWidth

func (c *Context) GetColumnWidth() float64

func (*Context) GetColumnWidthDx

func (c *Context) GetColumnWidthDx(column_index int) float64

func (*Context) GetColumnWidthEx

func (c *Context) GetColumnWidthEx(columns *ColumnsSet, column_index int, before_resize bool) float64

func (*Context) GetColumnsCount

func (c *Context) GetColumnsCount() int

func (*Context) GetColumnsRectHalfWidth

func (c *Context) GetColumnsRectHalfWidth() float64

func (*Context) GetContentRegionAvail

func (c *Context) GetContentRegionAvail() f64.Vec2

func (*Context) GetContentRegionAvailWidth

func (c *Context) GetContentRegionAvailWidth() float64

func (*Context) GetContentRegionMax

func (c *Context) GetContentRegionMax() f64.Vec2

func (*Context) GetCurrentWindow

func (c *Context) GetCurrentWindow() *Window

func (*Context) GetCurrentWindowRead

func (c *Context) GetCurrentWindowRead() *Window

func (*Context) GetCursorPos

func (c *Context) GetCursorPos() f64.Vec2

User generally sees positions in window coordinates. Internally we store CursorPos in absolute screen coordinates because it is more convenient. Conversion happens as we pass the value to user, but it makes our naming convention confusing because GetCursorPos() == (DC.CursorPos - window.Pos). May want to rename 'DC.CursorPos'.

func (*Context) GetCursorPosY

func (c *Context) GetCursorPosY() float64

func (*Context) GetCursorScreenPos

func (c *Context) GetCursorScreenPos() f64.Vec2

func (*Context) GetCursorStartPos

func (c *Context) GetCursorStartPos() f64.Vec2

func (*Context) GetDefaultFont

func (c *Context) GetDefaultFont() *Font

func (*Context) GetDraggedColumnOffset

func (c *Context) GetDraggedColumnOffset(columns *ColumnsSet, column_index int) float64

func (*Context) GetDrawData

func (c *Context) GetDrawData() *DrawData

func (*Context) GetDrawListSharedData

func (c *Context) GetDrawListSharedData() *DrawListSharedData

func (*Context) GetFont

func (c *Context) GetFont() *Font

func (*Context) GetFontSize

func (c *Context) GetFontSize() float64

func (*Context) GetFontTexUvWhitePixel

func (c *Context) GetFontTexUvWhitePixel() f64.Vec2

func (*Context) GetFrameCount

func (c *Context) GetFrameCount() int

func (*Context) GetFrameHeight

func (c *Context) GetFrameHeight() float64

func (*Context) GetFrameHeightWithSpacing

func (c *Context) GetFrameHeightWithSpacing() float64

func (*Context) GetFrontMostPopupModal

func (c *Context) GetFrontMostPopupModal() *Window

func (*Context) GetID

func (c *Context) GetID(id ID) ID

func (*Context) GetIO

func (c *Context) GetIO() *IO

func (*Context) GetItemRectMax

func (c *Context) GetItemRectMax() f64.Vec2

func (*Context) GetItemRectMin

func (c *Context) GetItemRectMin() f64.Vec2

func (*Context) GetItemRectSize

func (c *Context) GetItemRectSize() f64.Vec2

func (*Context) GetKeyPressedAmount

func (c *Context) GetKeyPressedAmount(key_index int, repeat_delay, repeat_rate float64) int

func (*Context) GetMouseCursor

func (c *Context) GetMouseCursor() MouseCursor

func (*Context) GetMouseDragDelta

func (c *Context) GetMouseDragDelta(button int, lock_threshold float64) f64.Vec2

func (*Context) GetMousePos

func (c *Context) GetMousePos() f64.Vec2

func (*Context) GetNavInputAmount

func (c *Context) GetNavInputAmount(n NavInput, mode InputReadMode) float64

func (*Context) GetNavInputAmount2d

func (c *Context) GetNavInputAmount2d(dir_sources NavDirSourceFlags, mode InputReadMode) f64.Vec2

func (*Context) GetNavInputAmount2dEx

func (c *Context) GetNavInputAmount2dEx(dir_sources NavDirSourceFlags, mode InputReadMode, slow_factor, fast_factor float64) f64.Vec2

func (*Context) GetOverlayDrawList

func (c *Context) GetOverlayDrawList() *DrawList

func (*Context) GetScrollMaxX

func (c *Context) GetScrollMaxX() float64

func (*Context) GetScrollMaxY

func (c *Context) GetScrollMaxY() float64

func (*Context) GetScrollX

func (c *Context) GetScrollX() float64

func (*Context) GetScrollY

func (c *Context) GetScrollY() float64

func (*Context) GetStateStorage

func (c *Context) GetStateStorage() map[ID]interface{}

func (*Context) GetStringID

func (c *Context) GetStringID(str_id string) ID

func (*Context) GetStyle

func (c *Context) GetStyle() *Style

func (*Context) GetStyleColorName

func (c *Context) GetStyleColorName(idx Col) string

func (*Context) GetStyleIndex

func (c *Context) GetStyleIndex(style *Style, idx StyleVar) interface{}

func (*Context) GetTextLineHeight

func (c *Context) GetTextLineHeight() float64

func (*Context) GetTextLineHeightWithSpacing

func (c *Context) GetTextLineHeightWithSpacing() float64

func (*Context) GetTime

func (c *Context) GetTime() float64

func (*Context) GetTreeNodeToLabelSpacing

func (c *Context) GetTreeNodeToLabelSpacing() float64

func (*Context) GetVersion

func (c *Context) GetVersion() string

func (*Context) GetViewportRect

func (c *Context) GetViewportRect() f64.Rectangle

func (*Context) GetWindowBgColorIdxFromFlags

func (c *Context) GetWindowBgColorIdxFromFlags(flags WindowFlags) Col

func (*Context) GetWindowContentRegionMax

func (c *Context) GetWindowContentRegionMax() f64.Vec2

func (*Context) GetWindowContentRegionMin

func (c *Context) GetWindowContentRegionMin() f64.Vec2

func (*Context) GetWindowContentRegionWidth

func (c *Context) GetWindowContentRegionWidth() float64

func (*Context) GetWindowDrawList

func (c *Context) GetWindowDrawList() *DrawList

func (*Context) GetWindowHeight

func (c *Context) GetWindowHeight() float64

func (*Context) GetWindowScrollMaxX

func (c *Context) GetWindowScrollMaxX(window *Window) float64

func (*Context) GetWindowScrollMaxY

func (c *Context) GetWindowScrollMaxY(window *Window) float64

func (*Context) GetWindowSize

func (c *Context) GetWindowSize() f64.Vec2

func (*Context) GetWindowWidth

func (c *Context) GetWindowWidth() float64

func (*Context) Image

func (c *Context) Image(user_texture_id TextureID, size, uv0, uv1 f64.Vec2, tint_col, border_col color.RGBA)

func (*Context) ImageButton

func (c *Context) ImageButton(user_texture_id TextureID, size f64.Vec2) bool

func (*Context) ImageButtonEx

func (c *Context) ImageButtonEx(user_texture_id TextureID, size, uv0, uv1 f64.Vec2, frame_padding int, bg_col, tint_col color.RGBA) bool

frame_padding < 0: uses FramePadding from style (default) frame_padding = 0: no framing frame_padding > 0: set framing size The color used are the button colors.

func (*Context) Indent

func (c *Context) Indent()

func (*Context) IndentEx

func (c *Context) IndentEx(indent_w float64)

func (*Context) Init

func (c *Context) Init(shared_font_atlas *FontAtlas)

func (*Context) InputFloat

func (c *Context) InputFloat(label string, v *float64, step float64) bool

func (*Context) InputFloat2

func (c *Context) InputFloat2(label string, v []float64) bool

func (*Context) InputFloat2Ex

func (c *Context) InputFloat2Ex(label string, v []float64, format string, extra_flags InputTextFlags) bool

func (*Context) InputFloat3

func (c *Context) InputFloat3(label string, v []float64) bool

func (*Context) InputFloat3Ex

func (c *Context) InputFloat3Ex(label string, v []float64, format string, extra_flags InputTextFlags) bool

func (*Context) InputFloat4

func (c *Context) InputFloat4(label string, v []float64) bool

func (*Context) InputFloat4Ex

func (c *Context) InputFloat4Ex(label string, v []float64, format string, extra_flags InputTextFlags) bool

func (*Context) InputFloatEx

func (c *Context) InputFloatEx(label string, v *float64, step, step_fast float64, format string, extra_flags InputTextFlags) bool

func (*Context) InputFloatN

func (c *Context) InputFloatN(label string, v []float64) bool

func (*Context) InputFloatNEx

func (c *Context) InputFloatNEx(label string, v []float64, format string, extra_flags InputTextFlags) bool

func (*Context) InputInt

func (c *Context) InputInt(label string, v *int) bool

func (*Context) InputInt2

func (c *Context) InputInt2(label string, v []int) bool

func (*Context) InputInt2Ex

func (c *Context) InputInt2Ex(label string, v []int, extra_flags InputTextFlags) bool

func (*Context) InputInt3

func (c *Context) InputInt3(label string, v []int) bool

func (*Context) InputInt3Ex

func (c *Context) InputInt3Ex(label string, v []int, extra_flags InputTextFlags) bool

func (*Context) InputInt4

func (c *Context) InputInt4(label string, v []int) bool

func (*Context) InputInt4Ex

func (c *Context) InputInt4Ex(label string, v []int, extra_flags InputTextFlags) bool

func (*Context) InputIntEx

func (c *Context) InputIntEx(label string, v *int, step, step_fast int, extra_flags InputTextFlags) bool

func (*Context) InputIntN

func (c *Context) InputIntN(label string, v []int, extra_flags InputTextFlags) bool

func (*Context) InputScalarAsWidgetReplacement

func (c *Context) InputScalarAsWidgetReplacement(bb f64.Rectangle, label string, data interface{}, id ID, format string) bool

Create text input in place of a slider (when CTRL+Clicking on slider) FIXME: Logic is messy and confusing.

func (*Context) InputScalarEx

func (c *Context) InputScalarEx(label string, data, step_ptr, step_fast_ptr interface{}, scalar_format string, extra_flags InputTextFlags) bool

NB: scalar_format here must be a simple "%xx" format string with no prefix/suffix (unlike the Drag/Slider functions "format" argument)

func (*Context) InputText

func (c *Context) InputText(label string, buf []byte) bool

func (*Context) InputTextCalcTextSizeW

func (c *Context) InputTextCalcTextSizeW(text []rune, stop_on_new_line bool) (text_size f64.Vec2, remaining int, out_offset f64.Vec2)

func (*Context) InputTextEx

func (c *Context) InputTextEx(label string, buf []byte, size_arg f64.Vec2, flags InputTextFlags, callback TextEditCallback) bool

Edit a string of text NB: when active, hold on a privately held copy of the text (and apply back to 'buf'). So changing 'buf' while active has no effect. FIXME: Rather messy function partly because we are doing UTF8 > u16 > UTF8 conversions on the go to more easily handle stb_textedit calls. Ideally we should stay in UTF-8 all the time. See https://github.com/nothings/stb/issues/188

func (*Context) InputTextExCallback

func (c *Context) InputTextExCallback(label, buf string, size_arg f64.Vec2, flags InputTextFlags, callback func()) bool

func (*Context) InputTextFilterCharacter

func (c *Context) InputTextFilterCharacter(p_char *rune, flags InputTextFlags, callback TextEditCallback) bool

Return false to discard a character.

func (*Context) InputTextMultiline

func (c *Context) InputTextMultiline(label string, buf []byte, size f64.Vec2, flags InputTextFlags, callback TextEditCallback) bool

func (*Context) InputV2

func (c *Context) InputV2(label string, v *f64.Vec2) bool

func (*Context) InputV2Ex

func (c *Context) InputV2Ex(label string, v *f64.Vec2, format string, extra_flags InputTextFlags) bool

func (*Context) InputV3

func (c *Context) InputV3(label string, v *f64.Vec3) bool

func (*Context) InputV3Ex

func (c *Context) InputV3Ex(label string, v *f64.Vec3, format string, extra_flags InputTextFlags) bool

func (*Context) InputV4

func (c *Context) InputV4(label string, v *f64.Vec4) bool

func (*Context) InputV4Ex

func (c *Context) InputV4Ex(label string, v *f64.Vec4, format string, extra_flags InputTextFlags) bool

func (*Context) InvisibleButton

func (c *Context) InvisibleButton(str_id string, size_arg f64.Vec2) bool

Tip: use ImGui::PushID()/PopID() to push indices or pointers in the ID stack. Then you can keep 'str_id' empty or the same for all your buttons (instead of creating a string based on a non-string id)

func (*Context) IsAnyItemFocused

func (c *Context) IsAnyItemFocused() bool

func (*Context) IsAnyItemHovered

func (c *Context) IsAnyItemHovered() bool

func (*Context) IsClippedEx

func (c *Context) IsClippedEx(bb f64.Rectangle, id ID, clip_even_when_logged bool) bool

func (*Context) IsItemActive

func (c *Context) IsItemActive() bool

func (*Context) IsItemClicked

func (c *Context) IsItemClicked(mouse_button int) bool

func (*Context) IsItemFocused

func (c *Context) IsItemFocused() bool

func (*Context) IsItemHovered

func (c *Context) IsItemHovered() bool

func (*Context) IsItemHoveredEx

func (c *Context) IsItemHoveredEx(flags HoveredFlags) bool

This is roughly matching the behavior of internal-facing ItemHoverable() - we allow hovering to be true when ActiveId==window->MoveID, so that clicking on non-interactive items such as a Text() item still returns true with IsItemHovered() - this should work even for non-interactive items that have no ID, so we cannot use LastItemId

func (*Context) IsItemVisible

func (c *Context) IsItemVisible() bool

func (*Context) IsKeyDown

func (c *Context) IsKeyDown(user_key_index int) bool

Note that imgui doesn't know the semantic of each entry of io.KeysDown[]. Use your own indices/enums according to how your back-end/engine stored them into io.KeysDown[]!

func (*Context) IsKeyPressed

func (c *Context) IsKeyPressed(user_key_index int, repeat bool) bool

func (*Context) IsKeyPressedMap

func (c *Context) IsKeyPressedMap(key Key) bool

func (*Context) IsKeyPressedMapEx

func (c *Context) IsKeyPressedMapEx(key Key, repeat bool) bool

func (*Context) IsKeyReleased

func (c *Context) IsKeyReleased(user_key_index int) bool

func (*Context) IsMouseClicked

func (c *Context) IsMouseClicked(button int, repeat bool) bool

func (*Context) IsMouseDoubleClicked

func (c *Context) IsMouseDoubleClicked(button int) bool

func (*Context) IsMouseDown

func (c *Context) IsMouseDown(button int) bool

func (*Context) IsMouseDragging

func (c *Context) IsMouseDragging() bool

func (*Context) IsMouseDraggingEx

func (c *Context) IsMouseDraggingEx(button int, lock_threshold float64) bool

func (*Context) IsMouseHoveringRect

func (c *Context) IsMouseHoveringRect(r_min, r_max f64.Vec2) bool

func (*Context) IsMouseHoveringRectEx

func (c *Context) IsMouseHoveringRectEx(r_min, r_max f64.Vec2, clip bool) bool

Test if mouse cursor is hovering given rectangle NB- Rectangle is clipped by our current clip setting NB- Expand the rectangle to be generous on imprecise inputs systems (g.Style.TouchExtraPadding)

func (*Context) IsMousePosValid

func (c *Context) IsMousePosValid() bool

func (*Context) IsMousePosValidEx

func (c *Context) IsMousePosValidEx(mouse_pos *f64.Vec2) bool

func (*Context) IsMouseReleased

func (c *Context) IsMouseReleased(button int) bool

func (*Context) IsNavInputDown

func (c *Context) IsNavInputDown(n NavInput) bool

Equivalent of IsKeyDown() for NavInputs[]

func (*Context) IsNavInputPressed

func (c *Context) IsNavInputPressed(n NavInput, mode InputReadMode) bool

func (*Context) IsNavInputPressedAnyOfTwo

func (c *Context) IsNavInputPressedAnyOfTwo(n1, n2 NavInput, mode InputReadMode) bool

func (*Context) IsPopupOpen

func (c *Context) IsPopupOpen(id ID) bool

func (*Context) IsPopupOpenID

func (c *Context) IsPopupOpenID(id ID) bool

func (*Context) IsPopupOpenName

func (c *Context) IsPopupOpenName(str_id string) bool

func (*Context) IsRectVisible

func (c *Context) IsRectVisible(rect_min, rect_max f64.Vec2) bool

func (*Context) IsWindowChildOf

func (c *Context) IsWindowChildOf(window, potential_parent *Window) bool

func (*Context) IsWindowContentHoverable

func (c *Context) IsWindowContentHoverable(window *Window, flags HoveredFlags) bool

func (*Context) IsWindowFocused

func (c *Context) IsWindowFocused() bool

func (*Context) IsWindowFocusedEx

func (c *Context) IsWindowFocusedEx(flags FocusedFlags) bool

func (*Context) IsWindowHovered

func (c *Context) IsWindowHovered() bool

func (*Context) IsWindowHoveredEx

func (c *Context) IsWindowHoveredEx(flags HoveredFlags) bool

func (*Context) IsWindowNavFocusable

func (c *Context) IsWindowNavFocusable(window *Window) bool

func (*Context) ItemAdd

func (c *Context) ItemAdd(bb f64.Rectangle, id ID) bool

func (*Context) ItemAddEx

func (c *Context) ItemAddEx(bb f64.Rectangle, id ID, nav_bb_arg *f64.Rectangle) bool

Declare item bounding box for clipping and interaction. Note that the size can be different than the one provided to ItemSize(). Typically, widgets that spread over available surface declare their minimum size requirement to ItemSize() and then use a larger region for drawing/interaction, which is passed to ItemAdd().

func (*Context) ItemHoverable

func (c *Context) ItemHoverable(bb f64.Rectangle, id ID) bool

func (*Context) ItemSize

func (c *Context) ItemSize(size f64.Vec2)

func (*Context) ItemSizeBB

func (c *Context) ItemSizeBB(bb f64.Rectangle)

func (*Context) ItemSizeBBEx

func (c *Context) ItemSizeBBEx(bb f64.Rectangle, text_offset_y float64)

func (*Context) ItemSizeEx

func (c *Context) ItemSizeEx(size f64.Vec2, text_offset_y float64)

func (*Context) KeepAliveID

func (c *Context) KeepAliveID(id ID)

func (*Context) LabelText

func (c *Context) LabelText(label, format string, args ...interface{})

Add a label+text combo aligned to other label+value widgets

func (*Context) ListBox

func (c *Context) ListBox(label string, current_item *int, items []string) bool

func (*Context) ListBoxEx

func (c *Context) ListBoxEx(label string, current_item *int, items []string, height_in_items int) bool

func (*Context) ListBoxFooter

func (c *Context) ListBoxFooter()

func (*Context) ListBoxHeader

func (c *Context) ListBoxHeader(label string, size_arg f64.Vec2) bool

Helper to calculate the size of a listbox and display a label on the right. Tip: To have a list filling the entire window width, PushItemWidth(-1) and pass an empty label "##empty"

func (*Context) ListBoxHeaderItems

func (c *Context) ListBoxHeaderItems(label string, items_count, height_in_items int) bool

func (*Context) ListBoxItems

func (c *Context) ListBoxItems(label string, current_item *int, items_getter func(idx int) (string, bool), items_count int, height_in_items int) bool

func (*Context) LoadIniSettingsFromDisk

func (c *Context) LoadIniSettingsFromDisk(filename string) error

func (*Context) LoadIniSettingsFromMemory

func (c *Context) LoadIniSettingsFromMemory(buf []byte) error

Zero-tolerance, no error reporting, cheap .ini parsing

func (*Context) LogButtons

func (c *Context) LogButtons()

Helper to display logging buttons

func (*Context) LogFinish

func (c *Context) LogFinish()

func (*Context) LogRenderedText

func (c *Context) LogRenderedText(ref_pos *f64.Vec2, text string)

Internal version that takes a position to decide on newline placement and pad items according to their depth. We split text into individual lines to add current tree level padding

func (*Context) LogText

func (c *Context) LogText(format string, args ...interface{})

Pass text data straight to log (without being displayed)

func (*Context) LogToClipboard

func (c *Context) LogToClipboard()

func (*Context) LogToClipboardEx

func (c *Context) LogToClipboardEx(max_depth int)

Start logging ImGui output to clipboard

func (*Context) LogToFile

func (c *Context) LogToFile(max_depth int, filename string)

Start logging ImGui output to given file

func (*Context) LogToTTY

func (c *Context) LogToTTY()

func (*Context) LogToTTYEx

func (c *Context) LogToTTYEx(max_depth int)

func (*Context) MarkIniSettingsDirty

func (c *Context) MarkIniSettingsDirty()

func (*Context) MarkIniSettingsDirtyForWindow

func (c *Context) MarkIniSettingsDirtyForWindow(window *Window)

func (*Context) MenuItem

func (c *Context) MenuItem(label string) bool

func (*Context) MenuItemEx

func (c *Context) MenuItemEx(label, shortcut string, selected, enabled bool) bool

func (*Context) MenuItemSelect

func (c *Context) MenuItemSelect(label, shortcut string, p_selected *bool) bool

func (*Context) MenuItemSelectEx

func (c *Context) MenuItemSelectEx(label, shortcut string, p_selected *bool, enable bool) bool

func (*Context) NavCalcPreferredRefPos

func (c *Context) NavCalcPreferredRefPos() f64.Vec2

func (*Context) NavInitWindow

func (c *Context) NavInitWindow(window *Window, force_reinit bool)

func (*Context) NavMoveRequestButNoResultYet

func (c *Context) NavMoveRequestButNoResultYet() bool

func (*Context) NavMoveRequestCancel

func (c *Context) NavMoveRequestCancel()

func (*Context) NavProcessItem

func (c *Context) NavProcessItem(window *Window, nav_bb f64.Rectangle, id ID)

We get there when either NavId == id, or when g.NavAnyRequest is set (which is updated by NavUpdateAnyRequestFlag above)

func (*Context) NavProcessMoveRequestWrapAround

func (c *Context) NavProcessMoveRequestWrapAround(window *Window)

func (*Context) NavRestoreLastChildNavWindow

func (c *Context) NavRestoreLastChildNavWindow(window *Window) *Window

Call when we are expected to land on Layer 0 after FocusWindow()

func (*Context) NavRestoreLayer

func (c *Context) NavRestoreLayer(layer int)

func (*Context) NavSaveLastChildNavWindow

func (c *Context) NavSaveLastChildNavWindow(child_window *Window)

func (*Context) NavScoreItem

func (c *Context) NavScoreItem(result *NavMoveResult, cand f64.Rectangle) bool

Scoring function for directional navigation. Based on https://gist.github.com/rygorous/6981057

func (*Context) NavScoreItemDistInterval

func (c *Context) NavScoreItemDistInterval(a0, a1, b0, b1 float64) float64

func (*Context) NavScoreItemGetQuadrant

func (c *Context) NavScoreItemGetQuadrant(dx, dy float64) Dir

func (*Context) NavScrollToBringItemIntoView

func (c *Context) NavScrollToBringItemIntoView(window *Window, item_rect_rel f64.Rectangle)

NB: We modify rect_rel by the amount we scrolled for, so it is immediately updated.

func (*Context) NavUpdate

func (c *Context) NavUpdate()

func (*Context) NavUpdateAnyRequestFlag

func (c *Context) NavUpdateAnyRequestFlag()

func (*Context) NavUpdateWindowing

func (c *Context) NavUpdateWindowing()

Window management mode (hold to: change focus/move/resize, tap to: toggle menu layer)

func (*Context) NavUpdateWindowingHighlightWindow

func (c *Context) NavUpdateWindowingHighlightWindow(focus_change_dir int)

func (*Context) NewFrame

func (c *Context) NewFrame()

func (*Context) NewFrameUpdateHoveredWindowAndCaptureFlags

func (c *Context) NewFrameUpdateHoveredWindowAndCaptureFlags()

func (*Context) NewLine

func (c *Context) NewLine()

func (*Context) NextColumn

func (c *Context) NextColumn()

func (*Context) OffsetNormToPixels

func (c *Context) OffsetNormToPixels(columns *ColumnsSet, offset_norm float64) float64

func (*Context) OpenPopup

func (c *Context) OpenPopup(str_id string)

func (*Context) OpenPopupEx

func (c *Context) OpenPopupEx(id ID)

Mark popup as open (toggle toward open state). Popups are closed when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level). One open popup per level of the popup hierarchy (NB: when assigning we reset the Window member of ImGuiPopupRef to NULL)

func (*Context) OpenPopupOnItemClick

func (c *Context) OpenPopupOnItemClick(str_id string, mouse_button int) bool

func (*Context) PixelsToOffsetNorm

func (c *Context) PixelsToOffsetNorm(columns *ColumnsSet, offset float64) float64

func (*Context) PlotEx

func (c *Context) PlotEx(plot_type PlotType, label string, values_getter func(idx int) float64, values_count, values_offset int, overlay_text string, scale_min, scale_max float64, graph_size f64.Vec2)

func (*Context) PlotHistogram

func (c *Context) PlotHistogram(label string, values []float64)

func (*Context) PlotHistogramEx

func (c *Context) PlotHistogramEx(label string, values []float64, values_offset int, overlay_text string, scale_min, scale_max float64, graph_size f64.Vec2)

func (*Context) PlotHistogramItem

func (c *Context) PlotHistogramItem(label string, values_getter func(idx int) float64, values_count int)

func (*Context) PlotHistogramItemEx

func (c *Context) PlotHistogramItemEx(label string, values_getter func(idx int) float64, values_count, values_offset int, overlay_text string, scale_min, scale_max float64, graph_size f64.Vec2)

func (*Context) PlotLines

func (c *Context) PlotLines(label string, values []float64)

func (*Context) PlotLinesEx

func (c *Context) PlotLinesEx(label string, values []float64, values_offset int, overlay_text string, scale_min, scale_max float64, graph_size f64.Vec2)

func (*Context) PlotLinesItem

func (c *Context) PlotLinesItem(label string, values_getter func(idx int) float64, values_count int)

func (*Context) PlotLinesItemEx

func (c *Context) PlotLinesItemEx(label string, values_getter func(idx int) float64, values_count, values_offset int, overlay_text string, scale_min, scale_max float64, graph_size f64.Vec2)

func (*Context) PopAllowKeyboardFocus

func (c *Context) PopAllowKeyboardFocus()

func (*Context) PopButtonRepeat

func (c *Context) PopButtonRepeat()

func (*Context) PopClipRect

func (c *Context) PopClipRect()

func (*Context) PopFont

func (c *Context) PopFont()

func (*Context) PopID

func (c *Context) PopID()

func (*Context) PopItemFlag

func (c *Context) PopItemFlag()

func (*Context) PopItemWidth

func (c *Context) PopItemWidth()

func (*Context) PopStyleColor

func (c *Context) PopStyleColor()

func (*Context) PopStyleColorN

func (c *Context) PopStyleColorN(count int)

func (*Context) PopStyleVar

func (c *Context) PopStyleVar()

func (*Context) PopStyleVarN

func (c *Context) PopStyleVarN(count int)

func (*Context) PopTextWrapPos

func (c *Context) PopTextWrapPos()

func (*Context) ProgressBar

func (c *Context) ProgressBar(fraction float64)

func (*Context) ProgressBarEx

func (c *Context) ProgressBarEx(fraction float64, size_arg f64.Vec2, overlay string)

size_arg (for each axis) < 0.0f: align to end, 0.0f: auto, > 0.0f: specified size

func (*Context) PushAllowKeyboardFocus

func (c *Context) PushAllowKeyboardFocus(allow_keyboard_focus bool)

func (*Context) PushButtonRepeat

func (c *Context) PushButtonRepeat(repeat bool)

func (*Context) PushClipRect

func (c *Context) PushClipRect(clip_rect_min, clip_rect_max f64.Vec2, intersect_with_current_clip_rect bool)

When using this function it is sane to ensure that float are perfectly rounded to integer values, to that e.g. (int)(max.x-min.x) in user's render produce correct result.

func (*Context) PushColumnClipRect

func (c *Context) PushColumnClipRect()

func (*Context) PushColumnClipRectEx

func (c *Context) PushColumnClipRectEx(column_index int)

func (*Context) PushFont

func (c *Context) PushFont(font *Font)

func (*Context) PushID

func (c *Context) PushID(id ID)

func (*Context) PushItemFlag

func (c *Context) PushItemFlag(option ItemFlags, enabled bool)

func (*Context) PushItemWidth

func (c *Context) PushItemWidth(item_width float64)

func (*Context) PushMultiItemsWidths

func (c *Context) PushMultiItemsWidths(components int)

func (*Context) PushMultiItemsWidthsEx

func (c *Context) PushMultiItemsWidthsEx(components int, w_full float64)

func (*Context) PushStringID

func (c *Context) PushStringID(str_id string)

func (*Context) PushStyleColor

func (c *Context) PushStyleColor(idx Col, col color.RGBA)

func (*Context) PushStyleColorV4

func (c *Context) PushStyleColorV4(idx Col, col f64.Vec4)

func (*Context) PushStyleVar

func (c *Context) PushStyleVar(idx StyleVar, val interface{})

func (*Context) PushTextWrapPos

func (c *Context) PushTextWrapPos(wrap_pos_x float64)

func (*Context) RadioButton

func (c *Context) RadioButton(label string, active bool) bool

func (*Context) RadioButtonEx

func (c *Context) RadioButtonEx(label string, v *int, v_button int) bool

func (*Context) Render

func (c *Context) Render()

func (*Context) RenderArrow

func (c *Context) RenderArrow(p_min f64.Vec2, dir Dir)

func (*Context) RenderArrowEx

func (c *Context) RenderArrowEx(p_min f64.Vec2, dir Dir, scale float64)

func (*Context) RenderArrowToList

func (c *Context) RenderArrowToList(draw_list *DrawList, pos, half_sz f64.Vec2, direction Dir, col color.RGBA)

'pos' is position of the arrow tip. half_sz.x is length from base to tip. half_sz.y is length on each side.

func (*Context) RenderArrowsForVerticalBar

func (c *Context) RenderArrowsForVerticalBar(draw_list *DrawList, pos, half_sz f64.Vec2, bar_w float64)

func (*Context) RenderBullet

func (c *Context) RenderBullet(pos f64.Vec2)

func (*Context) RenderCheckMark

func (c *Context) RenderCheckMark(pos f64.Vec2, col color.RGBA, sz float64)

func (*Context) RenderColorRectWithAlphaCheckerboard

func (c *Context) RenderColorRectWithAlphaCheckerboard(p_min, p_max f64.Vec2, fill_col color.RGBA, grid_step float64, grid_off f64.Vec2)

func (*Context) RenderColorRectWithAlphaCheckerboardDx

func (c *Context) RenderColorRectWithAlphaCheckerboardDx(p_min, p_max f64.Vec2, fill_col color.RGBA, grid_step float64, grid_off f64.Vec2, rounding float64)

func (*Context) RenderColorRectWithAlphaCheckerboardEx

func (c *Context) RenderColorRectWithAlphaCheckerboardEx(p_min, p_max f64.Vec2, col color.RGBA, grid_step float64, grid_off f64.Vec2, rounding float64, rounding_corners_flags DrawCornerFlags)

NB: This is rather brittle and will show artifact when rounding this enabled if rounded corners overlap multiple cells. Caller currently responsible for avoiding that. I spent a non reasonable amount of time trying to getting this right for ColorButton with rounding+anti-aliasing+ImGuiColorEditFlags_HalfAlphaPreview flag + various grid sizes and offsets, and eventually gave up... probably more reasonable to disable rounding alltogether.

func (*Context) RenderFrame

func (c *Context) RenderFrame(p_min, p_max f64.Vec2, col color.RGBA)

Render a rectangle shaped with optional rounding and borders

func (*Context) RenderFrameBorder

func (c *Context) RenderFrameBorder(p_min, p_max f64.Vec2, rounding float64)

func (*Context) RenderFrameEx

func (c *Context) RenderFrameEx(p_min, p_max f64.Vec2, fill_col color.RGBA, border bool, rounding float64)

func (*Context) RenderNavHighlight

func (c *Context) RenderNavHighlight(bb f64.Rectangle, id ID)

func (*Context) RenderNavHighlightEx

func (c *Context) RenderNavHighlightEx(bb f64.Rectangle, id ID, flags NavHighlightFlags)

func (*Context) RenderRectFilledRangeH

func (c *Context) RenderRectFilledRangeH(draw_list *DrawList, rect f64.Rectangle, col color.RGBA, x_start_norm, x_end_norm, rounding float64)

FIXME: Cleanup and move code to ImDrawList.

func (*Context) RenderText

func (c *Context) RenderText(pos f64.Vec2, text string)

func (*Context) RenderTextClipped

func (c *Context) RenderTextClipped(pos_min, pos_max f64.Vec2, text string, text_size_if_known *f64.Vec2)

func (*Context) RenderTextClippedEx

func (c *Context) RenderTextClippedEx(pos_min, pos_max f64.Vec2, text string, text_size_if_known *f64.Vec2, align f64.Vec2, clip_rect *f64.Rectangle)

func (*Context) RenderTextEx

func (c *Context) RenderTextEx(pos f64.Vec2, text string, hide_text_after_hash bool)

Internal ImGui functions to render text RenderText***() functions calls ImDrawList::AddText() calls ImBitmapFont::RenderText()

func (*Context) RenderTextWrapped

func (c *Context) RenderTextWrapped(pos f64.Vec2, text string, wrap_width float64)

func (*Context) ResetMouseDragDelta

func (c *Context) ResetMouseDragDelta(button int)

func (*Context) SameLine

func (c *Context) SameLine()

func (*Context) SameLineEx

func (c *Context) SameLineEx(pos_x, spacing_w float64)

Gets back to previous line and continue with horizontal layout

pos_x == 0      : follow right after previous item
pos_x != 0      : align to specified x position (relative to window/group left)
spacing_w < 0   : use default spacing if pos_x == 0, no spacing if pos_x != 0
spacing_w >= 0  : enforce spacing amount

func (*Context) SaveIniSettingsToDisk

func (c *Context) SaveIniSettingsToDisk(ini_filename string) error

func (*Context) SaveIniSettingsToMemory

func (c *Context) SaveIniSettingsToMemory() []byte

func (*Context) Scrollbar

func (c *Context) Scrollbar(direction LayoutType)

Vertical scrollbar The entire piece of code below is rather confusing because: - We handle absolute seeking (when first clicking outside the grab) and relative manipulation (afterward or when clicking inside the grab) - We store values as normalized ratio and in a form that allows the window content to change while we are holding on a scrollbar - We handle both horizontal and vertical scrollbars, which makes the terminology not ideal.

func (*Context) Selectable

func (c *Context) Selectable(label string) bool

func (*Context) SelectableEx

func (c *Context) SelectableEx(label string, selected bool, flags SelectableFlags, size_arg f64.Vec2) bool

Tip: pass an empty label (e.g. "##dummy") then you can use the space to draw other text or image. But you need to make sure the ID is unique, e.g. enclose calls in PushID/PopID.

func (*Context) SelectableOpen

func (c *Context) SelectableOpen(label string, p_selected *bool) bool

func (*Context) SelectableOpenEx

func (c *Context) SelectableOpenEx(label string, p_selected *bool, flags SelectableFlags, size f64.Vec2) bool

func (*Context) Separator

func (c *Context) Separator()

Horizontal separating line.

func (*Context) SetActiveID

func (c *Context) SetActiveID(id ID, window *Window)

func (*Context) SetClipboardText

func (c *Context) SetClipboardText(text string)

func (*Context) SetClipboardTextFn_DefaultImpl

func (c *Context) SetClipboardTextFn_DefaultImpl(text string)

func (*Context) SetColorEditOptions

func (c *Context) SetColorEditOptions(flags ColorEditFlags)

func (*Context) SetColumnOffset

func (c *Context) SetColumnOffset(column_index int, offset float64)

func (*Context) SetCurrentFont

func (c *Context) SetCurrentFont(font *Font)

func (*Context) SetCurrentWindow

func (c *Context) SetCurrentWindow(window *Window)

func (*Context) SetCurrentWindowPos

func (c *Context) SetCurrentWindowPos(pos f64.Vec2, cond Cond)

func (*Context) SetCurrentWindowSize

func (c *Context) SetCurrentWindowSize(size f64.Vec2, cond Cond)

func (*Context) SetCursorPosY

func (c *Context) SetCursorPosY(y float64)

func (*Context) SetCursorPosYAndSetupDummyPrevLine

func (c *Context) SetCursorPosYAndSetupDummyPrevLine(pos_y, line_height float64)

func (*Context) SetCursorScreenPos

func (c *Context) SetCursorScreenPos(screen_pos f64.Vec2)

func (*Context) SetDragDropPayload

func (c *Context) SetDragDropPayload(a interface{})

func (*Context) SetFocusID

func (c *Context) SetFocusID(id ID, window *Window)

func (*Context) SetHoveredID

func (c *Context) SetHoveredID(id ID)

func (*Context) SetItemAllowOverlap

func (c *Context) SetItemAllowOverlap()

Allow last item to be overlapped by a subsequent item. Both may be activated during the same frame before the later one takes priority.

func (*Context) SetItemDefaultFocus

func (c *Context) SetItemDefaultFocus()

func (*Context) SetKeyboardFocusHere

func (c *Context) SetKeyboardFocusHere()

func (*Context) SetKeyboardFocusHereEx

func (c *Context) SetKeyboardFocusHereEx(offset int)

func (*Context) SetMouseCursor

func (c *Context) SetMouseCursor(cursor_type MouseCursor)

func (*Context) SetNavID

func (c *Context) SetNavID(id ID, nav_layer int)

func (*Context) SetNavIDAndMoveMouse

func (c *Context) SetNavIDAndMoveMouse(id ID, nav_layer int, rect_rel f64.Rectangle)

func (*Context) SetNavIDWithRectRel

func (c *Context) SetNavIDWithRectRel(id ID, nav_layer int, rect_rel f64.Rectangle)

func (*Context) SetNextWindowBgAlpha

func (c *Context) SetNextWindowBgAlpha(alpha float64)

func (*Context) SetNextWindowContentSize

func (c *Context) SetNextWindowContentSize(size f64.Vec2)

func (*Context) SetNextWindowPos

func (c *Context) SetNextWindowPos(pos f64.Vec2, cond Cond, pivot f64.Vec2)

func (*Context) SetNextWindowSize

func (c *Context) SetNextWindowSize(size f64.Vec2, cond Cond)

func (*Context) SetNextWindowSizeConstraints

func (c *Context) SetNextWindowSizeConstraints(size_min, size_max f64.Vec2, custom_callback func(*SizeCallbackData))

func (*Context) SetScrollFromPosY

func (c *Context) SetScrollFromPosY(pos_y, center_y_ratio float64)

func (*Context) SetScrollHere

func (c *Context) SetScrollHere()

func (*Context) SetScrollHereEx

func (c *Context) SetScrollHereEx(center_y_ratio float64)

center_y_ratio: 0.0f top of last item, 0.5f vertical center of last item, 1.0f bottom of last item.

func (*Context) SetScrollX

func (c *Context) SetScrollX(scroll_x float64)

func (*Context) SetScrollY

func (c *Context) SetScrollY(scroll_y float64)

func (*Context) SetStateStorage

func (c *Context) SetStateStorage(tree map[ID]interface{})

func (*Context) SetTooltip

func (c *Context) SetTooltip(format string, args ...interface{})

func (*Context) SetWindowCollapsed

func (c *Context) SetWindowCollapsed(window *Window, collapsed bool, cond Cond)

func (*Context) SetWindowConditionAllowFlags

func (c *Context) SetWindowConditionAllowFlags(window *Window, flags Cond, enabled bool)

func (*Context) SetWindowFocus

func (c *Context) SetWindowFocus()

func (*Context) SetWindowFontScale

func (c *Context) SetWindowFontScale(scale float64)

func (*Context) SetWindowPos

func (c *Context) SetWindowPos(window *Window, pos f64.Vec2, cond Cond)

func (*Context) SetWindowPosByName

func (c *Context) SetWindowPosByName(name string, pos f64.Vec2, cond Cond)

func (*Context) SetWindowScrollX

func (c *Context) SetWindowScrollX(window *Window, new_scroll_x float64)

func (*Context) SetWindowScrollY

func (c *Context) SetWindowScrollY(window *Window, new_scroll_y float64)

func (*Context) SetWindowSize

func (c *Context) SetWindowSize(window *Window, size f64.Vec2, cond Cond)

func (*Context) SetWindowSizeByName

func (c *Context) SetWindowSizeByName(name string, size f64.Vec2, cond Cond)

func (*Context) SettingsHandlerWindow_ReadLine

func (c *Context) SettingsHandlerWindow_ReadLine(_ *Context, _ *SettingsHandler, entry interface{}, line string)

func (*Context) SettingsHandlerWindow_ReadOpen

func (c *Context) SettingsHandlerWindow_ReadOpen(_ *Context, _ *SettingsHandler, name string) interface{}

func (*Context) SettingsHandlerWindow_WriteAll

func (c *Context) SettingsHandlerWindow_WriteAll(ctx *Context, handler *SettingsHandler, w io.Writer)

func (*Context) SetupDrawData

func (c *Context) SetupDrawData(draw_lists []*DrawList, out_draw_data *DrawData)

func (*Context) ShadeVertsLinearColorGradientKeepAlpha

func (c *Context) ShadeVertsLinearColorGradientKeepAlpha(vtx []DrawVert, vert_start, vert_end int, gradient_p0, gradient_p1 f64.Vec2, col0, col1 color.RGBA)

Generic linear color gradient, write to RGB fields, leave A untouched.

func (*Context) SliderAngle

func (c *Context) SliderAngle(label string, v_rad *float64) bool

func (*Context) SliderAngleEx

func (c *Context) SliderAngleEx(label string, v_rad *float64, v_degrees_min, v_degrees_max float64) bool

func (*Context) SliderBehavior

func (c *Context) SliderBehavior(frame_bb f64.Rectangle, id ID, v *float64, v_min, v_max, power float64, format string, flags SliderFlags) bool

func (*Context) SliderBehaviorCalcRatioFromValue

func (c *Context) SliderBehaviorCalcRatioFromValue(v, v_min, v_max, power, linear_zero_pos float64) float64

func (*Context) SliderFloat

func (c *Context) SliderFloat(label string, v *float64, v_min, v_max float64) bool

func (*Context) SliderFloat2

func (c *Context) SliderFloat2(label string, v []float64, v_min, v_max float64) bool

func (*Context) SliderFloat2Ex

func (c *Context) SliderFloat2Ex(label string, v []float64, v_min, v_max float64, format string, power float64) bool

func (*Context) SliderFloat3

func (c *Context) SliderFloat3(label string, v []float64, v_min, v_max float64) bool

func (*Context) SliderFloat3Ex

func (c *Context) SliderFloat3Ex(label string, v []float64, v_min, v_max float64, format string, power float64) bool

func (*Context) SliderFloat4

func (c *Context) SliderFloat4(label string, v []float64, v_min, v_max float64) bool

func (*Context) SliderFloat4Ex

func (c *Context) SliderFloat4Ex(label string, v []float64, v_min, v_max float64, format string, power float64) bool

func (*Context) SliderFloatEx

func (c *Context) SliderFloatEx(label string, v *float64, v_min, v_max float64, format string, power float64) bool

Use power!=1.0 for logarithmic sliders. Adjust format to decorate the value with a prefix or a suffix.

"%.3f"         1.234
"%5.2f secs"   01.23 secs
"Gold: %.0f"   Gold: 1

func (*Context) SliderFloatN

func (c *Context) SliderFloatN(label string, v []float64, v_min, v_max float64, format string, power float64) bool

Add multiple sliders on 1 line for compact edition of multiple components

func (*Context) SliderInt

func (c *Context) SliderInt(label string, v *int, v_min, v_max int) bool

func (*Context) SliderInt2

func (c *Context) SliderInt2(label string, v []int, v_min, v_max int) bool

func (*Context) SliderInt2Ex

func (c *Context) SliderInt2Ex(label string, v []int, v_min, v_max int, format string) bool

func (*Context) SliderInt3

func (c *Context) SliderInt3(label string, v []int, v_min, v_max int) bool

func (*Context) SliderInt3Ex

func (c *Context) SliderInt3Ex(label string, v []int, v_min, v_max int, format string) bool

func (*Context) SliderInt4

func (c *Context) SliderInt4(label string, v []int, v_min, v_max int) bool

func (*Context) SliderInt4Ex

func (c *Context) SliderInt4Ex(label string, v []int, v_min, v_max int, format string) bool

func (*Context) SliderIntEx

func (c *Context) SliderIntEx(label string, v *int, v_min, v_max int, format string) bool

func (*Context) SliderIntN

func (c *Context) SliderIntN(label string, v []int, v_min, v_max int, format string) bool

func (*Context) SliderV2

func (c *Context) SliderV2(label string, v *f64.Vec2, v_min, v_max float64) bool

func (*Context) SliderV2Ex

func (c *Context) SliderV2Ex(label string, v *f64.Vec2, v_min, v_max float64, format string, power float64) bool

func (*Context) SliderV3

func (c *Context) SliderV3(label string, v *f64.Vec3, v_min, v_max float64) bool

func (*Context) SliderV3Ex

func (c *Context) SliderV3Ex(label string, v *f64.Vec3, v_min, v_max float64, format string, power float64) bool

func (*Context) SliderV4

func (c *Context) SliderV4(label string, v *f64.Vec4, v_min, v_max float64) bool

func (*Context) SliderV4Ex

func (c *Context) SliderV4Ex(label string, v *f64.Vec4, v_min, v_max float64, format string, power float64) bool

func (*Context) SmallButton

func (c *Context) SmallButton(label string) bool

func (*Context) Spacing

func (c *Context) Spacing()

func (*Context) StyleColorsClassic

func (c *Context) StyleColorsClassic(style *Style)

func (*Context) StyleColorsDark

func (c *Context) StyleColorsDark(style *Style)

func (*Context) StyleColorsLight

func (c *Context) StyleColorsLight(style *Style)

Those light colors are better suited with a thicker font than the default one + FrameBorder

func (*Context) Text

func (c *Context) Text(format string, args ...interface{})

func (*Context) TextColored

func (c *Context) TextColored(col color.RGBA, format string, args ...interface{})

func (*Context) TextDisabled

func (c *Context) TextDisabled(format string, args ...interface{})

func (*Context) TextUnformatted

func (c *Context) TextUnformatted(text string)

func (*Context) TextWrapped

func (c *Context) TextWrapped(format string, args ...interface{})

func (*Context) TreeNode

func (c *Context) TreeNode(label string) bool

func (*Context) TreeNodeBehavior

func (c *Context) TreeNodeBehavior(id ID, flags TreeNodeFlags, label string) bool

func (*Context) TreeNodeBehaviorIsOpen

func (c *Context) TreeNodeBehaviorIsOpen(id ID, flags TreeNodeFlags) bool

func (*Context) TreeNodeID

func (c *Context) TreeNodeID(id ID, format string, args ...interface{}) bool

func (*Context) TreeNodeIDEx

func (c *Context) TreeNodeIDEx(id ID, flags TreeNodeFlags, format string, args ...interface{}) bool

func (*Context) TreeNodeStringID

func (c *Context) TreeNodeStringID(str_id string, format string, args ...interface{}) bool

func (*Context) TreeNodeStringIDEx

func (c *Context) TreeNodeStringIDEx(str_id string, flags TreeNodeFlags, format string, args ...interface{}) bool

func (*Context) TreePop

func (c *Context) TreePop()

func (*Context) TreePush

func (c *Context) TreePush(str_id string)

func (*Context) TreePushRawID

func (c *Context) TreePushRawID(id ID)

func (*Context) Unindent

func (c *Context) Unindent()

func (*Context) UnindentEx

func (c *Context) UnindentEx(indent_w float64)

func (*Context) UpdateManualResize

func (c *Context) UpdateManualResize(window *Window, size_auto_fit f64.Vec2, border_held *int, resize_grip_col []color.RGBA)

Handle resize for: Resize Grips, Borders, Gamepad

func (*Context) UpdateMouseInputs

func (c *Context) UpdateMouseInputs()

func (*Context) UpdateMovingWindow

func (c *Context) UpdateMovingWindow()

func (*Context) VSliderFloat

func (c *Context) VSliderFloat(label string, size f64.Vec2, v *float64, v_min, v_max float64) bool

func (*Context) VSliderFloatEx

func (c *Context) VSliderFloatEx(label string, size f64.Vec2, v *float64, v_min, v_max float64, format string, power float64) bool

func (*Context) VSliderInt

func (c *Context) VSliderInt(label string, size f64.Vec2, v *int, v_min, v_max int) bool

func (*Context) VSliderIntEx

func (c *Context) VSliderIntEx(label string, size f64.Vec2, v *int, v_min, v_max int, format string) bool

func (*Context) VerticalSeparator

func (c *Context) VerticalSeparator()

type CustomRect

type CustomRect struct {
	ID            uint     // Input    // User ID. Use <0x10000 to map into a font glyph, >=0x10000 for other/internal/custom texture data.
	Width, Height uint     // Input    // Desired rectangle dimension
	X, Y          uint     // Output   // Packed position in Atlas
	GlyphAdvanceX float64  // Input    // For custom font glyphs only (ID<0x10000): glyph xadvance
	GlyphOffset   f64.Vec2 // Input    // For custom font glyphs only (ID<0x10000): glyph display offset
	Font          *Font    // Input    // For custom font glyphs only (ID<0x10000): target font
}

func (*CustomRect) Init

func (c *CustomRect) Init()

func (*CustomRect) IsPacked

func (c *CustomRect) IsPacked() bool

type Dir

type Dir int
const (
	DirNone  Dir = -1
	DirLeft  Dir = 0
	DirRight Dir = 1
	DirUp    Dir = 2
	DirDown  Dir = 3
	DirCOUNT Dir = 4
)

type DragDropFlags

type DragDropFlags int
const (
	// BeginDragDropSource() flags
	DragDropFlagsSourceNoPreviewTooltip   DragDropFlags = 1 << 0 // By default a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disable this behavior.
	DragDropFlagsSourceNoDisableHover     DragDropFlags = 1 << 1 // By default when dragging we clear data so that IsItemHovered() will return true to avoid subsequent user code submitting tooltips. This flag disable this behavior so you can still call IsItemHovered() on the source item.
	DragDropFlagsSourceNoHoldToOpenOthers DragDropFlags = 1 << 2 // Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item.
	DragDropFlagsSourceAllowNullID        DragDropFlags = 1 << 3 // Allow items such as Text() Image() that have no unique identifier to be used as drag source by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit.
	DragDropFlagsSourceExtern             DragDropFlags = 1 << 4 // External source (from outside of imgui) won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously.
	// AcceptDragDropPayload() flags
	DragDropFlagsAcceptBeforeDelivery    DragDropFlags = 1 << 10                                                                  // AcceptDragDropPayload() will returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered.
	DragDropFlagsAcceptNoDrawDefaultRect DragDropFlags = 1 << 11                                                                  // Do not draw the default highlight rectangle when hovering over target.
	DragDropFlagsAcceptPeekOnly          DragDropFlags = DragDropFlagsAcceptBeforeDelivery | DragDropFlagsAcceptNoDrawDefaultRect // For peeking ahead and inspecting the payload before delivery.
)

type DrawChannel

type DrawChannel struct {
	CmdBuffer []DrawCmd
	IdxBuffer []DrawIdx
}

func (*DrawChannel) Init

func (d *DrawChannel) Init()

type DrawCmd

type DrawCmd struct {
	ElemCount        int                      // Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[].
	ClipRect         f64.Vec4                 // Clipping rectangle (x1, y1, x2, y2)
	TextureId        TextureID                // User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas.
	UserCallback     func(cmd_list *DrawList) // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
	UserCallbackData interface{}              // The draw callback code can access this.
}

type DrawContext

type DrawContext struct {
	CursorPos                     f64.Vec2
	CursorPosPrevLine             f64.Vec2
	CursorStartPos                f64.Vec2
	CursorMaxPos                  f64.Vec2 // Used to implicitly calculate the size of our contents, always growing during the frame. Turned into window->SizeContents at the beginning of next frame
	CurrentLineHeight             float64
	CurrentLineTextBaseOffset     float64
	PrevLineHeight                float64
	PrevLineTextBaseOffset        float64
	LogLinePosY                   float64
	TreeDepth                     int
	TreeDepthMayJumpToParentOnPop uint32 // Store a copy of !g.NavIdIsAlive for TreeDepth 0..31
	LastItemId                    ID
	LastItemStatusFlags           ItemStatusFlags
	LastItemRect                  f64.Rectangle // Interaction rect
	LastItemDisplayRect           f64.Rectangle // End-user display rect (only valid if LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect)
	NavHideHighlightOneFrame      bool
	NavHasScroll                  bool     // Set when scrolling can be used (ScrollMax > 0.0f)
	NavLayerCurrent               int      // Current layer, 0..31 (we currently only use 0..1)
	NavLayerCurrentMask           int      // = (1 << NavLayerCurrent) used by ItemAdd prior to clipping.
	NavLayerActiveMask            int      // Which layer have been written to (result from previous frame)
	NavLayerActiveMaskNext        int      // Which layer have been written to (buffer for current frame)
	MenuBarAppending              bool     // FIXME: Remove this
	MenuBarOffset                 f64.Vec2 // MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs.
	ChildWindows                  []*Window
	StateStorage                  map[ID]interface{}
	LayoutType                    LayoutType
	ParentLayoutType              LayoutType // Layout type of parent window at the time of Begin()

	// We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings.
	ItemFlags        ItemFlags // == ItemFlagsStack.back() [empty == ImGuiItemFlags_Default]
	ItemWidth        float64   // == ItemWidthStack.back(). 0.0: default, >0.0: width in pixels, <0.0: align xx pixels to the right of window
	TextWrapPos      float64   // == TextWrapPosStack.back() [empty == -1.0f]
	ItemFlagsStack   []ItemFlags
	ItemWidthStack   []float64
	TextWrapPosStack []float64
	GroupStack       []GroupData
	StackSizesBackup [6]int // Store size of various stacks for asserting

	IndentX        float64 // Indentation / start position from left of window (increased by TreePush/TreePop, etc.)
	GroupOffsetX   float64
	ColumnsOffsetX float64     // Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API.
	ColumnsSet     *ColumnsSet // Current columns set
}

type DrawCornerFlags

type DrawCornerFlags int
const (
	DrawCornerFlagsTopLeft  DrawCornerFlags = 1 << 0                                            // 0x1
	DrawCornerFlagsTopRight DrawCornerFlags = 1 << 1                                            // 0x2
	DrawCornerFlagsBotLeft  DrawCornerFlags = 1 << 2                                            // 0x4
	DrawCornerFlagsBotRight DrawCornerFlags = 1 << 3                                            // 0x8
	DrawCornerFlagsTop      DrawCornerFlags = DrawCornerFlagsTopLeft | DrawCornerFlagsTopRight  // 0x3
	DrawCornerFlagsBot      DrawCornerFlags = DrawCornerFlagsBotLeft | DrawCornerFlagsBotRight  // 0xC
	DrawCornerFlagsLeft     DrawCornerFlags = DrawCornerFlagsTopLeft | DrawCornerFlagsBotLeft   // 0x5
	DrawCornerFlagsRight    DrawCornerFlags = DrawCornerFlagsTopRight | DrawCornerFlagsBotRight // 0xA
	DrawCornerFlagsAll      DrawCornerFlags = 0xF                                               // In your function calls you may use ~0 (= all bits sets) instead of DrawCornerFlags_All, as a convenience
)

type DrawData

type DrawData struct {
	Valid         bool // Only valid after Render() is called and before the next NewFrame() is called.
	CmdLists      []*DrawList
	CmdListsCount int
	TotalVtxCount int // For convenience, sum of all cmd_lists vtx_buffer.Size
	TotalIdxCount int // For convenience, sum of all cmd_lists idx_buffer.Size
}

func (*DrawData) Clear

func (d *DrawData) Clear()

func (*DrawData) ScaleClipRects

func (d *DrawData) ScaleClipRects(scale f64.Vec2)

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.

type DrawDataBuilder

type DrawDataBuilder struct {
	Layers [2][]*DrawList
}

func (*DrawDataBuilder) Clear

func (d *DrawDataBuilder) Clear()

func (*DrawDataBuilder) FlattenIntoSingleLayer

func (d *DrawDataBuilder) FlattenIntoSingleLayer()

type DrawIdx

type DrawIdx uint32

type DrawList

type DrawList struct {
	ID ID

	// This is what you have to render
	CmdBuffer []DrawCmd  // Draw commands. Typically 1 command = 1 GPU draw call, unless the command is a callback.
	IdxBuffer []DrawIdx  // Index buffer. Each command consume ImDrawCmd::ElemCount of those
	VtxBuffer []DrawVert // Vertex buffer.

	// [Internal, used while building lists]
	Flags           DrawListFlags       // Flags, you may poke into these to adjust anti-aliasing settings per-primitive.
	Data            *DrawListSharedData // Pointer to shared draw data (you can use ImGui::GetDrawListSharedData() to get the one from current ImGui context)
	OwnerName       string              // Pointer to owner window's name for debugging
	VtxCurrentIdx   int                 // [Internal] == VtxBuffer.Size
	VtxWritePtr     int                 // [Internal] point within VtxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
	IdxWritePtr     int                 // [Internal] point within IdxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
	ClipRectStack   []f64.Vec4          // [Internal]
	TextureIdStack  []TextureID         // [Internal]
	Path            []f64.Vec2          // [Internal] current path building                   ChannelsCurrent int   // [Internal] current channel number (0)
	ChannelsCurrent int                 // [Internal] current channel number (0)
	ChannelsCount   int                 // [Internal] number of active channels (1+)
	Channels        []DrawChannel       // [Internal] draw channels for columns API (not resized down so ChannelsCount may be smaller than Channels.Size)
}

func NewDrawList

func NewDrawList(shared_data *DrawListSharedData) *DrawList

func (*DrawList) AddBezierCurve

func (d *DrawList) AddBezierCurve(pos0, cp0, cp1, pos1 f64.Vec2, col color.RGBA, thickness float64)

func (*DrawList) AddBezierCurveEx

func (d *DrawList) AddBezierCurveEx(pos0, cp0, cp1, pos1 f64.Vec2, col color.RGBA, thickness float64, num_segments int)

func (*DrawList) AddCircle

func (d *DrawList) AddCircle(centre f64.Vec2, radius float64, col color.RGBA)

func (*DrawList) AddCircleEx

func (d *DrawList) AddCircleEx(centre f64.Vec2, radius float64, col color.RGBA, num_segments int, thickness float64)

func (*DrawList) AddCircleFilled

func (d *DrawList) AddCircleFilled(centre f64.Vec2, radius float64, col color.RGBA)

func (*DrawList) AddCircleFilledEx

func (d *DrawList) AddCircleFilledEx(centre f64.Vec2, radius float64, col color.RGBA, num_segments int)

func (*DrawList) AddConvexPolyFilled

func (d *DrawList) AddConvexPolyFilled(points []f64.Vec2, col color.RGBA)

func (*DrawList) AddDrawCmd

func (d *DrawList) AddDrawCmd()

func (*DrawList) AddImage

func (d *DrawList) AddImage(user_texture_id TextureID, a, b f64.Vec2)

func (*DrawList) AddImageEx

func (d *DrawList) AddImageEx(user_texture_id TextureID, a, b, uv_a, uv_b f64.Vec2, col color.RGBA)

func (*DrawList) AddImageQuad

func (d *DrawList) AddImageQuad(user_texture_id TextureID, a, b, c, d_ f64.Vec2)

func (*DrawList) AddImageQuadEx

func (d *DrawList) AddImageQuadEx(user_texture_id TextureID, a, b, c, d_, uv_a, uv_b, uv_c, uv_d f64.Vec2, col color.RGBA)

func (*DrawList) AddImageRounded

func (d *DrawList) AddImageRounded(user_texture_id TextureID, a, b, uv_a, uv_b f64.Vec2, col color.RGBA, rounding float64)

func (*DrawList) AddImageRoundedEx

func (d *DrawList) AddImageRoundedEx(user_texture_id TextureID, a, b, uv_a, uv_b f64.Vec2, col color.RGBA, rounding float64, rounding_corners DrawCornerFlags)

func (*DrawList) AddLine

func (d *DrawList) AddLine(a, b f64.Vec2, col color.RGBA)

func (*DrawList) AddLineEx

func (d *DrawList) AddLineEx(a, b f64.Vec2, col color.RGBA, thickness float64)

func (*DrawList) AddPolyline

func (d *DrawList) AddPolyline(points []f64.Vec2, col color.RGBA, closed bool, thickness float64)

func (*DrawList) AddRect

func (d *DrawList) AddRect(p_min, p_max f64.Vec2, col color.RGBA)

a: upper-left, b: lower-right. we don't render 1 px sized rectangles properly.

func (*DrawList) AddRectDx

func (d *DrawList) AddRectDx(p_min, p_max f64.Vec2, col color.RGBA, rounding float64)

func (*DrawList) AddRectEx

func (d *DrawList) AddRectEx(a, b f64.Vec2, col color.RGBA, rounding float64, rounding_corners_flags DrawCornerFlags, thickness float64)

func (*DrawList) AddRectFilled

func (d *DrawList) AddRectFilled(p_min, p_max f64.Vec2, col color.RGBA)

func (*DrawList) AddRectFilledEx

func (d *DrawList) AddRectFilledEx(a, b f64.Vec2, col color.RGBA, rounding float64, rounding_corners_flags DrawCornerFlags)

func (*DrawList) AddRectFilledMultiColor

func (d *DrawList) AddRectFilledMultiColor(a, c f64.Vec2, col_upr_left, col_upr_right, col_bot_right, col_bot_left color.RGBA)

func (*DrawList) AddText

func (d *DrawList) AddText(pos f64.Vec2, col color.RGBA, text string)

func (*DrawList) AddTextEx

func (d *DrawList) AddTextEx(font *Font, font_size float64, pos f64.Vec2, col color.RGBA, text string, wrap_width float64, cpu_fine_clip_rect *f64.Vec4)

func (*DrawList) AddTriangle

func (d *DrawList) AddTriangle(a, b, c f64.Vec2, col color.RGBA)

func (*DrawList) AddTriangleEx

func (d *DrawList) AddTriangleEx(a, b, c f64.Vec2, col color.RGBA, thickness float64)

func (*DrawList) AddTriangleFilled

func (d *DrawList) AddTriangleFilled(a, b, c f64.Vec2, col color.RGBA)

func (*DrawList) ChannelsMerge

func (d *DrawList) ChannelsMerge()

func (*DrawList) ChannelsSetCurrent

func (d *DrawList) ChannelsSetCurrent(idx int)

func (*DrawList) ChannelsSplit

func (d *DrawList) ChannelsSplit(channels_count int)

func (*DrawList) Clear

func (d *DrawList) Clear()

func (*DrawList) GetCurrentClipRect

func (d *DrawList) GetCurrentClipRect() f64.Vec4

func (*DrawList) GetCurrentTextureId

func (d *DrawList) GetCurrentTextureId() TextureID

func (*DrawList) Init

func (d *DrawList) Init(shared_data *DrawListSharedData)

func (*DrawList) PathArcTo

func (d *DrawList) PathArcTo(centre f64.Vec2, radius, a_min, a_max float64, num_segments int)

func (*DrawList) PathArcToFast

func (d *DrawList) PathArcToFast(centre f64.Vec2, radius float64, a_min_of_12, a_max_of_12 int)

func (*DrawList) PathBezierCurveTo

func (d *DrawList) PathBezierCurveTo(p2, p3, p4 f64.Vec2, num_segments int)

func (*DrawList) PathBezierToCasteljau

func (d *DrawList) PathBezierToCasteljau(path *[]f64.Vec2, x1, y1, x2, y2, x3, y3, x4, y4, tess_tol float64, level int)

func (*DrawList) PathClear

func (d *DrawList) PathClear()

func (*DrawList) PathFillConvex

func (d *DrawList) PathFillConvex(col color.RGBA)

func (*DrawList) PathLineTo

func (d *DrawList) PathLineTo(pos f64.Vec2)

func (*DrawList) PathRect

func (d *DrawList) PathRect(a, b f64.Vec2, rounding float64, rounding_corners DrawCornerFlags)

func (*DrawList) PathStroke

func (d *DrawList) PathStroke(col color.RGBA, closed bool)

func (*DrawList) PathStrokeEx

func (d *DrawList) PathStrokeEx(col color.RGBA, closed bool, thickness float64)

func (*DrawList) PopClipRect

func (d *DrawList) PopClipRect()

func (*DrawList) PopTextureID

func (d *DrawList) PopTextureID()

func (*DrawList) PrimQuadUV

func (d *DrawList) PrimQuadUV(a, b, c, d_, uv_a, uv_b, uv_c, uv_d f64.Vec2, col color.RGBA)

func (*DrawList) PrimRect

func (d *DrawList) PrimRect(a, c f64.Vec2, col color.RGBA)

Fully unrolled with inline call to keep our debug builds decently fast.

func (*DrawList) PrimRectUV

func (d *DrawList) PrimRectUV(a, c, uv_a, uv_c f64.Vec2, col color.RGBA)

func (*DrawList) PrimReserve

func (d *DrawList) PrimReserve(idx_count, vtx_count int)

NB: this can be called with negative count for removing primitives (as long as the result does not underflow)

func (*DrawList) PrimVtx

func (d *DrawList) PrimVtx(pos, uv f64.Vec2, col color.RGBA)

func (*DrawList) PrimWriteIdx

func (d *DrawList) PrimWriteIdx(idx DrawIdx)

func (*DrawList) PrimWriteVtx

func (d *DrawList) PrimWriteVtx(pos, uv f64.Vec2, col color.RGBA)

func (*DrawList) PushClipRect

func (d *DrawList) PushClipRect(cr_min, cr_max f64.Vec2)

func (*DrawList) PushClipRectEx

func (d *DrawList) PushClipRectEx(cr_min, cr_max f64.Vec2, intersect_with_current_clip_rect bool)

func (*DrawList) PushClipRectFullScreen

func (d *DrawList) PushClipRectFullScreen()

func (*DrawList) PushTextureID

func (d *DrawList) PushTextureID(texture_id TextureID)

func (*DrawList) ShadeVertsLinearUV

func (d *DrawList) ShadeVertsLinearUV(vert_start, vert_end int, a, b, uv_a, uv_b f64.Vec2, clamp bool)

func (*DrawList) UpdateClipRect

func (d *DrawList) UpdateClipRect()

Our scheme may appears a bit unusual, basically we want the most-common calls AddLine AddRect etc. to not have to perform any check so we always have a command ready in the stack.

func (*DrawList) UpdateTextureID

func (d *DrawList) UpdateTextureID()

type DrawListFlags

type DrawListFlags int
const (
	DrawListFlagsAntiAliasedLines DrawListFlags = 1 << 0
	DrawListFlagsAntiAliasedFill  DrawListFlags = 1 << 1
)

type DrawListSharedData

type DrawListSharedData struct {
	TexUvWhitePixel      f64.Vec2 // UV of white pixel in the atlas
	Font                 *Font    // Current/default font (optional, for simplified AddText overload)
	FontSize             float64  // Current/default font size (optional, for simplified AddText overload)
	CurveTessellationTol float64
	ClipRectFullscreen   f64.Vec4 // Value for PushClipRectFullscreen()

	// Const data
	// FIXME: Bake rounded corners fill/borders in atlas
	CircleVtx12 [12]f64.Vec2
}

func (*DrawListSharedData) Init

func (d *DrawListSharedData) Init()

type DrawVert

type DrawVert struct {
	Pos f32.Vec2
	UV  f32.Vec2
	Col uint32
}

type FocusedFlags

type FocusedFlags uint
const (
	FocusedFlagsChildWindows        FocusedFlags = 1 << 0 // IsWindowFocused(): Return true if any children of the window is focused
	FocusedFlagsRootWindow          FocusedFlags = 1 << 1 // IsWindowFocused(): Test from root window (top most parent of the current hierarchy)
	FocusedFlagsAnyWindow           FocusedFlags = 1 << 2 // IsWindowFocused(): Return true if any window is focused
	FocusedFlagsRootAndChildWindows FocusedFlags = FocusedFlagsRootWindow | FocusedFlagsChildWindows
)

type Font

type Font struct {
	ID ID

	// Members: Hot ~62/78 bytes
	FontSize         float64     // <user set>   // Height of characters, set during loading (don't change after loading)
	Scale            float64     // = 1.f        // Base font scale, multiplied by the per-window font scale which you can adjust with SetFontScale()
	DisplayOffset    f64.Vec2    // = (0.f,1.f)  // Offset font rendering by xx pixels
	Glyphs           []FontGlyph //              // All glyphs.
	IndexAdvanceX    []float64   //              // Sparse. Glyphs->AdvanceX in a directly indexable way (more cache-friendly, for CalcTextSize functions which are often bottleneck in large UI).
	IndexLookup      []int       //              // Sparse. Index glyphs by Unicode code-point.
	FallbackGlyph    *FontGlyph  // == FindGlyph(FontFallbackChar)
	FallbackAdvanceX float64     // == FallbackGlyph->AdvanceX
	FallbackChar     rune        // = '?'        // Replacement glyph if one isn't found. Only set via SetFallbackChar()

	// Members: Cold ~18/26 bytes
	ConfigDataCount     int          // ~ 1          // Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont.
	ConfigData          []FontConfig //              // Pointer within ContainerAtlas->ConfigData
	ContainerAtlas      *FontAtlas   //              // What we has been loaded into
	Ascent, Descent     float64      //              // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]
	DirtyLookupTables   bool
	MetricsTotalSurface int //              // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
}

func NewFont

func NewFont() *Font

func (*Font) AddGlyph

func (f *Font) AddGlyph(codepoint rune, x0, y0, x1, y1, u0, v0, u1, v1, advance_x float64)

func (*Font) AddRemapChar

func (f *Font) AddRemapChar(dst, src rune, overwrite_dst bool)

func (*Font) BuildLookupTable

func (f *Font) BuildLookupTable()

func (*Font) CalcTextSizeA

func (f *Font) CalcTextSizeA(size, max_width, wrap_width float64, text string) (text_size f64.Vec2, remaining int)

func (*Font) CalcWordWrapPositionA

func (f *Font) CalcWordWrapPositionA(scale float64, text string, wrap_width float64) int

func (*Font) ClearOutputData

func (f *Font) ClearOutputData()

func (*Font) FindGlyph

func (f *Font) FindGlyph(c rune) *FontGlyph

func (*Font) FindGlyphNoFallback

func (f *Font) FindGlyphNoFallback(c rune) *FontGlyph

func (*Font) GetCharAdvance

func (f *Font) GetCharAdvance(c rune) float64

func (*Font) GetDebugName

func (f *Font) GetDebugName() string

func (*Font) GrowIndex

func (f *Font) GrowIndex(new_size int)

func (*Font) Init

func (f *Font) Init()

func (*Font) IsLoaded

func (f *Font) IsLoaded() bool

func (*Font) RenderChar

func (f *Font) RenderChar(draw_list *DrawList, size float64, pos f64.Vec2, col color.RGBA, c rune)

func (*Font) RenderText

func (f *Font) RenderText(draw_list *DrawList, size float64, pos f64.Vec2, col color.RGBA, clip_rect f64.Vec4, text string, wrap_width float64, cpu_fine_clip bool)

func (*Font) SetFallbackChar

func (f *Font) SetFallbackChar(c rune)

type FontAtlas

type FontAtlas struct {
	Flags           FontAtlasFlags // Build flags (see ImFontAtlasFlags_)
	TexID           TextureID      // User data to refer to the texture once it has been uploaded to user's graphic systems. It is passed back to you during rendering via the ImDrawCmd structure.
	TexDesiredWidth int            // Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height.
	TexGlyphPadding int            // Padding between glyphs within texture in pixels. Defaults to 1.

	// [Internal]
	// NB: Access texture data via GetTexData*() calls! Which will setup a default font for you.
	TexPixelsAlpha8 []uint8      // 1 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight
	TexPixelsRGBA32 []uint8      // 4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4
	TexWidth        int          // Texture width calculated during Build().
	TexHeight       int          // Texture height calculated during Build().
	TexUvScale      f64.Vec2     // = (1.0f/TexWidth, 1.0f/TexHeight)
	TexUvWhitePixel f64.Vec2     // Texture coordinates to a white pixel
	Fonts           []*Font      // Hold all the fonts returned by AddFont*. Fonts[0] is the default font upon calling ImGui::NewFrame(), use ImGui::PushFont()/PopFont() to change the current font.
	CustomRects     []CustomRect // Rectangles for packing custom texture data into the atlas.
	ConfigData      []FontConfig // Internal data
	CustomRectIds   [1]int       // Identifiers of custom texture rectangle used by ImFontAtlas/ImDrawList
}

func NewFontAtlas

func NewFontAtlas() *FontAtlas

func (*FontAtlas) AddCustomRectRegular

func (f *FontAtlas) AddCustomRectRegular(id, width, height uint) int

func (*FontAtlas) AddFont

func (f *FontAtlas) AddFont(font_cfg *FontConfig) *Font

func (*FontAtlas) AddFontDefault

func (f *FontAtlas) AddFontDefault(font_cfg_template *FontConfig) *Font

Load embedded ProggyClean.ttf at size 13, disable oversampling

func (*FontAtlas) AddFontFromMemoryCompressedBase85TTF

func (f *FontAtlas) AddFontFromMemoryCompressedBase85TTF(compressed_ttf_data_base85 []byte, size_pixels float64, font_cfg *FontConfig, glyph_ranges []rune) *Font

func (*FontAtlas) AddFontFromMemoryCompressedTTF

func (f *FontAtlas) AddFontFromMemoryCompressedTTF(compressed_ttf_data []byte, size_pixels float64, font_cfg_template *FontConfig, glyph_ranges []rune) *Font

func (*FontAtlas) AddFontFromMemoryTTF

func (f *FontAtlas) AddFontFromMemoryTTF(ttf_data []byte, size_pixels float64, font_cfg_template *FontConfig, glyph_ranges []rune) *Font

NB: Transfer ownership of 'ttf_data' to ImFontAtlas, unless font_cfg_template->FontDataOwnedByAtlas == false. Owned TTF buffer will be deleted after Build().

func (*FontAtlas) Build

func (f *FontAtlas) Build() error

func (*FontAtlas) BuildFinish

func (f *FontAtlas) BuildFinish()

func (*FontAtlas) BuildMultiplyCalcLookupTable

func (f *FontAtlas) BuildMultiplyCalcLookupTable(out_table []uint8, in_brighten_factor float64)

func (*FontAtlas) BuildMultiplyRectAlpha8

func (f *FontAtlas) BuildMultiplyRectAlpha8(table, pixels []byte, x, y, w, h, stride int)

func (*FontAtlas) BuildPackCustomRects

func (f *FontAtlas) BuildPackCustomRects(spc *stbtt.PackContext)

func (*FontAtlas) BuildRenderDefaultTexData

func (f *FontAtlas) BuildRenderDefaultTexData()

func (*FontAtlas) BuildSetupFont

func (f *FontAtlas) BuildSetupFont(font *Font, font_config []FontConfig, ascent, descent float64)

func (*FontAtlas) BuildWithStbTruetype

func (f *FontAtlas) BuildWithStbTruetype() error

func (*FontAtlas) CalcCustomRectUV

func (f *FontAtlas) CalcCustomRectUV(rect *CustomRect) (out_uv_min, out_uv_max f64.Vec2)

func (*FontAtlas) ClearTexData

func (f *FontAtlas) ClearTexData()

func (*FontAtlas) FontAtlasBuildRegisterDefaultCustomRects

func (f *FontAtlas) FontAtlasBuildRegisterDefaultCustomRects()

func (*FontAtlas) GetGlyphRangesDefault

func (f *FontAtlas) GetGlyphRangesDefault() []rune

Retrieve list of range (2 int per range, values are inclusive)

func (*FontAtlas) GetMouseCursorTexData

func (f *FontAtlas) GetMouseCursorTexData(cursor_type MouseCursor, out_offset, out_size *f64.Vec2, out_uv_border, out_uv_fill []f64.Vec2) bool

func (*FontAtlas) GetTexDataAsAlpha8

func (f *FontAtlas) GetTexDataAsAlpha8() (out_pixels []byte, out_width, out_height, out_bytes_per_pixel int)

func (*FontAtlas) GetTexDataAsRGBA32

func (f *FontAtlas) GetTexDataAsRGBA32() (out_pixels []byte, out_width, out_height, out_bytes_per_pixel int)

func (*FontAtlas) Init

func (f *FontAtlas) Init()

type FontAtlasFlags

type FontAtlasFlags int
const (
	FontAtlasFlagsNoPowerOfTwoHeight FontAtlasFlags = 1 << 0 // Don't round the height to next power of two
	FontAtlasFlagsNoMouseCursors     FontAtlasFlags = 1 << 1 // Don't build software mouse cursors into the atlas
)

type FontConfig

type FontConfig struct {
	FontData                 []uint8  //          // TTF/OTF data
	FontDataSize             int      //          // TTF/OTF data size
	FontDataOwnedByAtlas     bool     // true     // TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself).
	FontNo                   int      // 0        // Index of font within TTF/OTF file
	SizePixels               float64  //          // Size in pixels for rasterizer.
	OversampleH, OversampleV int      // 3, 1     // Rasterize at higher quality for sub-pixel positioning. We don't use sub-pixel positions on the Y axis.
	PixelSnapH               bool     // false    // Align every glyph to pixel boundary. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1.
	GlyphExtraSpacing        f64.Vec2 // 0, 0     // Extra spacing (in pixels) between glyphs. Only X axis is supported for now.
	GlyphOffset              f64.Vec2 // 0, 0     // Offset all glyphs from this font input.
	GlyphRanges              []rune   // NULL     // Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list). THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE.
	MergeMode                bool     // false    // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights.
	RasterizerFlags          uint     // 0x00     // Settings for custom font rasterizer (e.g. ImGuiFreeType). Leave as zero if you aren't using one.
	RasterizerMultiply       float64  // 1.0f     // Brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable.

	// [Internal]
	Name    string // Name (strictly to ease debugging)
	DstFont *Font
}

func (*FontConfig) Init

func (f *FontConfig) Init()

type FontGlyph

type FontGlyph struct {
	Codepoint      rune    // 0x0000..0xFFFF
	AdvanceX       float64 // Distance to next character (= data from font + ImFontConfig::GlyphExtraSpacing.x baked in)
	X0, Y0, X1, Y1 float64 // Glyph corners
	U0, V0, U1, V1 float64 // Texture coordinates
}

type GroupData

type GroupData struct {
	BackupCursorPos                 f64.Vec2
	BackupCursorMaxPos              f64.Vec2
	BackupIndentX                   float64
	BackupGroupOffsetX              float64
	BackupCurrentLineHeight         float64
	BackupCurrentLineTextBaseOffset float64
	BackupLogLinePosY               float64
	BackupActiveIdIsAlive           bool
	AdvanceCursor                   bool
}

type HoveredFlags

type HoveredFlags int
const (
	HoveredFlagsDefault                 HoveredFlags = 0      // Return true if directly over the item/window not obstructed by another window not obstructed by an active popup or modal blocking inputs under them.
	HoveredFlagsChildWindows            HoveredFlags = 1 << 0 // IsWindowHovered() only: Return true if any children of the window is hovered
	HoveredFlagsRootWindow              HoveredFlags = 1 << 1 // IsWindowHovered() only: Test from root window (top most parent of the current hierarchy)
	HoveredFlagsAnyWindow               HoveredFlags = 1 << 2 // IsWindowHovered() only: Return true if any window is hovered
	HoveredFlagsAllowWhenBlockedByPopup HoveredFlags = 1 << 3 // Return true even if a popup window is normally blocking access to this item/window
	//HoveredFlagsAllowWhenBlockedByModal     HoveredFlags= 1 << 4   // Return true even if a modal popup window is normally blocking access to this item/window. FIXME-TODO: Unavailable yet.
	HoveredFlagsAllowWhenBlockedByActiveItem HoveredFlags = 1 << 5 // Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns.
	HoveredFlagsAllowWhenOverlapped          HoveredFlags = 1 << 6 // Return true even if the position is overlapped by another window
	HoveredFlagsRectOnly                     HoveredFlags = HoveredFlagsAllowWhenBlockedByPopup | HoveredFlagsAllowWhenBlockedByActiveItem | HoveredFlagsAllowWhenOverlapped
	HoveredFlagsRootAndChildWindows          HoveredFlags = HoveredFlagsRootWindow | HoveredFlagsChildWindows
)

type ID

type ID uint

type IO

type IO struct {
	//------------------------------------------------------------------
	// Settings (fill once)                 // Default value:
	//------------------------------------------------------------------
	Ctx                     *Context
	ConfigFlags             ConfigFlags   // = 0                  // See ImGuiConfigFlags_ enum. Gamepad/keyboard navigation options, etc.
	BackendFlags            BackendFlags  // = 0                  // See ImGuiConfigFlags_ enum. Set by user/application. Gamepad/keyboard navigation options, etc.
	DisplaySize             f64.Vec2      // <unset>              // Display size, in pixels. For clamping windows positions.
	DeltaTime               float64       // = 1.0f/60.0f         // Time elapsed since last frame, in seconds.
	IniSavingRate           float64       // = 5.0f               // Maximum time between saving positions/sizes to .ini file, in seconds.
	IniFilename             string        // = "imgui.ini"        // Path to .ini file. NULL to disable .ini saving.
	LogFilename             string        // = "imgui_log.txt"    // Path to .log file (default parameter to ImGui::LogToFile when no file is specified).
	MouseDoubleClickTime    float64       // = 0.30f              // Time for a double-click, in seconds.
	MouseDoubleClickMaxDist float64       // = 6.0f               // Distance threshold to stay in to validate a double-click, in pixels.
	MouseDragThreshold      float64       // = 6.0f               // Distance threshold before considering we are dragging.
	KeyMap                  [KeyCOUNT]int // <unset>              // Map of indices into the KeysDown[512] entries array which represent your "native" keyboard state.
	KeyRepeatDelay          float64       // = 0.250f             // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
	KeyRepeatRate           float64       // = 0.050f             // When holding a key/button, rate at which it repeats, in seconds.
	UserData                interface{}   // = NULL               // Store your own data for retrieval by callbacks.

	Fonts                   *FontAtlas // <auto>               // Load and assemble one or more fonts into a single tightly packed texture. Output to Fonts array.
	FontGlobalScale         float64    // = 1.0f               // Global scale all fonts
	FontAllowUserScaling    bool       // = false              // Allow user scaling text of individual window with CTRL+Wheel.
	FontDefault             *Font      // = NULL               // Font to use on NewFrame(). Use NULL to uses Fonts->Fonts[0].
	DisplayFramebufferScale f64.Vec2   // = (1.0f,1.0f)        // For retina display or other situations where window coordinates are different from framebuffer coordinates. User storage only, presently not used by ImGui.
	DisplayVisibleMin       f64.Vec2   // <unset> (0.0f,0.0f)  // If you use DisplaySize as a virtual space larger than your screen, set DisplayVisibleMin/Max to the visible area.
	DisplayVisibleMax       f64.Vec2   // <unset> (0.0f,0.0f)  // If the values are the same, we defaults to Min=(0.0f) and Max=DisplaySize

	// Advanced/subtle behaviors
	OptMacOSXBehaviors bool // = defined(__APPLE__) // 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
	OptCursorBlink     bool // = true               // Enable blinking cursor, for users who consider it annoying.

	// Optional: access OS clipboard
	// (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures)
	GetClipboardTextFn func() string
	SetClipboardTextFn func(text string)
	ClipboardUserData  interface{}

	// Optional: notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME in Windows)
	// (default to use native imm32 api on Windows)
	ImeSetInputScreenPosFn func(x, y int)
	ImeWindowHandle        interface{} // (Windows) Set this to your HWND to get automatic IME cursor positioning.

	MousePos        f64.Vec2               // Mouse position, in pixels. Set to ImVec2(-FLT_MAX,-FLT_MAX) if mouse is unavailable (on another screen, etc.)
	MouseDown       [5]bool                // Mouse buttons: left, right, middle + extras. ImGui itself mostly only uses left button (BeginPopupContext** are using right button). Others buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.
	MouseWheel      float64                // Mouse wheel Vertical: 1 unit scrolls about 5 lines text.
	MouseWheelH     float64                // Mouse wheel Horizontal. Most users don't have a mouse with an horizontal wheel, may not be filled by all back-ends.
	MouseDrawCursor bool                   // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).
	KeyCtrl         bool                   // Keyboard modifier pressed: Control
	KeyShift        bool                   // Keyboard modifier pressed: Shift
	KeyAlt          bool                   // Keyboard modifier pressed: Alt
	KeySuper        bool                   // Keyboard modifier pressed: Cmd/Super/Windows
	KeysDown        [512]bool              // Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys).
	InputCharacters [16 + 1]rune           // List of characters input (translated by user from keypress+keyboard state). Fill using AddInputCharacter() helper.
	NavInputs       [NavInputCOUNT]float64 // Gamepad inputs (keyboard keys will be auto-mapped and be written here by ImGui::NewFrame)

	WantCaptureMouse      bool     // When io.WantCaptureMouse is true, imgui will use the mouse inputs, do not dispatch them to your main game/application. (e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.).
	WantCaptureKeyboard   bool     // When io.WantCaptureKeyboard is true, imgui will use the keyboard inputs, do not dispatch them to your main game/application. (e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.).
	WantTextInput         bool     // Mobile/console: when io.WantTextInput is true, you may display an on-screen keyboard. This is set by ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active).
	WantSetMousePos       bool     // MousePos has been altered, back-end should reposition mouse on next frame. Set only when ImGuiConfigFlags_NavMoveMouse flag is enabled.
	NavActive             bool     // Directional navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag.
	NavVisible            bool     // Directional navigation is visible and allowed (will handle ImGuiKey_NavXXX events).
	Framerate             float64  // Application framerate estimation, in frame per second. Solely for convenience. Rolling average estimation based on IO.DeltaTime over 120 frames
	MetricsRenderVertices int      // Vertices output during last call to Render()
	MetricsRenderIndices  int      // Indices output during last call to Render() = number of triangles * 3
	MetricsActiveWindows  int      // Number of visible root windows (exclude child windows)
	MouseDelta            f64.Vec2 // 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.

	MousePosPrev              f64.Vec2     // Previous mouse position temporary storage (nb: not for public use, set to MousePos in NewFrame())
	MouseClickedPos           [5]f64.Vec2  // Position at time of clicking
	MouseClickedTime          [5]float64   // Time of last click (used to figure out double-click)
	MouseClicked              [5]bool      // Mouse button went from !Down to Down
	MouseDoubleClicked        [5]bool      // Has mouse button been double-clicked?
	MouseReleased             [5]bool      // Mouse button went from Down to !Down
	MouseDownOwned            [5]bool      // Track if button was clicked inside a window. We don't request mouse capture from the application if click started outside ImGui bounds.
	MouseDownDuration         [5]float64   // Duration the mouse button has been down (0.0f == just clicked)
	MouseDownDurationPrev     [5]float64   // Previous time the mouse button has been down
	MouseDragMaxDistanceAbs   [5]f64.Vec2  // Maximum distance, absolute, on each axis, of how much mouse has traveled from the clicking point
	MouseDragMaxDistanceSqr   [5]float64   // Squared maximum distance of how much mouse has traveled from the clicking point
	KeysDownDuration          [512]float64 // Duration the keyboard key has been down (0.0f == just pressed)
	KeysDownDurationPrev      [512]float64 // Previous duration the key has been down
	NavInputsDownDuration     [NavInputCOUNT]float64
	NavInputsDownDurationPrev [NavInputCOUNT]float64
}

func (*IO) Init

func (c *IO) Init(ctx *Context)

type InputReadMode

type InputReadMode int
const (
	InputReadModeDown InputReadMode = iota
	InputReadModePressed
	InputReadModeReleased
	InputReadModeRepeat
	InputReadModeRepeatSlow
	InputReadModeRepeatFast
)

type InputSource

type InputSource int
const (
	InputSourceNone InputSource = iota
	InputSourceMouse
	InputSourceNav
	InputSourceNavKeyboard // Only used occasionally for storage, not tested/handled by most code
	InputSourceNavGamepad  // "
	InputSourceCOUNT
)

type InputTextFlags

type InputTextFlags int
const (
	InputTextFlagsCharsDecimal        InputTextFlags = 1 << 0  // Allow 0123456789.+-*/
	InputTextFlagsCharsHexadecimal    InputTextFlags = 1 << 1  // Allow 0123456789ABCDEFabcdef
	InputTextFlagsCharsUppercase      InputTextFlags = 1 << 2  // Turn a..z into A..Z
	InputTextFlagsCharsNoBlank        InputTextFlags = 1 << 3  // Filter out spaces tabs
	InputTextFlagsAutoSelectAll       InputTextFlags = 1 << 4  // Select entire text when first taking mouse focus
	InputTextFlagsEnterReturnsTrue    InputTextFlags = 1 << 5  // Return 'true' when Enter is pressed (as opposed to when the value was modified)
	InputTextFlagsCallbackCompletion  InputTextFlags = 1 << 6  // Call user function on pressing TAB (for completion handling)
	InputTextFlagsCallbackHistory     InputTextFlags = 1 << 7  // Call user function on pressing Up/Down arrows (for history handling)
	InputTextFlagsCallbackAlways      InputTextFlags = 1 << 8  // Call user function every time. User code may query cursor position modify text buffer.
	InputTextFlagsCallbackCharFilter  InputTextFlags = 1 << 9  // Call user function to filter character. Modify data->EventChar to replace/filter input or return 1 to discard character.
	InputTextFlagsAllowTabInput       InputTextFlags = 1 << 10 // Pressing TAB input a '\t' character into the text field
	InputTextFlagsCtrlEnterForNewLine InputTextFlags = 1 << 11 // In multi-line mode unfocus with Enter add new line with Ctrl+Enter (default is opposite: unfocus with Ctrl+Enter add line with Enter).
	InputTextFlagsNoHorizontalScroll  InputTextFlags = 1 << 12 // Disable following the cursor horizontally
	InputTextFlagsAlwaysInsertMode    InputTextFlags = 1 << 13 // Insert mode
	InputTextFlagsReadOnly            InputTextFlags = 1 << 14 // Read-only mode
	InputTextFlagsPassword            InputTextFlags = 1 << 15 // Password mode display all characters as '*'
	InputTextFlagsNoUndoRedo          InputTextFlags = 1 << 16 // Disable undo/redo. Note that input text owns the text data while active if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID().
	InputTextFlagsCharsScientific     InputTextFlags = 1 << 17 // Allow 0123456789.+-*/eE (Scientific notation input)
	// [Internal]
	InputTextFlagsMultiline InputTextFlags = 1 << 20 // For internal use by InputTextMultiline()
)

type ItemFlags

type ItemFlags int
const (
	ItemFlagsAllowKeyboardFocus       ItemFlags = 1 << 0 // true
	ItemFlagsButtonRepeat             ItemFlags = 1 << 1 // false    // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
	ItemFlagsDisabled                 ItemFlags = 1 << 2 // false    // FIXME-WIP: Disable interactions but doesn't affect visuals. Should be: grey out and disable interactions with widgets that affect data + view widgets (WIP)
	ItemFlagsNoNav                    ItemFlags = 1 << 3 // false
	ItemFlagsNoNavDefaultFocus        ItemFlags = 1 << 4 // false
	ItemFlagsSelectableDontClosePopup ItemFlags = 1 << 5 // false    // MenuItem/Selectable() automatically closes current Popup window
	ItemFlagsDefault_                 ItemFlags = ItemFlagsAllowKeyboardFocus
)

type ItemHoveredDataBackup

type ItemHoveredDataBackup struct {
	LastItemId          ID
	LastItemStatusFlags ItemStatusFlags
	LastItemRect        f64.Rectangle
	LastItemDisplayRect f64.Rectangle
}

func (*ItemHoveredDataBackup) Backup

func (b *ItemHoveredDataBackup) Backup(c *Context)

func (*ItemHoveredDataBackup) Restore

func (b *ItemHoveredDataBackup) Restore(c *Context)

type ItemStatusFlags

type ItemStatusFlags int
const (
	ItemStatusFlagsHoveredRect    ItemStatusFlags = 1 << 0
	ItemStatusFlagsHasDisplayRect ItemStatusFlags = 1 << 1
)

type Key

type Key int
const (
	KeyTab Key = iota
	KeyLeftArrow
	KeyRightArrow
	KeyUpArrow
	KeyDownArrow
	KeyPageUp
	KeyPageDown
	KeyHome
	KeyEnd
	KeyInsert
	KeyDelete
	KeyBackspace
	KeySpace
	KeyEnter
	KeyEscape
	KeyA // for text edit CTRL+A: select all
	KeyC // for text edit CTRL+C: copy
	KeyV // for text edit CTRL+V: paste
	KeyX // for text edit CTRL+X: cut
	KeyY // for text edit CTRL+Y: redo
	KeyZ // for text edit CTRL+Z: undo
	KeyCOUNT
)

type LayoutType

type LayoutType int
const (
	LayoutTypeVertical LayoutType = iota
	LayoutTypeHorizontal
)

type ListClipper

type ListClipper struct {
	Ctx                                          *Context
	StartPosY                                    float64
	ItemsHeight                                  float64
	ItemsCount, StepNo, DisplayStart, DisplayEnd int
}

Helper: Manually clip large list of 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.

func (*ListClipper) Begin

func (l *ListClipper) Begin(items_count int, items_height float64)

func (*ListClipper) End

func (l *ListClipper) End()

func (*ListClipper) Init

func (l *ListClipper) Init(ctx *Context, items_count int, items_height float64)

func (*ListClipper) Step

func (l *ListClipper) Step() bool
type MenuColumns struct {
	Count            int
	Spacing          float64
	Width, NextWidth float64
	Pos, NextWidths  [4]float64
}
func (m *MenuColumns) DeclColumns(w0, w1, w2 float64) float64
func (m *MenuColumns) Update(count int, spacing float64, clear bool)

type MouseCursor

type MouseCursor int
const (
	MouseCursorNone MouseCursor = -1 + iota
	MouseCursorArrow
	MouseCursorTextInput  // When hovering over InputText, etc.
	MouseCursorResizeAll  // Unused
	MouseCursorResizeNS   // When hovering over an horizontal border
	MouseCursorResizeEW   // When hovering over a vertical border or a column
	MouseCursorResizeNESW // When hovering over the bottom-left corner of a window
	MouseCursorResizeNWSE // When hovering over the bottom-right corner of a window
	MouseCursorCOUNT
)
type NavDirSourceFlags int
const (
	NavDirSourceFlagsKeyboard  NavDirSourceFlags = 1 << 0
	NavDirSourceFlagsPadDPad   NavDirSourceFlags = 1 << 1
	NavDirSourceFlagsPadLStick NavDirSourceFlags = 1 << 2
)
type NavForward int
const (
	NavForwardNone NavForward = iota
	NavForwardForwardQueued
	NavForwardForwardActive
)
type NavHighlightFlags int
const (
	NavHighlightFlagsTypeDefault NavHighlightFlags = 1 << 0
	NavHighlightFlagsTypeThin    NavHighlightFlags = 1 << 1
	NavHighlightFlagsAlwaysDraw  NavHighlightFlags = 1 << 2
	NavHighlightFlagsNoRounding  NavHighlightFlags = 1 << 3
)
type NavInput int
const (
	// Gamepad Mapping
	NavInputActivate    NavInput = iota // activate / open / toggle / tweak value       // e.g. Cross  (PS4), A (Xbox), A (Switch), Space (Keyboard)
	NavInputCancel                      // cancel / close / exit                        // e.g. Circle (PS4), B (Xbox), B (Switch), Escape (Keyboard)
	NavInputInput                       // text input / on-screen keyboard              // e.g. Triang.(PS4) Y (Xbox) X (Switch) Return (Keyboard)
	NavInputMenu                        // tap: toggle menu / hold: focus move resize // e.g. Square (PS4) X (Xbox) Y (Switch) Alt (Keyboard)
	NavInputDpadLeft                    // move / tweak / resize window (w/ PadMenu)    // e.g. D-pad Left/Right/Up/Down (Gamepads) Arrow keys (Keyboard)
	NavInputDpadRight                   //
	NavInputDpadUp                      //
	NavInputDpadDown                    //
	NavInputLStickLeft                  // scroll / move window (w/ PadMenu)            // e.g. Left Analog Stick Left/Right/Up/Down
	NavInputLStickRight                 //
	NavInputLStickUp                    //
	NavInputLStickDown                  //
	NavInputFocusPrev                   // next window (w/ PadMenu)                     // e.g. L1 or L2 (PS4) LB or LT (Xbox) L or ZL (Switch)
	NavInputFocusNext                   // prev window (w/ PadMenu)                     // e.g. R1 or R2 (PS4) RB or RT (Xbox) R or ZL (Switch)
	NavInputTweakSlow                   // slower tweaks                                // e.g. L1 or L2 (PS4) LB or LT (Xbox) L or ZL (Switch)
	NavInputTweakFast                   // faster tweaks                                // e.g. R1 or R2 (PS4) RB or RT (Xbox) R or ZL (Switch)

	// [Internal] Don't use directly! This is used internally to differentiate keyboard from gamepad inputs for behaviors that require to differentiate them.
	// Keyboard behavior that have no corresponding gamepad mapping (e.g. CTRL+TAB) will be directly reading from io.KeysDown[] instead of io.NavInputs[].
	NavInputKeyMenu_  // toggle menu                                  // = io.KeyAlt
	NavInputKeyLeft_  // move left                                    // = Arrow keys
	NavInputKeyRight_ // move right
	NavInputKeyUp_    // move up
	NavInputKeyDown_  // move down
	NavInputCOUNT
	NavInputInternalStart_ = NavInputKeyMenu_
)
type NavMoveResult struct {
	ID         ID      // Best candidate
	ParentID   ID      // Best candidate window->IDStack.back() - to compare context
	Window     *Window // Best candidate window
	DistBox    float64 // Best candidate box distance to current NavId
	DistCenter float64 // Best candidate center distance to current NavId
	DistAxial  float64
	RectRel    f64.Rectangle // Best candidate bounding box in window relative space
}
func (n *NavMoveResult) Clear()

type NextWindowData

type NextWindowData struct {
	PosCond             Cond
	SizeCond            Cond
	ContentSizeCond     Cond
	CollapsedCond       Cond
	SizeConstraintCond  Cond
	FocusCond           Cond
	BgAlphaCond         Cond
	PosVal              f64.Vec2
	PosPivotVal         f64.Vec2
	SizeVal             f64.Vec2
	ContentSizeVal      f64.Vec2
	CollapsedVal        bool
	SizeConstraintRect  f64.Rectangle
	SizeCallback        func(*SizeCallbackData)
	BgAlphaVal          float64
	MenuBarOffsetMinVal f64.Vec2 // This is not exposed publicly, so we don't clear it.
}

func (*NextWindowData) Clear

func (n *NextWindowData) Clear()

func (*NextWindowData) Init

func (n *NextWindowData) Init()

type Payload

type Payload struct {
	Data           interface{}
	SourceId       ID   // Source item id
	SourceParentId ID   // Source parent id (if available)
	DataFrameCount int  // Data timestamp
	Preview        bool // Set when AcceptDragDropPayload() was called and mouse has been hovering the target item (nb: handle overlapping drag targets)
	Delivery       bool // Set when AcceptDragDropPayload() was called and mouse button is released over the target item.
}

func (*Payload) Clear

func (p *Payload) Clear()

type PlotType

type PlotType int

type PopupPositionPolicy

type PopupPositionPolicy int
const (
	PopupPositionPolicyDefault PopupPositionPolicy = iota
	PopupPositionPolicyComboBox
)

type PopupRef

type PopupRef struct {
	PopupId        ID       // Set on OpenPopup()
	Window         *Window  // Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
	ParentWindow   *Window  // Set on OpenPopup()
	OpenFrameCount int      // Set on OpenPopup()
	OpenParentId   ID       // Set on OpenPopup(), we need this to differenciate multiple menu sets from each others (e.g. inside menu bar vs loose menu items)
	OpenPopupPos   f64.Vec2 // Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse)
	OpenMousePos   f64.Vec2 // Set on OpenPopup(), copy of mouse position at the time of opening popup
}

type ResizeGripDef

type ResizeGripDef struct {
	CornerPos              f64.Vec2
	InnerDir               f64.Vec2
	AngleMin12, AngleMax12 int
}

type SelectableFlags

type SelectableFlags int
const (
	SelectableFlagsDontClosePopups  SelectableFlags = 1 << 0 // Clicking this don't close parent popup window
	SelectableFlagsSpanAllColumns   SelectableFlags = 1 << 1 // Selectable frame can span all columns (text will still fit in current column)
	SelectableFlagsAllowDoubleClick SelectableFlags = 1 << 2 // Generate press events on double clicks too

	// NB: need to be in sync with last value of ImGuiSelectableFlags_
	SelectableFlagsMenu               SelectableFlags = 1 << 3 // -> PressedOnClick
	SelectableFlagsMenuItem           SelectableFlags = 1 << 4 // -> PressedOnRelease
	SelectableFlagsDisabled           SelectableFlags = 1 << 5
	SelectableFlagsDrawFillAvailWidth SelectableFlags = 1 << 6
)

type SeparatorFlags

type SeparatorFlags int
const (
	SeparatorFlagsHorizontal SeparatorFlags = 1 << 0 // Axis default to current layout type, so generally Horizontal unless e.g. in a menu bar
	SeparatorFlagsVertical   SeparatorFlags = 1 << 1
)

type SettingsHandler

type SettingsHandler struct {
	TypeName   string // Short description stored in .ini file. Disallowed characters: '[' ']'
	ReadOpenFn func(ctx *Context, handler *SettingsHandler, name string) interface{}
	ReadLineFn func(ctx *Context, handler *SettingsHandler, entry interface{}, line string)
	WriteAllFn func(ctx *Context, handler *SettingsHandler, out_buf io.Writer)
}

type SizeCallbackData

type SizeCallbackData struct {
	Pos         f64.Vec2 // Read-only.   Window position, for reference.
	CurrentSize f64.Vec2 // Read-only.   Current window size.
	DesiredSize f64.Vec2 // Read-write.  Desired size, based on user's mouse position. Write to this field to restrain resizing.
}

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.

type SliderFlags

type SliderFlags int
const (
	SliderFlagsVertical SliderFlags = 1 << 0
)

type Style

type Style struct {
	Alpha                  float64  // Global alpha applies to everything in ImGui.
	WindowPadding          f64.Vec2 // Padding within a window.
	WindowRounding         float64  // Radius of window corners rounding. Set to 0.0f to have rectangular windows.
	WindowBorderSize       float64  // Thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
	WindowMinSize          f64.Vec2 // Minimum window size. This is a global setting. If you want to constraint individual windows, use SetNextWindowSizeConstraints().
	WindowTitleAlign       f64.Vec2 // Alignment for title bar text. Defaults to (0.0,0.5f) for left-aligned,vertically centered.
	ChildRounding          float64  // Radius of child window corners rounding. Set to 0.0f to have rectangular windows.
	ChildBorderSize        float64  // 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).
	PopupRounding          float64  // Radius of popup window corners rounding.
	PopupBorderSize        float64  // Thickness of border around popup windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
	FramePadding           f64.Vec2 // Padding within a framed rectangle (used by most widgets).
	FrameRounding          float64  // Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
	FrameBorderSize        float64  // Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
	ItemSpacing            f64.Vec2 // Horizontal and vertical spacing between widgets/lines.
	ItemInnerSpacing       f64.Vec2 // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label).
	TouchExtraPadding      f64.Vec2 // 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!
	IndentSpacing          float64  // Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
	ColumnsMinSpacing      float64  // Minimum horizontal spacing between two columns.
	ScrollbarSize          float64  // Width of the vertical scrollbar, Height of the horizontal scrollbar.
	ScrollbarRounding      float64  // Radius of grab corners for scrollbar.
	GrabMinSize            float64  // Minimum width/height of a grab box for slider/scrollbar.
	GrabRounding           float64  // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
	ButtonTextAlign        f64.Vec2 // Alignment of button text when button is larger than text. Defaults to (0.5,0.5f) for horizontally+vertically centered.
	DisplayWindowPadding   f64.Vec2 // Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows.
	DisplaySafeAreaPadding f64.Vec2 // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly!
	MouseCursorScale       float64  // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later.
	AntiAliasedLines       bool     // Enable anti-aliasing on lines/borders. Disable if you are really tight on CPU/GPU.
	AntiAliasedFill        bool     // Enable anti-aliasing on filled shapes (rounded rectangles, circles, etc.)
	CurveTessellationTol   float64  // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
	Colors                 [ColCOUNT]f64.Vec4
}

func (*Style) Init

func (s *Style) Init()

type StyleMod

type StyleMod struct {
	VarIdx StyleVar
	Value  interface{}
}

type StyleVar

type StyleVar int

Enumeration for PushStyleVar() / PopStyleVar() to temporarily modify the ImGuiStyle structure. NB: the enum only refers to fields of ImGuiStyle which makes sense to be pushed/popped inside UI code. During initialization, feel free to just poke into ImGuiStyle directly. NB: if changing this enum, you need to update the associated internal table GStyleVarInfo[] accordingly. This is where we link enum values to members offset/type.

const (
	// Enum name ......................// Member in ImGuiStyle structure (see ImGuiStyle for descriptions)
	StyleVarAlpha             StyleVar = iota // float     Alpha
	StyleVarWindowPadding                     // ImVec2    WindowPadding
	StyleVarWindowRounding                    // float     WindowRounding
	StyleVarWindowBorderSize                  // float     WindowBorderSize
	StyleVarWindowMinSize                     // ImVec2    WindowMinSize
	StyleVarWindowTitleAlign                  // ImVec2    WindowTitleAlign
	StyleVarChildRounding                     // float     ChildRounding
	StyleVarChildBorderSize                   // float     ChildBorderSize
	StyleVarPopupRounding                     // float     PopupRounding
	StyleVarPopupBorderSize                   // float     PopupBorderSize
	StyleVarFramePadding                      // ImVec2    FramePadding
	StyleVarFrameRounding                     // float     FrameRounding
	StyleVarFrameBorderSize                   // float     FrameBorderSize
	StyleVarItemSpacing                       // ImVec2    ItemSpacing
	StyleVarItemInnerSpacing                  // ImVec2    ItemInnerSpacing
	StyleVarIndentSpacing                     // float     IndentSpacing
	StyleVarScrollbarSize                     // float     ScrollbarSize
	StyleVarScrollbarRounding                 // float     ScrollbarRounding
	StyleVarGrabMinSize                       // float     GrabMinSize
	StyleVarGrabRounding                      // float     GrabRounding
	StyleVarButtonTextAlign                   // ImVec2    ButtonTextAlign
	StyleVarCOUNT
)

type TextEditCallback

type TextEditCallback func(*TextEditCallbackData) int

type TextEditCallbackData

type TextEditCallbackData struct {
	EventFlag InputTextFlags // One of ImGuiInputTextFlags_Callback* // Read-only
	Flags     InputTextFlags // What user passed to InputText()      // Read-only
	ReadOnly  bool           // Read-only mode                       // Read-only

	// CharFilter event:
	EventChar rune // Character input                      // Read-write (replace character or set to zero)

	// Completion,History,Always events:
	// If you modify the buffer contents make sure you update 'BufTextLen' and set 'BufDirty' to true.
	EventKey       Key    // Key pressed (Up/Down/TAB)            // Read-only
	Buf            []byte // Current text buffer                  // Read-write (pointed data only, can't replace the actual pointer)
	BufDirty       bool   // Set if you modify Buf/BufTextLen!!   // Write
	CursorPos      int    //                                      // Read-write
	SelectionStart int    //                                      // Read-write (== to SelectionEnd when no selection)
	SelectionEnd   int    //                                      // Read-write
}

Shared state of InputText(), passed to callback when a ImGuiInputTextFlags_Callback* flag is used and the corresponding callback is triggered.

type TextEditState

type TextEditState struct {
	Ctx                  *Context
	Id                   ID     // widget id owning the text state
	Text                 []rune // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer.
	InitialText          []byte // backup of end-user buffer at the time of focus (in UTF-8, unaltered)
	CurLenA, CurLenW     int    // we need to maintain our buffer length in both UTF-8 and wchar format.
	BufSizeA             int    // end-user buffer size
	ScrollX              float64
	StbState             stbte.State
	CursorAnim           float64
	CursorFollow         bool
	SelectedAllMouseLock bool
}

func (*TextEditState) ClearSelection

func (t *TextEditState) ClearSelection()

func (*TextEditState) CursorAnimReset

func (t *TextEditState) CursorAnimReset()

func (*TextEditState) CursorClamp

func (t *TextEditState) CursorClamp()

func (*TextEditState) DeleteChars

func (t *TextEditState) DeleteChars(pos, n int)

func (*TextEditState) GetChar

func (t *TextEditState) GetChar(idx int) rune

func (*TextEditState) GetWidth

func (t *TextEditState) GetWidth(line_start_idx, char_idx int) float64

func (*TextEditState) HasSelection

func (t *TextEditState) HasSelection() bool

func (*TextEditState) Init

func (t *TextEditState) Init(ctx *Context)

func (*TextEditState) InsertChars

func (t *TextEditState) InsertChars(pos int, new_text []rune) bool

func (*TextEditState) LayoutRow

func (t *TextEditState) LayoutRow(r *stbte.TextEditRow, line_start_idx int)

func (*TextEditState) Len

func (t *TextEditState) Len() int

func (*TextEditState) MoveWordLeft

func (t *TextEditState) MoveWordLeft(idx int) int

func (*TextEditState) MoveWordRight

func (t *TextEditState) MoveWordRight(idx int) int

func (*TextEditState) OnKeyPressed

func (t *TextEditState) OnKeyPressed(key int)

func (*TextEditState) SelectAll

func (t *TextEditState) SelectAll()

type TextFilter

type TextFilter struct {
	Ctx       *Context
	InputBuf  []byte
	Filters   []string
	CountGrep int
}

Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"

func (*TextFilter) Build

func (t *TextFilter) Build()

func (*TextFilter) Draw

func (t *TextFilter) Draw() bool

func (*TextFilter) DrawEx

func (t *TextFilter) DrawEx(label string, width float64) bool

func (*TextFilter) Init

func (t *TextFilter) Init(ctx *Context, default_filter string)

func (*TextFilter) IsActive

func (t *TextFilter) IsActive() bool

func (*TextFilter) PassFilter

func (t *TextFilter) PassFilter(text string) bool

type TextureID

type TextureID interface{}

type TreeNodeFlags

type TreeNodeFlags int
const (
	TreeNodeFlagsSelected          TreeNodeFlags = 1 << 0  // Draw as selected
	TreeNodeFlagsFramed            TreeNodeFlags = 1 << 1  // Full colored frame (e.g. for CollapsingHeader)
	TreeNodeFlagsAllowItemOverlap  TreeNodeFlags = 1 << 2  // Hit testing to allow subsequent widgets to overlap this one
	TreeNodeFlagsNoTreePushOnOpen  TreeNodeFlags = 1 << 3  // Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
	TreeNodeFlagsNoAutoOpenOnLog   TreeNodeFlags = 1 << 4  // Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes)
	TreeNodeFlagsDefaultOpen       TreeNodeFlags = 1 << 5  // Default node to be open
	TreeNodeFlagsOpenOnDoubleClick TreeNodeFlags = 1 << 6  // Need double-click to open node
	TreeNodeFlagsOpenOnArrow       TreeNodeFlags = 1 << 7  // Only open when clicking on the arrow part. If TreeNodeFlagsOpenOnDoubleClick is also set single-click arrow or double-click all box to open.
	TreeNodeFlagsLeaf              TreeNodeFlags = 1 << 8  // No collapsing no arrow (use as a convenience for leaf nodes).
	TreeNodeFlagsBullet            TreeNodeFlags = 1 << 9  // Display a bullet instead of arrow
	TreeNodeFlagsFramePadding      TreeNodeFlags = 1 << 10 // Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding().
	//ImGuITreeNodeFlags_SpanAllAvailWidth TreeNodeFlags = 1 << 11  // FIXME: TODO: Extend hit box horizontally even if not framed
	//TreeNodeFlagsNoScrollOnOpen   TreeNodeFlags  = 1 << 12  // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible
	TreeNodeFlagsNavLeftJumpsBackHere TreeNodeFlags = 1 << 13 // (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop)
	TreeNodeFlagsCollapsingHeader     TreeNodeFlags = TreeNodeFlagsFramed | TreeNodeFlagsNoAutoOpenOnLog
)

type Window

type Window struct {
	Ctx                            *Context
	Name                           string
	ID                             ID            // == ImHash(Name)
	Flags                          WindowFlags   // See enum ImGuiWindowFlags_
	Pos                            f64.Vec2      // Position rounded-up to nearest pixel
	Size                           f64.Vec2      // Current size (==SizeFull or collapsed title bar size)
	SizeFull                       f64.Vec2      // Size when non collapsed
	SizeFullAtLastBegin            f64.Vec2      // Copy of SizeFull at the end of Begin. This is the reference value we'll use on the next frame to decide if we need scrollbars.
	SizeContents                   f64.Vec2      // Size of contents (== extents reach of the drawing cursor) from previous frame. Include decoration, window title, border, menu, etc.
	SizeContentsExplicit           f64.Vec2      // Size of contents explicitly set by the user via SetNextWindowContentSize()
	ContentsRegionRect             f64.Rectangle // Maximum visible content position in window coordinates. ~~ (SizeContentsExplicit ? SizeContentsExplicit : Size - ScrollbarSizes) - CursorStartPos, per axis
	WindowPadding                  f64.Vec2      // Window padding at the time of begin.
	WindowRounding                 float64       // Window rounding at the time of begin.
	WindowBorderSize               float64       // Window border size at the time of begin.
	MoveId                         ID            // == window->GetID("#MOVE")
	ChildId                        ID            // Id of corresponding item in parent window (for child windows)
	Scroll                         f64.Vec2
	ScrollTarget                   f64.Vec2 // target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change)
	ScrollTargetCenterRatio        f64.Vec2 // 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered
	ScrollbarSizes                 f64.Vec2
	ScrollbarX, ScrollbarY         bool
	Active                         bool // Set to true on Begin(), unless Collapsed
	WasActive                      bool
	WriteAccessed                  bool // Set to true when any widget access the current window
	Collapsed                      bool // Set when collapsing window to become only title-bar
	CollapseToggleWanted           bool
	SkipItems                      bool // Set when items can safely be all clipped (e.g. window not visible or collapsed)
	Appearing                      bool // Set during the frame where the window is appearing (or re-appearing)
	CloseButton                    bool // Set when the window has a close button (p_open != NULL)
	BeginOrderWithinParent         int  // Order within immediate parent window, if we are a child window. Otherwise 0.
	BeginOrderWithinContext        int  // Order within entire imgui context. This is mostly used for debugging submission order related issues.
	BeginCount                     int  // Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
	PopupId                        ID   // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
	AutoFitFramesX, AutoFitFramesY int
	AutoFitOnlyGrows               bool
	AutoFitChildAxises             int
	AutoPosLastDirection           Dir
	HiddenFrames                   int
	SetWindowPosAllowFlags         Cond          // store acceptable condition flags for SetNextWindowPos() use.
	SetWindowSizeAllowFlags        Cond          // store acceptable condition flags for SetNextWindowSize() use.
	SetWindowCollapsedAllowFlags   Cond          // store acceptable condition flags for SetNextWindowCollapsed() use.
	SetWindowPosVal                f64.Vec2      // store window position when using a non-zero Pivot (position set needs to be processed when we know the window size)
	SetWindowPosPivot              f64.Vec2      // store window pivot for positioning. ImVec2(0,0) when positioning from top-left corner; ImVec2(0.5f,0.5f) for centering; ImVec2(1,1) for bottom right.
	DC                             DrawContext   // Temporary per-window data, reset at the beginning of the frame
	IDStack                        []ID          // ID stack. ID are hashes seeded with the value at the top of the stack
	ClipRect                       f64.Rectangle // = DrawList->clip_rect_stack.back(). Scissoring / clipping rectangle. x1, y1, x2, y2.
	WindowRectClipped              f64.Rectangle // = WindowRect just after setup in Begin(). == window->Rect() for root window.
	InnerRect, InnerClipRect       f64.Rectangle
	LastFrameActive                int
	ItemWidthDefault               float64
	MenuColumns                    MenuColumns // Simplified columns storage for menu items
	StateStorage                   map[ID]interface{}
	ColumnsStorage                 []ColumnsSet
	FontWindowScale                float64   // User scale multiplier per-window
	DrawList                       *DrawList // == &DrawListInst (for backward compatibility reason with code using imgui_internal.h we keep this a pointer)
	DrawListInst                   DrawList
	ParentWindow                   *Window // If we are a child _or_ popup window, this is pointing to our parent. Otherwise NULL.
	RootWindow                     *Window // Point to ourself or first ancestor that is not a child window.
	RootWindowForTitleBarHighlight *Window // Point to ourself or first ancestor which will display TitleBgActive color when this window is active.
	RootWindowForTabbing           *Window // Point to ourself or first ancestor which can be CTRL-Tabbed into.
	RootWindowForNav               *Window // Point to ourself or first ancestor which doesn't have the NavFlattened flag.

	NavLastChildNavWindow *Window          // When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.)
	NavLastIds            [2]ID            // Last known NavId for this window, per layer (0/1)
	NavRectRel            [2]f64.Rectangle // Reference rectangle, in window relative space

	// Navigation / Focus
	// FIXME-NAV: Merge all this with the new Nav system, at least the request variables should be moved to ImGuiContext
	FocusIdxAllCounter        int // Start at -1 and increase as assigned via FocusItemRegister()
	FocusIdxTabCounter        int // (same, but only count widgets which you can Tab through)
	FocusIdxAllRequestCurrent int // Item being requested for focus
	FocusIdxTabRequestCurrent int // Tab-able item being requested for focus
	FocusIdxAllRequestNext    int // Item being requested for focus, for next update (relies on layout to be stable between the frame pressing TAB and the next frame)
	FocusIdxTabRequestNext    int // "
}

func (*Window) CalcFontSize

func (w *Window) CalcFontSize() float64

func (*Window) GetID

func (w *Window) GetID(str string) ID

func (*Window) GetIDFromRectangle

func (w *Window) GetIDFromRectangle(r_abs f64.Rectangle) ID

This is only used in rare/specific situations to manufacture an ID out of nowhere.

func (*Window) GetIDNoKeepAlive

func (w *Window) GetIDNoKeepAlive(str string) ID

func (*Window) GetIntID

func (w *Window) GetIntID(n int) ID

func (*Window) GetWindowBgColorIdxFromFlags

func (w *Window) GetWindowBgColorIdxFromFlags(flags WindowFlags) Col

func (*Window) Init

func (w *Window) Init(ctx *Context, name string)

func (*Window) MenuBarHeight

func (w *Window) MenuBarHeight() float64

func (*Window) MenuBarRect

func (w *Window) MenuBarRect() f64.Rectangle

func (*Window) Rect

func (w *Window) Rect() f64.Rectangle

func (*Window) TitleBarHeight

func (w *Window) TitleBarHeight() float64

func (*Window) TitleBarRect

func (w *Window) TitleBarRect() f64.Rectangle

type WindowFlags

type WindowFlags int
const (
	WindowFlagsNoTitleBar        WindowFlags = 1 << 0 // Disable title-bar
	WindowFlagsNoResize          WindowFlags = 1 << 1 // Disable user resizing with the lower-right grip
	WindowFlagsNoMove            WindowFlags = 1 << 2 // Disable user moving the window
	WindowFlagsNoScrollbar       WindowFlags = 1 << 3 // Disable scrollbars (window can still scroll with mouse or programatically)
	WindowFlagsNoScrollWithMouse WindowFlags = 1 << 4 // Disable user vertically scrolling with mouse wheel. On child window mouse wheel will be forwarded to the parent unless NoScrollbar is also set.
	WindowFlagsNoCollapse        WindowFlags = 1 << 5 // Disable user collapsing window by double-clicking on it
	WindowFlagsAlwaysAutoResize  WindowFlags = 1 << 6 // Resize every window to its content every frame
	//WindowFlagsShowBorders   WindowFlags       = 1 << 7   // Show borders around windows and items (OBSOLETE! Use e.g. style.FrameBorderSize=1.0f to enable borders).
	WindowFlagsNoSavedSettings           WindowFlags = 1 << 8  // Never load/save settings in .ini file
	WindowFlagsNoInputs                  WindowFlags = 1 << 9  // Disable catching mouse or keyboard inputs hovering test with pass through.
	WindowFlagsMenuBar                   WindowFlags = 1 << 10 // Has a menu-bar
	WindowFlagsHorizontalScrollbar       WindowFlags = 1 << 11 // Allow horizontal scrollbar to appear (off by default). You may use SetNextWindowContentSize(ImVec2(width0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo in the "Horizontal Scrolling" section.
	WindowFlagsNoFocusOnAppearing        WindowFlags = 1 << 12 // Disable taking focus when transitioning from hidden to visible state
	WindowFlagsNoBringToFrontOnFocus     WindowFlags = 1 << 13 // Disable bringing window to front when taking focus (e.g. clicking on it or programatically giving it focus)
	WindowFlagsAlwaysVerticalScrollbar   WindowFlags = 1 << 14 // Always show vertical scrollbar (even if ContentSize.y < Size.y)
	WindowFlagsAlwaysHorizontalScrollbar WindowFlags = 1 << 15 // Always show horizontal scrollbar (even if ContentSize.x < Size.x)
	WindowFlagsAlwaysUseWindowPadding    WindowFlags = 1 << 16 // Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows because more convenient)
	WindowFlagsResizeFromAnySide         WindowFlags = 1 << 17 // (WIP) Enable resize from any corners and borders. Your back-end needs to honor the different values of io.MouseCursor set by imgui.
	WindowFlagsNoNavInputs               WindowFlags = 1 << 18 // No gamepad/keyboard navigation within the window
	WindowFlagsNoNavFocus                WindowFlags = 1 << 19 // No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB)
	WindowFlagsNoNav                     WindowFlags = WindowFlagsNoNavInputs | WindowFlagsNoNavFocus

	// [Internal]
	WindowFlagsNavFlattened WindowFlags = 1 << 23 // (WIP) Allow gamepad/keyboard navigation to cross over parent border to this child (only use on child that have no scrolling!)
	WindowFlagsChildWindow  WindowFlags = 1 << 24 // Don't use! For internal use by BeginChild()
	WindowFlagsTooltip      WindowFlags = 1 << 25 // Don't use! For internal use by BeginTooltip()
	WindowFlagsPopup        WindowFlags = 1 << 26 // Don't use! For internal use by BeginPopup()
	WindowFlagsModal        WindowFlags = 1 << 27 // Don't use! For internal use by BeginPopupModal()
	WindowFlagsChildMenu    WindowFlags = 1 << 28 // Don't use! For internal use by BeginMenu()
)

type WindowSettings

type WindowSettings struct {
	Name      string
	Id        ID
	Pos       f64.Vec2
	Size      f64.Vec2
	Collapsed bool
}

func (*WindowSettings) Init

func (s *WindowSettings) Init()

Directories

Path Synopsis
+build ignore
+build ignore

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL