imgui-bindings 0.1.7 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
data/lib/imgui.rb CHANGED
@@ -13,6 +13,7 @@ FFI.typedef :pointer, :ImDrawListSharedData
13
13
  FFI.typedef :int, :ImFontAtlasFlags
14
14
  FFI.typedef :int, :ImGuiBackendFlags
15
15
  FFI.typedef :int, :ImGuiButtonFlags
16
+ FFI.typedef :int, :ImGuiChildFlags
16
17
  FFI.typedef :int, :ImGuiCol
17
18
  FFI.typedef :int, :ImGuiColorEditFlags
18
19
  FFI.typedef :int, :ImGuiComboFlags
@@ -110,6 +111,26 @@ ImGuiButtonFlags_MouseButtonMiddle = 4 # 1 << 2 # React on center mouse button
110
111
  ImGuiButtonFlags_MouseButtonMask_ = 7 # ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_MouseButtonMiddle
111
112
  ImGuiButtonFlags_MouseButtonDefault_ = 1 # ImGuiButtonFlags_MouseButtonLeft
112
113
 
114
+ # ImGuiChildFlags_
115
+ # Flags for ImGui::BeginChild()
116
+ # (Legacy: bot 0 must always correspond to ImGuiChildFlags_Border to be backward compatible with old API using 'bool border = false'.
117
+ # About using AutoResizeX/AutoResizeY flags:
118
+ # - May be combined with SetNextWindowSizeConstraints() to set a min/max size for each axis (see "Demo->Child->Auto-resize with Constraints").
119
+ # - Size measurement for a given axis is only performed when the child window is within visible boundaries, or is just appearing.
120
+ # - This allows BeginChild() to return false when not within boundaries (e.g. when scrolling), which is more optimal. BUT it won't update its auto-size while clipped.
121
+ # While not perfect, it is a better default behavior as the always-on performance gain is more valuable than the occasional "resizing after becoming visible again" glitch.
122
+ # - You may also use ImGuiChildFlags_AlwaysAutoResize to force an update even when child window is not in view.
123
+ # HOWEVER PLEASE UNDERSTAND THAT DOING SO WILL PREVENT BeginChild() FROM EVER RETURNING FALSE, disabling benefits of coarse clipping.
124
+ ImGuiChildFlags_None = 0 # 0
125
+ ImGuiChildFlags_Border = 1 # 1 << 0 # Show an outer border and enable WindowPadding. (Important: this is always == 1 == true for legacy reason)
126
+ ImGuiChildFlags_AlwaysUseWindowPadding = 2 # 1 << 1 # Pad with style.WindowPadding even if no border are drawn (no padding by default for non-bordered child windows because it makes more sense)
127
+ ImGuiChildFlags_ResizeX = 4 # 1 << 2 # Allow resize from right border (layout direction). Enable .ini saving (unless ImGuiWindowFlags_NoSavedSettings passed to window flags)
128
+ ImGuiChildFlags_ResizeY = 8 # 1 << 3 # Allow resize from bottom border (layout direction). "
129
+ ImGuiChildFlags_AutoResizeX = 16 # 1 << 4 # Enable auto-resizing width. Read "IMPORTANT: Size measurement" details above.
130
+ ImGuiChildFlags_AutoResizeY = 32 # 1 << 5 # Enable auto-resizing height. Read "IMPORTANT: Size measurement" details above.
131
+ ImGuiChildFlags_AlwaysAutoResize = 64 # 1 << 6 # Combined with AutoResizeX/AutoResizeY. Always measure size even when child is hidden, always return true, always disable clipping optimization! NOT RECOMMENDED.
132
+ ImGuiChildFlags_FrameStyle = 128 # 1 << 7 # Style the child window like a framed item: use FrameBg, FrameRounding, FrameBorderSize, FramePadding instead of ChildBg, ChildRounding, ChildBorderSize, WindowPadding.
133
+
113
134
  # ImGuiCol_
114
135
  # Enumeration for PushStyleColor() / PopStyleColor()
115
136
  ImGuiCol_Text = 0 # 0
@@ -201,15 +222,16 @@ ImGuiColorEditFlags_InputMask_ = 402653184 # ImGuiColorEditFlags_InputRGB |
201
222
 
202
223
  # ImGuiComboFlags_
203
224
  # Flags for ImGui::BeginCombo()
204
- ImGuiComboFlags_None = 0 # 0
205
- ImGuiComboFlags_PopupAlignLeft = 1 # 1 << 0 # Align the popup toward the left by default
206
- ImGuiComboFlags_HeightSmall = 2 # 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()
207
- ImGuiComboFlags_HeightRegular = 4 # 1 << 2 # Max ~8 items visible (default)
208
- ImGuiComboFlags_HeightLarge = 8 # 1 << 3 # Max ~20 items visible
209
- ImGuiComboFlags_HeightLargest = 16 # 1 << 4 # As many fitting items as possible
210
- ImGuiComboFlags_NoArrowButton = 32 # 1 << 5 # Display on the preview box without the square arrow button
211
- ImGuiComboFlags_NoPreview = 64 # 1 << 6 # Display only a square arrow button
212
- ImGuiComboFlags_HeightMask_ = 30 # ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest
225
+ ImGuiComboFlags_None = 0 # 0
226
+ ImGuiComboFlags_PopupAlignLeft = 1 # 1 << 0 # Align the popup toward the left by default
227
+ ImGuiComboFlags_HeightSmall = 2 # 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()
228
+ ImGuiComboFlags_HeightRegular = 4 # 1 << 2 # Max ~8 items visible (default)
229
+ ImGuiComboFlags_HeightLarge = 8 # 1 << 3 # Max ~20 items visible
230
+ ImGuiComboFlags_HeightLargest = 16 # 1 << 4 # As many fitting items as possible
231
+ ImGuiComboFlags_NoArrowButton = 32 # 1 << 5 # Display on the preview box without the square arrow button
232
+ ImGuiComboFlags_NoPreview = 64 # 1 << 6 # Display only a square arrow button
233
+ ImGuiComboFlags_WidthFitPreview = 128 # 1 << 7 # Width dynamically calculated from preview contents
234
+ ImGuiComboFlags_HeightMask_ = 30 # ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest
213
235
 
214
236
  # ImGuiCond_
215
237
  # Enumeration for ImGui::SetWindow***(), SetNextWindow***(), SetNextItem***() functions
@@ -297,12 +319,12 @@ ImGuiHoveredFlags_NoNavOverride = 2048 # 1 << 11 # IsItemHovered()
297
319
  ImGuiHoveredFlags_AllowWhenOverlapped = 768 # ImGuiHoveredFlags_AllowWhenOverlappedByItem | ImGuiHoveredFlags_AllowWhenOverlappedByWindow
298
320
  ImGuiHoveredFlags_RectOnly = 928 # ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped
299
321
  ImGuiHoveredFlags_RootAndChildWindows = 3 # ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows
300
- ImGuiHoveredFlags_ForTooltip = 2048 # 1 << 11 # Shortcut for standard flags when using IsItemHovered() + SetTooltip() sequence.
301
- ImGuiHoveredFlags_Stationary = 4096 # 1 << 12 # Require mouse to be stationary for style.HoverStationaryDelay (~0.15 sec) _at least one time_. After this, can move on same item/window. Using the stationary test tends to reduces the need for a long delay.
302
- ImGuiHoveredFlags_DelayNone = 8192 # 1 << 13 # IsItemHovered() only: Return true immediately (default). As this is the default you generally ignore this.
303
- ImGuiHoveredFlags_DelayShort = 16384 # 1 << 14 # IsItemHovered() only: Return true after style.HoverDelayShort elapsed (~0.15 sec) (shared between items) + requires mouse to be stationary for style.HoverStationaryDelay (once per item).
304
- ImGuiHoveredFlags_DelayNormal = 32768 # 1 << 15 # IsItemHovered() only: Return true after style.HoverDelayNormal elapsed (~0.40 sec) (shared between items) + requires mouse to be stationary for style.HoverStationaryDelay (once per item).
305
- ImGuiHoveredFlags_NoSharedDelay = 65536 # 1 << 16 # IsItemHovered() only: Disable shared delay system where moving from one item to the next keeps the previous timer for a short time (standard for tooltips with long delays)
322
+ ImGuiHoveredFlags_ForTooltip = 4096 # 1 << 12 # Shortcut for standard flags when using IsItemHovered() + SetTooltip() sequence.
323
+ ImGuiHoveredFlags_Stationary = 8192 # 1 << 13 # Require mouse to be stationary for style.HoverStationaryDelay (~0.15 sec) _at least one time_. After this, can move on same item/window. Using the stationary test tends to reduces the need for a long delay.
324
+ ImGuiHoveredFlags_DelayNone = 16384 # 1 << 14 # IsItemHovered() only: Return true immediately (default). As this is the default you generally ignore this.
325
+ ImGuiHoveredFlags_DelayShort = 32768 # 1 << 15 # IsItemHovered() only: Return true after style.HoverDelayShort elapsed (~0.15 sec) (shared between items) + requires mouse to be stationary for style.HoverStationaryDelay (once per item).
326
+ ImGuiHoveredFlags_DelayNormal = 65536 # 1 << 16 # IsItemHovered() only: Return true after style.HoverDelayNormal elapsed (~0.40 sec) (shared between items) + requires mouse to be stationary for style.HoverStationaryDelay (once per item).
327
+ ImGuiHoveredFlags_NoSharedDelay = 131072 # 1 << 17 # IsItemHovered() only: Disable shared delay system where moving from one item to the next keeps the previous timer for a short time (standard for tooltips with long delays)
306
328
 
307
329
  # ImGuiInputTextFlags_
308
330
  # Flags for ImGui::InputText()
@@ -409,75 +431,89 @@ ImGuiKey_F9 = 580 # 580
409
431
  ImGuiKey_F10 = 581 # 581
410
432
  ImGuiKey_F11 = 582 # 582
411
433
  ImGuiKey_F12 = 583 # 583
412
- ImGuiKey_Apostrophe = 584 # 584 # '
413
- ImGuiKey_Comma = 585 # 585 # ,
414
- ImGuiKey_Minus = 586 # 586 # -
415
- ImGuiKey_Period = 587 # 587 # .
416
- ImGuiKey_Slash = 588 # 588 # /
417
- ImGuiKey_Semicolon = 589 # 589 # ;
418
- ImGuiKey_Equal = 590 # 590 # =
419
- ImGuiKey_LeftBracket = 591 # 591 # [
420
- ImGuiKey_Backslash = 592 # 592 # \ (this text inhibit multiline comment caused by backslash)
421
- ImGuiKey_RightBracket = 593 # 593 # ]
422
- ImGuiKey_GraveAccent = 594 # 594 # `
423
- ImGuiKey_CapsLock = 595 # 595
424
- ImGuiKey_ScrollLock = 596 # 596
425
- ImGuiKey_NumLock = 597 # 597
426
- ImGuiKey_PrintScreen = 598 # 598
427
- ImGuiKey_Pause = 599 # 599
428
- ImGuiKey_Keypad0 = 600 # 600
429
- ImGuiKey_Keypad1 = 601 # 601
430
- ImGuiKey_Keypad2 = 602 # 602
431
- ImGuiKey_Keypad3 = 603 # 603
432
- ImGuiKey_Keypad4 = 604 # 604
433
- ImGuiKey_Keypad5 = 605 # 605
434
- ImGuiKey_Keypad6 = 606 # 606
435
- ImGuiKey_Keypad7 = 607 # 607
436
- ImGuiKey_Keypad8 = 608 # 608
437
- ImGuiKey_Keypad9 = 609 # 609
438
- ImGuiKey_KeypadDecimal = 610 # 610
439
- ImGuiKey_KeypadDivide = 611 # 611
440
- ImGuiKey_KeypadMultiply = 612 # 612
441
- ImGuiKey_KeypadSubtract = 613 # 613
442
- ImGuiKey_KeypadAdd = 614 # 614
443
- ImGuiKey_KeypadEnter = 615 # 615
444
- ImGuiKey_KeypadEqual = 616 # 616
445
- ImGuiKey_GamepadStart = 617 # 617 # Menu (Xbox) + (Switch) Start/Options (PS)
446
- ImGuiKey_GamepadBack = 618 # 618 # View (Xbox) - (Switch) Share (PS)
447
- ImGuiKey_GamepadFaceLeft = 619 # 619 # X (Xbox) Y (Switch) Square (PS) // Tap: Toggle Menu. Hold: Windowing mode (Focus/Move/Resize windows)
448
- ImGuiKey_GamepadFaceRight = 620 # 620 # B (Xbox) A (Switch) Circle (PS) // Cancel / Close / Exit
449
- ImGuiKey_GamepadFaceUp = 621 # 621 # Y (Xbox) X (Switch) Triangle (PS) // Text Input / On-screen Keyboard
450
- ImGuiKey_GamepadFaceDown = 622 # 622 # A (Xbox) B (Switch) Cross (PS) // Activate / Open / Toggle / Tweak
451
- ImGuiKey_GamepadDpadLeft = 623 # 623 # D-pad Left // Move / Tweak / Resize Window (in Windowing mode)
452
- ImGuiKey_GamepadDpadRight = 624 # 624 # D-pad Right // Move / Tweak / Resize Window (in Windowing mode)
453
- ImGuiKey_GamepadDpadUp = 625 # 625 # D-pad Up // Move / Tweak / Resize Window (in Windowing mode)
454
- ImGuiKey_GamepadDpadDown = 626 # 626 # D-pad Down // Move / Tweak / Resize Window (in Windowing mode)
455
- ImGuiKey_GamepadL1 = 627 # 627 # L Bumper (Xbox) L (Switch) L1 (PS) // Tweak Slower / Focus Previous (in Windowing mode)
456
- ImGuiKey_GamepadR1 = 628 # 628 # R Bumper (Xbox) R (Switch) R1 (PS) // Tweak Faster / Focus Next (in Windowing mode)
457
- ImGuiKey_GamepadL2 = 629 # 629 # L Trig. (Xbox) ZL (Switch) L2 (PS) [Analog]
458
- ImGuiKey_GamepadR2 = 630 # 630 # R Trig. (Xbox) ZR (Switch) R2 (PS) [Analog]
459
- ImGuiKey_GamepadL3 = 631 # 631 # L Stick (Xbox) L3 (Switch) L3 (PS)
460
- ImGuiKey_GamepadR3 = 632 # 632 # R Stick (Xbox) R3 (Switch) R3 (PS)
461
- ImGuiKey_GamepadLStickLeft = 633 # 633 # [Analog] // Move Window (in Windowing mode)
462
- ImGuiKey_GamepadLStickRight = 634 # 634 # [Analog] // Move Window (in Windowing mode)
463
- ImGuiKey_GamepadLStickUp = 635 # 635 # [Analog] // Move Window (in Windowing mode)
464
- ImGuiKey_GamepadLStickDown = 636 # 636 # [Analog] // Move Window (in Windowing mode)
465
- ImGuiKey_GamepadRStickLeft = 637 # 637 # [Analog]
466
- ImGuiKey_GamepadRStickRight = 638 # 638 # [Analog]
467
- ImGuiKey_GamepadRStickUp = 639 # 639 # [Analog]
468
- ImGuiKey_GamepadRStickDown = 640 # 640 # [Analog]
469
- ImGuiKey_MouseLeft = 641 # 641
470
- ImGuiKey_MouseRight = 642 # 642
471
- ImGuiKey_MouseMiddle = 643 # 643
472
- ImGuiKey_MouseX1 = 644 # 644
473
- ImGuiKey_MouseX2 = 645 # 645
474
- ImGuiKey_MouseWheelX = 646 # 646
475
- ImGuiKey_MouseWheelY = 647 # 647
476
- ImGuiKey_ReservedForModCtrl = 648 # 648
477
- ImGuiKey_ReservedForModShift = 649 # 649
478
- ImGuiKey_ReservedForModAlt = 650 # 650
479
- ImGuiKey_ReservedForModSuper = 651 # 651
480
- ImGuiKey_COUNT = 652 # 652
434
+ ImGuiKey_F13 = 584 # 584
435
+ ImGuiKey_F14 = 585 # 585
436
+ ImGuiKey_F15 = 586 # 586
437
+ ImGuiKey_F16 = 587 # 587
438
+ ImGuiKey_F17 = 588 # 588
439
+ ImGuiKey_F18 = 589 # 589
440
+ ImGuiKey_F19 = 590 # 590
441
+ ImGuiKey_F20 = 591 # 591
442
+ ImGuiKey_F21 = 592 # 592
443
+ ImGuiKey_F22 = 593 # 593
444
+ ImGuiKey_F23 = 594 # 594
445
+ ImGuiKey_F24 = 595 # 595
446
+ ImGuiKey_Apostrophe = 596 # 596 # '
447
+ ImGuiKey_Comma = 597 # 597 # ,
448
+ ImGuiKey_Minus = 598 # 598 # -
449
+ ImGuiKey_Period = 599 # 599 # .
450
+ ImGuiKey_Slash = 600 # 600 # /
451
+ ImGuiKey_Semicolon = 601 # 601 # ;
452
+ ImGuiKey_Equal = 602 # 602 # =
453
+ ImGuiKey_LeftBracket = 603 # 603 # [
454
+ ImGuiKey_Backslash = 604 # 604 # \ (this text inhibit multiline comment caused by backslash)
455
+ ImGuiKey_RightBracket = 605 # 605 # ]
456
+ ImGuiKey_GraveAccent = 606 # 606 # `
457
+ ImGuiKey_CapsLock = 607 # 607
458
+ ImGuiKey_ScrollLock = 608 # 608
459
+ ImGuiKey_NumLock = 609 # 609
460
+ ImGuiKey_PrintScreen = 610 # 610
461
+ ImGuiKey_Pause = 611 # 611
462
+ ImGuiKey_Keypad0 = 612 # 612
463
+ ImGuiKey_Keypad1 = 613 # 613
464
+ ImGuiKey_Keypad2 = 614 # 614
465
+ ImGuiKey_Keypad3 = 615 # 615
466
+ ImGuiKey_Keypad4 = 616 # 616
467
+ ImGuiKey_Keypad5 = 617 # 617
468
+ ImGuiKey_Keypad6 = 618 # 618
469
+ ImGuiKey_Keypad7 = 619 # 619
470
+ ImGuiKey_Keypad8 = 620 # 620
471
+ ImGuiKey_Keypad9 = 621 # 621
472
+ ImGuiKey_KeypadDecimal = 622 # 622
473
+ ImGuiKey_KeypadDivide = 623 # 623
474
+ ImGuiKey_KeypadMultiply = 624 # 624
475
+ ImGuiKey_KeypadSubtract = 625 # 625
476
+ ImGuiKey_KeypadAdd = 626 # 626
477
+ ImGuiKey_KeypadEnter = 627 # 627
478
+ ImGuiKey_KeypadEqual = 628 # 628
479
+ ImGuiKey_AppBack = 629 # 629 # Available on some keyboard/mouses. Often referred as "Browser Back"
480
+ ImGuiKey_AppForward = 630 # 630
481
+ ImGuiKey_GamepadStart = 631 # 631 # Menu (Xbox) + (Switch) Start/Options (PS)
482
+ ImGuiKey_GamepadBack = 632 # 632 # View (Xbox) - (Switch) Share (PS)
483
+ ImGuiKey_GamepadFaceLeft = 633 # 633 # X (Xbox) Y (Switch) Square (PS) // Tap: Toggle Menu. Hold: Windowing mode (Focus/Move/Resize windows)
484
+ ImGuiKey_GamepadFaceRight = 634 # 634 # B (Xbox) A (Switch) Circle (PS) // Cancel / Close / Exit
485
+ ImGuiKey_GamepadFaceUp = 635 # 635 # Y (Xbox) X (Switch) Triangle (PS) // Text Input / On-screen Keyboard
486
+ ImGuiKey_GamepadFaceDown = 636 # 636 # A (Xbox) B (Switch) Cross (PS) // Activate / Open / Toggle / Tweak
487
+ ImGuiKey_GamepadDpadLeft = 637 # 637 # D-pad Left // Move / Tweak / Resize Window (in Windowing mode)
488
+ ImGuiKey_GamepadDpadRight = 638 # 638 # D-pad Right // Move / Tweak / Resize Window (in Windowing mode)
489
+ ImGuiKey_GamepadDpadUp = 639 # 639 # D-pad Up // Move / Tweak / Resize Window (in Windowing mode)
490
+ ImGuiKey_GamepadDpadDown = 640 # 640 # D-pad Down // Move / Tweak / Resize Window (in Windowing mode)
491
+ ImGuiKey_GamepadL1 = 641 # 641 # L Bumper (Xbox) L (Switch) L1 (PS) // Tweak Slower / Focus Previous (in Windowing mode)
492
+ ImGuiKey_GamepadR1 = 642 # 642 # R Bumper (Xbox) R (Switch) R1 (PS) // Tweak Faster / Focus Next (in Windowing mode)
493
+ ImGuiKey_GamepadL2 = 643 # 643 # L Trig. (Xbox) ZL (Switch) L2 (PS) [Analog]
494
+ ImGuiKey_GamepadR2 = 644 # 644 # R Trig. (Xbox) ZR (Switch) R2 (PS) [Analog]
495
+ ImGuiKey_GamepadL3 = 645 # 645 # L Stick (Xbox) L3 (Switch) L3 (PS)
496
+ ImGuiKey_GamepadR3 = 646 # 646 # R Stick (Xbox) R3 (Switch) R3 (PS)
497
+ ImGuiKey_GamepadLStickLeft = 647 # 647 # [Analog] // Move Window (in Windowing mode)
498
+ ImGuiKey_GamepadLStickRight = 648 # 648 # [Analog] // Move Window (in Windowing mode)
499
+ ImGuiKey_GamepadLStickUp = 649 # 649 # [Analog] // Move Window (in Windowing mode)
500
+ ImGuiKey_GamepadLStickDown = 650 # 650 # [Analog] // Move Window (in Windowing mode)
501
+ ImGuiKey_GamepadRStickLeft = 651 # 651 # [Analog]
502
+ ImGuiKey_GamepadRStickRight = 652 # 652 # [Analog]
503
+ ImGuiKey_GamepadRStickUp = 653 # 653 # [Analog]
504
+ ImGuiKey_GamepadRStickDown = 654 # 654 # [Analog]
505
+ ImGuiKey_MouseLeft = 655 # 655
506
+ ImGuiKey_MouseRight = 656 # 656
507
+ ImGuiKey_MouseMiddle = 657 # 657
508
+ ImGuiKey_MouseX1 = 658 # 658
509
+ ImGuiKey_MouseX2 = 659 # 659
510
+ ImGuiKey_MouseWheelX = 660 # 660
511
+ ImGuiKey_MouseWheelY = 661 # 661
512
+ ImGuiKey_ReservedForModCtrl = 662 # 662
513
+ ImGuiKey_ReservedForModShift = 663 # 663
514
+ ImGuiKey_ReservedForModAlt = 664 # 664
515
+ ImGuiKey_ReservedForModSuper = 665 # 665
516
+ ImGuiKey_COUNT = 666 # 666
481
517
  ImGuiMod_None = 0 # 0
482
518
  ImGuiMod_Ctrl = 4096 # 1 << 12 # Ctrl
483
519
  ImGuiMod_Shift = 8192 # 1 << 13 # Shift
@@ -486,10 +522,10 @@ ImGuiMod_Super = 32768 # 1 << 15 # Cmd/Super/Windows
486
522
  ImGuiMod_Shortcut = 2048 # 1 << 11 # Alias for Ctrl (non-macOS) _or_ Super (macOS).
487
523
  ImGuiMod_Mask_ = 63488 # 0xF800 # 5-bits
488
524
  ImGuiKey_NamedKey_BEGIN = 512 # 512
489
- ImGuiKey_NamedKey_END = 652 # ImGuiKey_COUNT
490
- ImGuiKey_NamedKey_COUNT = 140 # ImGuiKey_NamedKey_END - ImGuiKey_NamedKey_BEGIN
491
- ImGuiKey_KeysData_SIZE = 652 # ImGuiKey_COUNT # Size of KeysData[]: hold legacy 0..512 keycodes + named keys
492
- ImGuiKey_KeysData_OFFSET = 0 # 0 # Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET) index.
525
+ ImGuiKey_NamedKey_END = 666 # ImGuiKey_COUNT
526
+ ImGuiKey_NamedKey_COUNT = 154 # ImGuiKey_NamedKey_END - ImGuiKey_NamedKey_BEGIN
527
+ ImGuiKey_KeysData_SIZE = 154 # ImGuiKey_NamedKey_COUNT # Size of KeysData[]: hold legacy 0..512 keycodes + named keys
528
+ ImGuiKey_KeysData_OFFSET = 512 # ImGuiKey_NamedKey_BEGIN # Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET) index.
493
529
 
494
530
  # ImGuiMouseButton_
495
531
  # Identify a mouse button.
@@ -524,28 +560,6 @@ ImGuiMouseSource_TouchScreen = 1 # 1 # Input is coming from a touch screen (no h
524
560
  ImGuiMouseSource_Pen = 2 # 2 # Input is coming from a pressure/magnetic pen (often used in conjunction with high-sampling rates).
525
561
  ImGuiMouseSource_COUNT = 3 # 3
526
562
 
527
- # ImGuiNavInput
528
- # OBSOLETED in 1.88 (from July 2022): ImGuiNavInput and io.NavInputs[].
529
- # Official backends between 1.60 and 1.86: will keep working and feed gamepad inputs as long as IMGUI_DISABLE_OBSOLETE_KEYIO is not set.
530
- # Custom backends: feed gamepad inputs via io.AddKeyEvent() and ImGuiKey_GamepadXXX enums.
531
- ImGuiNavInput_Activate = 0 # 0
532
- ImGuiNavInput_Cancel = 1 # 1
533
- ImGuiNavInput_Input = 2 # 2
534
- ImGuiNavInput_Menu = 3 # 3
535
- ImGuiNavInput_DpadLeft = 4 # 4
536
- ImGuiNavInput_DpadRight = 5 # 5
537
- ImGuiNavInput_DpadUp = 6 # 6
538
- ImGuiNavInput_DpadDown = 7 # 7
539
- ImGuiNavInput_LStickLeft = 8 # 8
540
- ImGuiNavInput_LStickRight = 9 # 9
541
- ImGuiNavInput_LStickUp = 10 # 10
542
- ImGuiNavInput_LStickDown = 11 # 11
543
- ImGuiNavInput_FocusPrev = 12 # 12
544
- ImGuiNavInput_FocusNext = 13 # 13
545
- ImGuiNavInput_TweakSlow = 14 # 14
546
- ImGuiNavInput_TweakFast = 15 # 15
547
- ImGuiNavInput_COUNT = 16 # 16
548
-
549
563
  # ImGuiPopupFlags_
550
564
  # Flags for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() functions.
551
565
  # - To be backward compatible with older API which took an 'int mouse_button = 1' argument, we need to treat
@@ -571,7 +585,7 @@ ImGuiPopupFlags_AnyPopup = 384 # ImGuiPopupFlags_AnyPopupId | ImGu
571
585
  # Flags for ImGui::Selectable()
572
586
  ImGuiSelectableFlags_None = 0 # 0
573
587
  ImGuiSelectableFlags_DontClosePopups = 1 # 1 << 0 # Clicking this doesn't close parent popup window
574
- ImGuiSelectableFlags_SpanAllColumns = 2 # 1 << 1 # Selectable frame can span all columns (text will still fit in current column)
588
+ ImGuiSelectableFlags_SpanAllColumns = 2 # 1 << 1 # Frame will span all columns of its container table (text will still fit in current column)
575
589
  ImGuiSelectableFlags_AllowDoubleClick = 4 # 1 << 2 # Generate press events on double clicks too
576
590
  ImGuiSelectableFlags_Disabled = 8 # 1 << 3 # Cannot be selected, display grayed out text
577
591
  ImGuiSelectableFlags_AllowOverlap = 16 # 1 << 4 # (WIP) Hit testing to allow subsequent widgets to overlap this one
@@ -624,12 +638,13 @@ ImGuiStyleVar_ScrollbarRounding = 19 # 19 # float ScrollbarRounding
624
638
  ImGuiStyleVar_GrabMinSize = 20 # 20 # float GrabMinSize
625
639
  ImGuiStyleVar_GrabRounding = 21 # 21 # float GrabRounding
626
640
  ImGuiStyleVar_TabRounding = 22 # 22 # float TabRounding
627
- ImGuiStyleVar_ButtonTextAlign = 23 # 23 # ImVec2 ButtonTextAlign
628
- ImGuiStyleVar_SelectableTextAlign = 24 # 24 # ImVec2 SelectableTextAlign
629
- ImGuiStyleVar_SeparatorTextBorderSize = 25 # 25 # float SeparatorTextBorderSize
630
- ImGuiStyleVar_SeparatorTextAlign = 26 # 26 # ImVec2 SeparatorTextAlign
631
- ImGuiStyleVar_SeparatorTextPadding = 27 # 27 # ImVec2 SeparatorTextPadding
632
- ImGuiStyleVar_COUNT = 28 # 28
641
+ ImGuiStyleVar_TabBarBorderSize = 23 # 23 # float TabBarBorderSize
642
+ ImGuiStyleVar_ButtonTextAlign = 24 # 24 # ImVec2 ButtonTextAlign
643
+ ImGuiStyleVar_SelectableTextAlign = 25 # 25 # ImVec2 SelectableTextAlign
644
+ ImGuiStyleVar_SeparatorTextBorderSize = 26 # 26 # float SeparatorTextBorderSize
645
+ ImGuiStyleVar_SeparatorTextAlign = 27 # 27 # ImVec2 SeparatorTextAlign
646
+ ImGuiStyleVar_SeparatorTextPadding = 28 # 28 # ImVec2 SeparatorTextPadding
647
+ ImGuiStyleVar_COUNT = 29 # 29
633
648
 
634
649
  # ImGuiTabBarFlags_
635
650
  # Flags for ImGui::BeginTabBar()
@@ -687,12 +702,13 @@ ImGuiTableColumnFlags_NoClip = 256 # 1 << 8 # Disable clipping f
687
702
  ImGuiTableColumnFlags_NoSort = 512 # 1 << 9 # Disable ability to sort on this field (even if ImGuiTableFlags_Sortable is set on the table).
688
703
  ImGuiTableColumnFlags_NoSortAscending = 1024 # 1 << 10 # Disable ability to sort in the ascending direction.
689
704
  ImGuiTableColumnFlags_NoSortDescending = 2048 # 1 << 11 # Disable ability to sort in the descending direction.
690
- ImGuiTableColumnFlags_NoHeaderLabel = 4096 # 1 << 12 # TableHeadersRow() will not submit label for this column. Convenient for some small columns. Name will still appear in context menu.
705
+ ImGuiTableColumnFlags_NoHeaderLabel = 4096 # 1 << 12 # TableHeadersRow() will not submit horizontal label for this column. Convenient for some small columns. Name will still appear in context menu or in angled headers.
691
706
  ImGuiTableColumnFlags_NoHeaderWidth = 8192 # 1 << 13 # Disable header text width contribution to automatic column width.
692
707
  ImGuiTableColumnFlags_PreferSortAscending = 16384 # 1 << 14 # Make the initial sort direction Ascending when first sorting on this column (default).
693
708
  ImGuiTableColumnFlags_PreferSortDescending = 32768 # 1 << 15 # Make the initial sort direction Descending when first sorting on this column.
694
709
  ImGuiTableColumnFlags_IndentEnable = 65536 # 1 << 16 # Use current Indent value when entering cell (default for column 0).
695
710
  ImGuiTableColumnFlags_IndentDisable = 131072 # 1 << 17 # Ignore current Indent value when entering cell (default for columns > 0). Indentation changes _within_ the cell will still be honored.
711
+ ImGuiTableColumnFlags_AngledHeader = 262144 # 1 << 18 # TableHeadersRow() will submit an angled header row for this column. Note this will add an extra row.
696
712
  ImGuiTableColumnFlags_IsEnabled = 16777216 # 1 << 24 # Status: is enabled == not hidden by user/api (referred to as "Hide" in _DefaultHide and _NoHide) flags.
697
713
  ImGuiTableColumnFlags_IsVisible = 33554432 # 1 << 25 # Status: is visible == is enabled AND not clipped by scrolling.
698
714
  ImGuiTableColumnFlags_IsSorted = 67108864 # 1 << 26 # Status: is currently part of the sort specs
@@ -725,42 +741,43 @@ ImGuiTableColumnFlags_NoDirectResize_ = 1073741824 # 1 << 30 # [Internal] Disabl
725
741
  # - Using Stretch columns OFTEN DOES NOT MAKE SENSE if ScrollX is on, UNLESS you have specified a value for 'inner_width' in BeginTable().
726
742
  # If you specify a value for 'inner_width' then effectively the scrolling space is known and Stretch or mixed Fixed/Stretch columns become meaningful again.
727
743
  # - Read on documentation at the top of imgui_tables.cpp for details.
728
- ImGuiTableFlags_None = 0 # 0
729
- ImGuiTableFlags_Resizable = 1 # 1 << 0 # Enable resizing columns.
730
- ImGuiTableFlags_Reorderable = 2 # 1 << 1 # Enable reordering columns in header row (need calling TableSetupColumn() + TableHeadersRow() to display headers)
731
- ImGuiTableFlags_Hideable = 4 # 1 << 2 # Enable hiding/disabling columns in context menu.
732
- ImGuiTableFlags_Sortable = 8 # 1 << 3 # Enable sorting. Call TableGetSortSpecs() to obtain sort specs. Also see ImGuiTableFlags_SortMulti and ImGuiTableFlags_SortTristate.
733
- ImGuiTableFlags_NoSavedSettings = 16 # 1 << 4 # Disable persisting columns order, width and sort settings in the .ini file.
734
- ImGuiTableFlags_ContextMenuInBody = 32 # 1 << 5 # Right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow().
735
- ImGuiTableFlags_RowBg = 64 # 1 << 6 # Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent of calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually)
736
- ImGuiTableFlags_BordersInnerH = 128 # 1 << 7 # Draw horizontal borders between rows.
737
- ImGuiTableFlags_BordersOuterH = 256 # 1 << 8 # Draw horizontal borders at the top and bottom.
738
- ImGuiTableFlags_BordersInnerV = 512 # 1 << 9 # Draw vertical borders between columns.
739
- ImGuiTableFlags_BordersOuterV = 1024 # 1 << 10 # Draw vertical borders on the left and right sides.
740
- ImGuiTableFlags_BordersH = 384 # ImGuiTableFlags_BordersInnerH | ImGuiTableFlags_BordersOuterH # Draw horizontal borders.
741
- ImGuiTableFlags_BordersV = 1536 # ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersOuterV # Draw vertical borders.
742
- ImGuiTableFlags_BordersInner = 640 # ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersInnerH # Draw inner borders.
743
- ImGuiTableFlags_BordersOuter = 1280 # ImGuiTableFlags_BordersOuterV | ImGuiTableFlags_BordersOuterH # Draw outer borders.
744
- ImGuiTableFlags_Borders = 1920 # ImGuiTableFlags_BordersInner | ImGuiTableFlags_BordersOuter # Draw all borders.
745
- ImGuiTableFlags_NoBordersInBody = 2048 # 1 << 11 # [ALPHA] Disable vertical borders in columns Body (borders will always appear in Headers). -> May move to style
746
- ImGuiTableFlags_NoBordersInBodyUntilResize = 4096 # 1 << 12 # [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appear in Headers). -> May move to style
747
- ImGuiTableFlags_SizingFixedFit = 8192 # 1 << 13 # Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching contents width.
748
- ImGuiTableFlags_SizingFixedSame = 16384 # 2 << 13 # Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching the maximum contents width of all columns. Implicitly enable ImGuiTableFlags_NoKeepColumnsVisible.
749
- ImGuiTableFlags_SizingStretchProp = 24576 # 3 << 13 # Columns default to _WidthStretch with default weights proportional to each columns contents widths.
750
- ImGuiTableFlags_SizingStretchSame = 32768 # 4 << 13 # Columns default to _WidthStretch with default weights all equal, unless overridden by TableSetupColumn().
751
- ImGuiTableFlags_NoHostExtendX = 65536 # 1 << 16 # Make outer width auto-fit to columns, overriding outer_size.x value. Only available when ScrollX/ScrollY are disabled and Stretch columns are not used.
752
- ImGuiTableFlags_NoHostExtendY = 131072 # 1 << 17 # Make outer height stop exactly at outer_size.y (prevent auto-extending table past the limit). Only available when ScrollX/ScrollY are disabled. Data below the limit will be clipped and not visible.
753
- ImGuiTableFlags_NoKeepColumnsVisible = 262144 # 1 << 18 # Disable keeping column always minimally visible when ScrollX is off and table gets too small. Not recommended if columns are resizable.
754
- ImGuiTableFlags_PreciseWidths = 524288 # 1 << 19 # Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth.
755
- ImGuiTableFlags_NoClip = 1048576 # 1 << 20 # Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze().
756
- ImGuiTableFlags_PadOuterX = 2097152 # 1 << 21 # Default if BordersOuterV is on. Enable outermost padding. Generally desirable if you have headers.
757
- ImGuiTableFlags_NoPadOuterX = 4194304 # 1 << 22 # Default if BordersOuterV is off. Disable outermost padding.
758
- ImGuiTableFlags_NoPadInnerX = 8388608 # 1 << 23 # Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off).
759
- ImGuiTableFlags_ScrollX = 16777216 # 1 << 24 # Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this creates a child window, ScrollY is currently generally recommended when using ScrollX.
760
- ImGuiTableFlags_ScrollY = 33554432 # 1 << 25 # Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size.
761
- ImGuiTableFlags_SortMulti = 67108864 # 1 << 26 # Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1).
762
- ImGuiTableFlags_SortTristate = 134217728 # 1 << 27 # Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0).
763
- ImGuiTableFlags_SizingMask_ = 57344 # ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_SizingStretchSame
744
+ ImGuiTableFlags_None = 0 # 0
745
+ ImGuiTableFlags_Resizable = 1 # 1 << 0 # Enable resizing columns.
746
+ ImGuiTableFlags_Reorderable = 2 # 1 << 1 # Enable reordering columns in header row (need calling TableSetupColumn() + TableHeadersRow() to display headers)
747
+ ImGuiTableFlags_Hideable = 4 # 1 << 2 # Enable hiding/disabling columns in context menu.
748
+ ImGuiTableFlags_Sortable = 8 # 1 << 3 # Enable sorting. Call TableGetSortSpecs() to obtain sort specs. Also see ImGuiTableFlags_SortMulti and ImGuiTableFlags_SortTristate.
749
+ ImGuiTableFlags_NoSavedSettings = 16 # 1 << 4 # Disable persisting columns order, width and sort settings in the .ini file.
750
+ ImGuiTableFlags_ContextMenuInBody = 32 # 1 << 5 # Right-click on columns body/contents will display table context menu. By default it is available in TableHeadersRow().
751
+ ImGuiTableFlags_RowBg = 64 # 1 << 6 # Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent of calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually)
752
+ ImGuiTableFlags_BordersInnerH = 128 # 1 << 7 # Draw horizontal borders between rows.
753
+ ImGuiTableFlags_BordersOuterH = 256 # 1 << 8 # Draw horizontal borders at the top and bottom.
754
+ ImGuiTableFlags_BordersInnerV = 512 # 1 << 9 # Draw vertical borders between columns.
755
+ ImGuiTableFlags_BordersOuterV = 1024 # 1 << 10 # Draw vertical borders on the left and right sides.
756
+ ImGuiTableFlags_BordersH = 384 # ImGuiTableFlags_BordersInnerH | ImGuiTableFlags_BordersOuterH # Draw horizontal borders.
757
+ ImGuiTableFlags_BordersV = 1536 # ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersOuterV # Draw vertical borders.
758
+ ImGuiTableFlags_BordersInner = 640 # ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersInnerH # Draw inner borders.
759
+ ImGuiTableFlags_BordersOuter = 1280 # ImGuiTableFlags_BordersOuterV | ImGuiTableFlags_BordersOuterH # Draw outer borders.
760
+ ImGuiTableFlags_Borders = 1920 # ImGuiTableFlags_BordersInner | ImGuiTableFlags_BordersOuter # Draw all borders.
761
+ ImGuiTableFlags_NoBordersInBody = 2048 # 1 << 11 # [ALPHA] Disable vertical borders in columns Body (borders will always appear in Headers). -> May move to style
762
+ ImGuiTableFlags_NoBordersInBodyUntilResize = 4096 # 1 << 12 # [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appear in Headers). -> May move to style
763
+ ImGuiTableFlags_SizingFixedFit = 8192 # 1 << 13 # Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching contents width.
764
+ ImGuiTableFlags_SizingFixedSame = 16384 # 2 << 13 # Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching the maximum contents width of all columns. Implicitly enable ImGuiTableFlags_NoKeepColumnsVisible.
765
+ ImGuiTableFlags_SizingStretchProp = 24576 # 3 << 13 # Columns default to _WidthStretch with default weights proportional to each columns contents widths.
766
+ ImGuiTableFlags_SizingStretchSame = 32768 # 4 << 13 # Columns default to _WidthStretch with default weights all equal, unless overridden by TableSetupColumn().
767
+ ImGuiTableFlags_NoHostExtendX = 65536 # 1 << 16 # Make outer width auto-fit to columns, overriding outer_size.x value. Only available when ScrollX/ScrollY are disabled and Stretch columns are not used.
768
+ ImGuiTableFlags_NoHostExtendY = 131072 # 1 << 17 # Make outer height stop exactly at outer_size.y (prevent auto-extending table past the limit). Only available when ScrollX/ScrollY are disabled. Data below the limit will be clipped and not visible.
769
+ ImGuiTableFlags_NoKeepColumnsVisible = 262144 # 1 << 18 # Disable keeping column always minimally visible when ScrollX is off and table gets too small. Not recommended if columns are resizable.
770
+ ImGuiTableFlags_PreciseWidths = 524288 # 1 << 19 # Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth.
771
+ ImGuiTableFlags_NoClip = 1048576 # 1 << 20 # Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze().
772
+ ImGuiTableFlags_PadOuterX = 2097152 # 1 << 21 # Default if BordersOuterV is on. Enable outermost padding. Generally desirable if you have headers.
773
+ ImGuiTableFlags_NoPadOuterX = 4194304 # 1 << 22 # Default if BordersOuterV is off. Disable outermost padding.
774
+ ImGuiTableFlags_NoPadInnerX = 8388608 # 1 << 23 # Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off).
775
+ ImGuiTableFlags_ScrollX = 16777216 # 1 << 24 # Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this creates a child window, ScrollY is currently generally recommended when using ScrollX.
776
+ ImGuiTableFlags_ScrollY = 33554432 # 1 << 25 # Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size.
777
+ ImGuiTableFlags_SortMulti = 67108864 # 1 << 26 # Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1).
778
+ ImGuiTableFlags_SortTristate = 134217728 # 1 << 27 # Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0).
779
+ ImGuiTableFlags_HighlightHoveredColumn = 268435456 # 1 << 28 # Highlight column headers when hovered (may evolve into a fuller highlight)
780
+ ImGuiTableFlags_SizingMask_ = 57344 # ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_SizingStretchSame
764
781
 
765
782
  # ImGuiTableRowFlags_
766
783
  # Flags for ImGui::TableNextRow()
@@ -769,22 +786,23 @@ ImGuiTableRowFlags_Headers = 1 # 1 << 0 # Identify header row (set default backg
769
786
 
770
787
  # ImGuiTreeNodeFlags_
771
788
  # Flags for ImGui::TreeNodeEx(), ImGui::CollapsingHeader*()
772
- ImGuiTreeNodeFlags_None = 0 # 0
773
- ImGuiTreeNodeFlags_Selected = 1 # 1 << 0 # Draw as selected
774
- ImGuiTreeNodeFlags_Framed = 2 # 1 << 1 # Draw frame with background (e.g. for CollapsingHeader)
775
- ImGuiTreeNodeFlags_AllowOverlap = 4 # 1 << 2 # Hit testing to allow subsequent widgets to overlap this one
776
- ImGuiTreeNodeFlags_NoTreePushOnOpen = 8 # 1 << 3 # Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
777
- ImGuiTreeNodeFlags_NoAutoOpenOnLog = 16 # 1 << 4 # Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes)
778
- ImGuiTreeNodeFlags_DefaultOpen = 32 # 1 << 5 # Default node to be open
779
- ImGuiTreeNodeFlags_OpenOnDoubleClick = 64 # 1 << 6 # Need double-click to open node
780
- ImGuiTreeNodeFlags_OpenOnArrow = 128 # 1 << 7 # Only open when clicking on the arrow part. If ImGuiTreeNodeFlags_OpenOnDoubleClick is also set, single-click arrow or double-click all box to open.
781
- ImGuiTreeNodeFlags_Leaf = 256 # 1 << 8 # No collapsing, no arrow (use as a convenience for leaf nodes).
782
- ImGuiTreeNodeFlags_Bullet = 512 # 1 << 9 # Display a bullet instead of arrow
783
- ImGuiTreeNodeFlags_FramePadding = 1024 # 1 << 10 # Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding().
784
- ImGuiTreeNodeFlags_SpanAvailWidth = 2048 # 1 << 11 # Extend hit box to the right-most edge, even if not framed. This is not the default in order to allow adding other items on the same line. In the future we may refactor the hit system to be front-to-back, allowing natural overlaps and then this can become the default.
785
- ImGuiTreeNodeFlags_SpanFullWidth = 4096 # 1 << 12 # Extend hit box to the left-most and right-most edges (bypass the indented area).
786
- ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 8192 # 1 << 13 # (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop)
787
- ImGuiTreeNodeFlags_CollapsingHeader = 26 # ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog
789
+ ImGuiTreeNodeFlags_None = 0 # 0
790
+ ImGuiTreeNodeFlags_Selected = 1 # 1 << 0 # Draw as selected
791
+ ImGuiTreeNodeFlags_Framed = 2 # 1 << 1 # Draw frame with background (e.g. for CollapsingHeader)
792
+ ImGuiTreeNodeFlags_AllowOverlap = 4 # 1 << 2 # Hit testing to allow subsequent widgets to overlap this one
793
+ ImGuiTreeNodeFlags_NoTreePushOnOpen = 8 # 1 << 3 # Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
794
+ ImGuiTreeNodeFlags_NoAutoOpenOnLog = 16 # 1 << 4 # Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes)
795
+ ImGuiTreeNodeFlags_DefaultOpen = 32 # 1 << 5 # Default node to be open
796
+ ImGuiTreeNodeFlags_OpenOnDoubleClick = 64 # 1 << 6 # Need double-click to open node
797
+ ImGuiTreeNodeFlags_OpenOnArrow = 128 # 1 << 7 # Only open when clicking on the arrow part. If ImGuiTreeNodeFlags_OpenOnDoubleClick is also set, single-click arrow or double-click all box to open.
798
+ ImGuiTreeNodeFlags_Leaf = 256 # 1 << 8 # No collapsing, no arrow (use as a convenience for leaf nodes).
799
+ ImGuiTreeNodeFlags_Bullet = 512 # 1 << 9 # Display a bullet instead of arrow. IMPORTANT: node can still be marked open/close if you don't set the _Leaf flag!
800
+ ImGuiTreeNodeFlags_FramePadding = 1024 # 1 << 10 # Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding().
801
+ ImGuiTreeNodeFlags_SpanAvailWidth = 2048 # 1 << 11 # Extend hit box to the right-most edge, even if not framed. This is not the default in order to allow adding other items on the same line. In the future we may refactor the hit system to be front-to-back, allowing natural overlaps and then this can become the default.
802
+ ImGuiTreeNodeFlags_SpanFullWidth = 4096 # 1 << 12 # Extend hit box to the left-most and right-most edges (bypass the indented area).
803
+ ImGuiTreeNodeFlags_SpanAllColumns = 8192 # 1 << 13 # Frame will span all columns of its container table (text will still fit in current column)
804
+ ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 16384 # 1 << 14 # (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop)
805
+ ImGuiTreeNodeFlags_CollapsingHeader = 26 # ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog
788
806
 
789
807
  # ImGuiViewportFlags_
790
808
  # Flags stored in ImGuiViewport::Flags, giving indications to the platform backends.
@@ -813,13 +831,12 @@ ImGuiWindowFlags_NoFocusOnAppearing = 4096 # 1 << 12 # Disable taking fo
813
831
  ImGuiWindowFlags_NoBringToFrontOnFocus = 8192 # 1 << 13 # Disable bringing window to front when taking focus (e.g. clicking on it or programmatically giving it focus)
814
832
  ImGuiWindowFlags_AlwaysVerticalScrollbar = 16384 # 1 << 14 # Always show vertical scrollbar (even if ContentSize.y < Size.y)
815
833
  ImGuiWindowFlags_AlwaysHorizontalScrollbar = 32768 # 1<< 15 # Always show horizontal scrollbar (even if ContentSize.x < Size.x)
816
- ImGuiWindowFlags_AlwaysUseWindowPadding = 65536 # 1 << 16 # Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient)
817
- ImGuiWindowFlags_NoNavInputs = 262144 # 1 << 18 # No gamepad/keyboard navigation within the window
818
- ImGuiWindowFlags_NoNavFocus = 524288 # 1 << 19 # No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB)
819
- ImGuiWindowFlags_UnsavedDocument = 1048576 # 1 << 20 # Display a dot next to the title. When used in a tab/docking context, tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar.
820
- ImGuiWindowFlags_NoNav = 786432 # ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus
834
+ ImGuiWindowFlags_NoNavInputs = 65536 # 1 << 16 # No gamepad/keyboard navigation within the window
835
+ ImGuiWindowFlags_NoNavFocus = 131072 # 1 << 17 # No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB)
836
+ ImGuiWindowFlags_UnsavedDocument = 262144 # 1 << 18 # Display a dot next to the title. When used in a tab/docking context, tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar.
837
+ ImGuiWindowFlags_NoNav = 196608 # ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus
821
838
  ImGuiWindowFlags_NoDecoration = 43 # ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse
822
- ImGuiWindowFlags_NoInputs = 786944 # ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus
839
+ ImGuiWindowFlags_NoInputs = 197120 # ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus
823
840
  ImGuiWindowFlags_NavFlattened = 8388608 # 1 << 23 # [BETA] On child window: allow gamepad/keyboard navigation to cross over parent border to this child or between sibling child windows.
824
841
  ImGuiWindowFlags_ChildWindow = 16777216 # 1 << 24 # Don't use! For internal use by BeginChild()
825
842
  ImGuiWindowFlags_Tooltip = 33554432 # 1 << 25 # Don't use! For internal use by BeginTooltip()
@@ -865,10 +882,39 @@ end
865
882
  # This is used by the Columns/Tables API, so items of each column can be batched together in a same draw call.
866
883
  class ImDrawListSplitter < FFI::Struct
867
884
  layout(
868
- :_Current, :int, # Current channel number (0)
869
- :_Count, :int, # Number of active channels (1+)
870
- :_Channels, ImVector.by_value # Draw channels (not resized down so _Count might be < Channels.Size)
885
+ :_Current, :int,
886
+ :_Count, :int,
887
+ :_Channels, ImVector.by_value
871
888
  )
889
+
890
+ def Clear()
891
+ ImGui::ImDrawListSplitter_Clear(self)
892
+ end
893
+
894
+ def ClearFreeMemory()
895
+ ImGui::ImDrawListSplitter_ClearFreeMemory(self)
896
+ end
897
+
898
+ def self.create()
899
+ return ImDrawListSplitter.new(ImGui::ImDrawListSplitter_ImDrawListSplitter())
900
+ end
901
+
902
+ def Merge(draw_list)
903
+ ImGui::ImDrawListSplitter_Merge(self, draw_list)
904
+ end
905
+
906
+ def SetCurrentChannel(draw_list, channel_idx)
907
+ ImGui::ImDrawListSplitter_SetCurrentChannel(self, draw_list, channel_idx)
908
+ end
909
+
910
+ def Split(draw_list, count)
911
+ ImGui::ImDrawListSplitter_Split(self, draw_list, count)
912
+ end
913
+
914
+ def destroy()
915
+ ImGui::ImDrawListSplitter_destroy(self)
916
+ end
917
+
872
918
  end
873
919
 
874
920
  # Typically, 1 command = 1 GPU draw call (unless command is a callback)
@@ -878,14 +924,27 @@ end
878
924
  # - The ClipRect/TextureId/VtxOffset fields must be contiguous as we memcmp() them together (this is asserted for).
879
925
  class ImDrawCmd < FFI::Struct
880
926
  layout(
881
- :ClipRect, ImVec4.by_value, # 4*4 // Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData->DisplayPos to get clipping rectangle in "viewport" coordinates
882
- :TextureId, :pointer, # 4-8 // 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.
883
- :VtxOffset, :uint, # 4 // Start offset in vertex buffer. ImGuiBackendFlags_RendererHasVtxOffset: always 0, otherwise may be >0 to support meshes larger than 64K vertices with 16-bit indices.
884
- :IdxOffset, :uint, # 4 // Start offset in index buffer.
885
- :ElemCount, :uint, # 4 // 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[].
886
- :UserCallback, :pointer, # 4-8 // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
887
- :UserCallbackData, :pointer # 4-8 // The draw callback code can access this.
927
+ :ClipRect, ImVec4.by_value,
928
+ :TextureId, :pointer,
929
+ :VtxOffset, :uint,
930
+ :IdxOffset, :uint,
931
+ :ElemCount, :uint,
932
+ :UserCallback, :pointer,
933
+ :UserCallbackData, :pointer
888
934
  )
935
+
936
+ def GetTexID()
937
+ ImGui::ImDrawCmd_GetTexID(self)
938
+ end
939
+
940
+ def self.create()
941
+ return ImDrawCmd.new(ImGui::ImDrawCmd_ImDrawCmd())
942
+ end
943
+
944
+ def destroy()
945
+ ImGui::ImDrawCmd_destroy(self)
946
+ end
947
+
889
948
  end
890
949
 
891
950
  # [Internal] For use by ImDrawList
@@ -908,21 +967,21 @@ end
908
967
  # Important: Primitives are always added to the list and not culled (culling is done at higher-level by ImGui:: functions), if you use this API a lot consider coarse culling your drawn objects.
909
968
  class ImDrawList < FFI::Struct
910
969
  layout(
911
- :CmdBuffer, ImVector.by_value, # Draw commands. Typically 1 command = 1 GPU draw call, unless the command is a callback.
912
- :IdxBuffer, ImVector.by_value, # Index buffer. Each command consume ImDrawCmd::ElemCount of those
913
- :VtxBuffer, ImVector.by_value, # Vertex buffer.
914
- :Flags, :int, # Flags, you may poke into these to adjust anti-aliasing settings per-primitive.
915
- :_VtxCurrentIdx, :uint, # [Internal] generally == VtxBuffer.Size unless we are past 64K vertices, in which case this gets reset to 0.
916
- :_Data, :pointer, # Pointer to shared draw data (you can use ImGui::GetDrawListSharedData() to get the one from current ImGui context)
917
- :_OwnerName, :pointer, # Pointer to owner window's name for debugging
918
- :_VtxWritePtr, ImDrawVert.ptr, # [Internal] point within VtxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
919
- :_IdxWritePtr, :pointer, # [Internal] point within IdxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
920
- :_ClipRectStack, ImVector.by_value, # [Internal]
921
- :_TextureIdStack, ImVector.by_value, # [Internal]
922
- :_Path, ImVector.by_value, # [Internal] current path building
923
- :_CmdHeader, ImDrawCmdHeader.by_value, # [Internal] template of active commands. Fields should match those of CmdBuffer.back().
924
- :_Splitter, ImDrawListSplitter.by_value, # [Internal] for channels api (note: prefer using your own persistent instance of ImDrawListSplitter!)
925
- :_FringeScale, :float # [Internal] anti-alias fringe is scaled by this value, this helps to keep things sharp while zooming at vertex buffer content
970
+ :CmdBuffer, ImVector.by_value,
971
+ :IdxBuffer, ImVector.by_value,
972
+ :VtxBuffer, ImVector.by_value,
973
+ :Flags, :int,
974
+ :_VtxCurrentIdx, :uint,
975
+ :_Data, :pointer,
976
+ :_OwnerName, :pointer,
977
+ :_VtxWritePtr, ImDrawVert.ptr,
978
+ :_IdxWritePtr, :pointer,
979
+ :_ClipRectStack, ImVector.by_value,
980
+ :_TextureIdStack, ImVector.by_value,
981
+ :_Path, ImVector.by_value,
982
+ :_CmdHeader, ImDrawCmdHeader.by_value,
983
+ :_Splitter, ImDrawListSplitter.by_value,
984
+ :_FringeScale, :float
926
985
  )
927
986
 
928
987
  def AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments = 0)
@@ -953,6 +1012,14 @@ class ImDrawList < FFI::Struct
953
1012
  ImGui::ImDrawList_AddDrawCmd(self)
954
1013
  end
955
1014
 
1015
+ def AddEllipse(center, radius_x, radius_y, col, rot = 0.0, num_segments = 0, thickness = 1.0)
1016
+ ImGui::ImDrawList_AddEllipse(self, center, radius_x, radius_y, col, rot, num_segments, thickness)
1017
+ end
1018
+
1019
+ def AddEllipseFilled(center, radius_x, radius_y, col, rot = 0.0, num_segments = 0)
1020
+ ImGui::ImDrawList_AddEllipseFilled(self, center, radius_x, radius_y, col, rot, num_segments)
1021
+ end
1022
+
956
1023
  def AddImage(user_texture_id, p_min, p_max, uv_min = ImVec2.create(0,0), uv_max = ImVec2.create(1,1), col = ImColor.col32(255,255,255,255))
957
1024
  ImGui::ImDrawList_AddImage(self, user_texture_id, p_min, p_max, uv_min, uv_max, col)
958
1025
  end
@@ -1069,6 +1136,10 @@ class ImDrawList < FFI::Struct
1069
1136
  ImGui::ImDrawList_PathClear(self)
1070
1137
  end
1071
1138
 
1139
+ def PathEllipticalArcTo(center, radius_x, radius_y, rot, a_min, a_max, num_segments = 0)
1140
+ ImGui::ImDrawList_PathEllipticalArcTo(self, center, radius_x, radius_y, rot, a_min, a_max, num_segments)
1141
+ end
1142
+
1072
1143
  def PathFillConvex(col)
1073
1144
  ImGui::ImDrawList_PathFillConvex(self, col)
1074
1145
  end
@@ -1206,28 +1277,28 @@ end
1206
1277
  # - This is an old API and it is currently awkward for those and various other reasons! We will address them in the future!
1207
1278
  class ImFontAtlas < FFI::Struct
1208
1279
  layout(
1209
- :Flags, :int, # Build flags (see ImFontAtlasFlags_)
1210
- :TexID, :pointer, # 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.
1211
- :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.
1212
- :TexGlyphPadding, :int, # Padding between glyphs within texture in pixels. Defaults to 1. If your rendering method doesn't rely on bilinear filtering you may set this to 0 (will also need to set AntiAliasedLinesUseTex = false).
1213
- :Locked, :bool, # Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert.
1214
- :UserData, :pointer, # Store your own atlas related user-data (if e.g. you have multiple font atlas).
1215
- :TexReady, :bool, # Set when texture was built matching current font input
1216
- :TexPixelsUseColors, :bool, # Tell whether our texture data is known to use colors (rather than just alpha channel), in order to help backend select a format.
1217
- :TexPixelsAlpha8, :pointer, # 1 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight
1218
- :TexPixelsRGBA32, :pointer, # 4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4
1219
- :TexWidth, :int, # Texture width calculated during Build().
1220
- :TexHeight, :int, # Texture height calculated during Build().
1221
- :TexUvScale, ImVec2.by_value, # = (1.0f/TexWidth, 1.0f/TexHeight)
1222
- :TexUvWhitePixel, ImVec2.by_value, # Texture coordinates to a white pixel
1223
- :Fonts, ImVector.by_value, # 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.
1224
- :CustomRects, ImVector.by_value, # Rectangles for packing custom texture data into the atlas.
1225
- :ConfigData, ImVector.by_value, # Configuration data
1226
- :TexUvLines, [ImVec4.by_value, 64], # UVs for baked anti-aliased lines
1227
- :FontBuilderIO, :pointer, # Opaque interface to a font builder (default to stb_truetype, can be changed to use FreeType by defining IMGUI_ENABLE_FREETYPE).
1228
- :FontBuilderFlags, :uint, # Shared flags (for all fonts) for custom font builder. THIS IS BUILD IMPLEMENTATION DEPENDENT. Per-font override is also available in ImFontConfig.
1229
- :PackIdMouseCursors, :int, # Custom texture rectangle ID for white pixel and mouse cursors
1230
- :PackIdLines, :int # Custom texture rectangle ID for baked anti-aliased lines
1280
+ :Flags, :int,
1281
+ :TexID, :pointer,
1282
+ :TexDesiredWidth, :int,
1283
+ :TexGlyphPadding, :int,
1284
+ :Locked, :bool,
1285
+ :UserData, :pointer,
1286
+ :TexReady, :bool,
1287
+ :TexPixelsUseColors, :bool,
1288
+ :TexPixelsAlpha8, :pointer,
1289
+ :TexPixelsRGBA32, :pointer,
1290
+ :TexWidth, :int,
1291
+ :TexHeight, :int,
1292
+ :TexUvScale, ImVec2.by_value,
1293
+ :TexUvWhitePixel, ImVec2.by_value,
1294
+ :Fonts, ImVector.by_value,
1295
+ :CustomRects, ImVector.by_value,
1296
+ :ConfigData, ImVector.by_value,
1297
+ :TexUvLines, [ImVec4.by_value, 64],
1298
+ :FontBuilderIO, :pointer,
1299
+ :FontBuilderFlags, :uint,
1300
+ :PackIdMouseCursors, :int,
1301
+ :PackIdLines, :int
1231
1302
  )
1232
1303
 
1233
1304
  def AddCustomRectFontGlyph(font, id, width, height, advance_x, offset = ImVec2.create(0,0))
@@ -1254,12 +1325,12 @@ class ImFontAtlas < FFI::Struct
1254
1325
  ImGui::ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(self, compressed_font_data_base85, size_pixels, font_cfg, glyph_ranges)
1255
1326
  end
1256
1327
 
1257
- def AddFontFromMemoryCompressedTTF(compressed_font_data, compressed_font_size, size_pixels, font_cfg = nil, glyph_ranges = nil)
1258
- ImGui::ImFontAtlas_AddFontFromMemoryCompressedTTF(self, compressed_font_data, compressed_font_size, size_pixels, font_cfg, glyph_ranges)
1328
+ def AddFontFromMemoryCompressedTTF(compressed_font_data, compressed_font_data_size, size_pixels, font_cfg = nil, glyph_ranges = nil)
1329
+ ImGui::ImFontAtlas_AddFontFromMemoryCompressedTTF(self, compressed_font_data, compressed_font_data_size, size_pixels, font_cfg, glyph_ranges)
1259
1330
  end
1260
1331
 
1261
- def AddFontFromMemoryTTF(font_data, font_size, size_pixels, font_cfg = nil, glyph_ranges = nil)
1262
- ImGui::ImFontAtlas_AddFontFromMemoryTTF(self, font_data, font_size, size_pixels, font_cfg, glyph_ranges)
1332
+ def AddFontFromMemoryTTF(font_data, font_data_size, size_pixels, font_cfg = nil, glyph_ranges = nil)
1333
+ ImGui::ImFontAtlas_AddFontFromMemoryTTF(self, font_data, font_data_size, size_pixels, font_cfg, glyph_ranges)
1263
1334
  end
1264
1335
 
1265
1336
  def Build()
@@ -1360,11 +1431,50 @@ end
1360
1431
  # If prior to 1.87 you used io.KeysDownDuration[] (which was marked as internal), you should use GetKeyData(key)->DownDuration and *NOT* io.KeysData[key]->DownDuration.
1361
1432
  class ImGuiKeyData < FFI::Struct
1362
1433
  layout(
1363
- :Down, :bool, # True for if key is down
1364
- :DownDuration, :float, # Duration the key has been down (<0.0f: not pressed, 0.0f: just pressed, >0.0f: time held)
1365
- :DownDurationPrev, :float, # Last frame duration the key has been down
1366
- :AnalogValue, :float # 0.0f..1.0f for gamepad values
1434
+ :Down, :bool,
1435
+ :DownDuration, :float,
1436
+ :DownDurationPrev, :float,
1437
+ :AnalogValue, :float
1438
+ )
1439
+ end
1440
+
1441
+ # - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows.
1442
+ # - In 'docking' branch with multi-viewport enabled, we extend this concept to have multiple active viewports.
1443
+ # - In the future we will extend this concept further to also represent Platform Monitor and support a "no main platform window" operation mode.
1444
+ # - About Main Area vs Work Area:
1445
+ # - Main Area = entire viewport.
1446
+ # - Work Area = entire viewport minus sections used by main menu bars (for platform windows), or by task bar (for platform monitor).
1447
+ # - Windows are generally trying to stay within the Work Area of their host viewport.
1448
+ class ImGuiViewport < FFI::Struct
1449
+ layout(
1450
+ :Flags, :int,
1451
+ :Pos, ImVec2.by_value,
1452
+ :Size, ImVec2.by_value,
1453
+ :WorkPos, ImVec2.by_value,
1454
+ :WorkSize, ImVec2.by_value,
1455
+ :PlatformHandleRaw, :pointer
1367
1456
  )
1457
+
1458
+ def GetCenter()
1459
+ pOut = ImVec2.new
1460
+ ImGui::ImGuiViewport_GetCenter(pOut, self)
1461
+ return pOut
1462
+ end
1463
+
1464
+ def GetWorkCenter()
1465
+ pOut = ImVec2.new
1466
+ ImGui::ImGuiViewport_GetWorkCenter(pOut, self)
1467
+ return pOut
1468
+ end
1469
+
1470
+ def self.create()
1471
+ return ImGuiViewport.new(ImGui::ImGuiViewport_ImGuiViewport())
1472
+ end
1473
+
1474
+ def destroy()
1475
+ ImGui::ImGuiViewport_destroy(self)
1476
+ end
1477
+
1368
1478
  end
1369
1479
 
1370
1480
  # Helper: ImColor() implicitly converts colors to either ImU32 (packed 4x1 byte) or ImVec4 (4x1 float)
@@ -1382,78 +1492,193 @@ end
1382
1492
  # as this is one of the oldest structure exposed by the library! Basically, ImDrawList == CmdList)
1383
1493
  class ImDrawData < FFI::Struct
1384
1494
  layout(
1385
- :Valid, :bool, # Only valid after Render() is called and before the next NewFrame() is called.
1386
- :CmdListsCount, :int, # Number of ImDrawList* to render
1387
- :TotalIdxCount, :int, # For convenience, sum of all ImDrawList's IdxBuffer.Size
1388
- :TotalVtxCount, :int, # For convenience, sum of all ImDrawList's VtxBuffer.Size
1389
- :CmdLists, ImDrawList.ptr, # Array of ImDrawList* to render. The ImDrawList are owned by ImGuiContext and only pointed to from here.
1390
- :DisplayPos, ImVec2.by_value, # Top-left position of the viewport to render (== top-left of the orthogonal projection matrix to use) (== GetMainViewport()->Pos for the main viewport, == (0.0) in most single-viewport applications)
1391
- :DisplaySize, ImVec2.by_value, # Size of the viewport to render (== GetMainViewport()->Size for the main viewport, == io.DisplaySize in most single-viewport applications)
1392
- :FramebufferScale, ImVec2.by_value # Amount of pixels for each unit of DisplaySize. Based on io.DisplayFramebufferScale. Generally (1,1) on normal display, (2,2) on OSX with Retina display.
1495
+ :Valid, :bool,
1496
+ :CmdListsCount, :int,
1497
+ :TotalIdxCount, :int,
1498
+ :TotalVtxCount, :int,
1499
+ :CmdLists, ImVector.by_value,
1500
+ :DisplayPos, ImVec2.by_value,
1501
+ :DisplaySize, ImVec2.by_value,
1502
+ :FramebufferScale, ImVec2.by_value,
1503
+ :OwnerViewport, ImGuiViewport.ptr
1393
1504
  )
1505
+
1506
+ def AddDrawList(draw_list)
1507
+ ImGui::ImDrawData_AddDrawList(self, draw_list)
1508
+ end
1509
+
1510
+ def Clear()
1511
+ ImGui::ImDrawData_Clear(self)
1512
+ end
1513
+
1514
+ def DeIndexAllBuffers()
1515
+ ImGui::ImDrawData_DeIndexAllBuffers(self)
1516
+ end
1517
+
1518
+ def self.create()
1519
+ return ImDrawData.new(ImGui::ImDrawData_ImDrawData())
1520
+ end
1521
+
1522
+ def ScaleClipRects(fb_scale)
1523
+ ImGui::ImDrawData_ScaleClipRects(self, fb_scale)
1524
+ end
1525
+
1526
+ def destroy()
1527
+ ImGui::ImDrawData_destroy(self)
1528
+ end
1529
+
1394
1530
  end
1395
1531
 
1396
1532
  # Font runtime data and rendering
1397
1533
  # ImFontAtlas automatically loads a default embedded font for you when you call GetTexDataAsAlpha8() or GetTexDataAsRGBA32().
1398
1534
  class ImFont < FFI::Struct
1399
1535
  layout(
1400
- :IndexAdvanceX, ImVector.by_value, # 12-16 // out // // Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this this info, and are often bottleneck in large UI).
1401
- :FallbackAdvanceX, :float, # 4 // out // = FallbackGlyph->AdvanceX
1402
- :FontSize, :float, # 4 // in // // Height of characters/line, set during loading (don't change after loading)
1403
- :IndexLookup, ImVector.by_value, # 12-16 // out // // Sparse. Index glyphs by Unicode code-point.
1404
- :Glyphs, ImVector.by_value, # 12-16 // out // // All glyphs.
1405
- :FallbackGlyph, :pointer, # 4-8 // out // = FindGlyph(FontFallbackChar)
1406
- :ContainerAtlas, ImFontAtlas.ptr, # 4-8 // out // // What we has been loaded into
1407
- :ConfigData, :pointer, # 4-8 // in // // Pointer within ContainerAtlas->ConfigData
1408
- :ConfigDataCount, :short, # 2 // in // ~ 1 // Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont.
1409
- :FallbackChar, :ushort, # 2 // out // = FFFD/'?' // Character used if a glyph isn't found.
1410
- :EllipsisChar, :ushort, # 2 // out // = '...'/'.'// Character used for ellipsis rendering.
1411
- :EllipsisCharCount, :short, # 1 // out // 1 or 3
1412
- :EllipsisWidth, :float, # 4 // out // Width
1413
- :EllipsisCharStep, :float, # 4 // out // Step between characters when EllipsisCount > 0
1414
- :DirtyLookupTables, :bool, # 1 // out //
1415
- :Scale, :float, # 4 // in // = 1.f // Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale()
1416
- :Ascent, :float, # 4+4 // out // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]
1536
+ :IndexAdvanceX, ImVector.by_value,
1537
+ :FallbackAdvanceX, :float,
1538
+ :FontSize, :float,
1539
+ :IndexLookup, ImVector.by_value,
1540
+ :Glyphs, ImVector.by_value,
1541
+ :FallbackGlyph, :pointer,
1542
+ :ContainerAtlas, ImFontAtlas.ptr,
1543
+ :ConfigData, :pointer,
1544
+ :ConfigDataCount, :short,
1545
+ :FallbackChar, :ushort,
1546
+ :EllipsisChar, :ushort,
1547
+ :EllipsisCharCount, :short,
1548
+ :EllipsisWidth, :float,
1549
+ :EllipsisCharStep, :float,
1550
+ :DirtyLookupTables, :bool,
1551
+ :Scale, :float,
1552
+ :Ascent, :float,
1417
1553
  :Descent, :float,
1418
- :MetricsTotalSurface, :int, # 4 // out // // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
1419
- :Used4kPagesMap, [:uchar, 2] # 2 bytes if ImWchar=ImWchar16, 34 bytes if ImWchar==ImWchar32. Store 1-bit for each block of 4K codepoints that has one active glyph. This is mainly used to facilitate iterations across all used codepoints.
1554
+ :MetricsTotalSurface, :int,
1555
+ :Used4kPagesMap, [:uchar, 2]
1420
1556
  )
1557
+
1558
+ def AddGlyph(src_cfg, c, x0, y0, x1, y1, u0, v0, u1, v1, advance_x)
1559
+ ImGui::ImFont_AddGlyph(self, src_cfg, c, x0, y0, x1, y1, u0, v0, u1, v1, advance_x)
1560
+ end
1561
+
1562
+ def AddRemapChar(dst, src, overwrite_dst = true)
1563
+ ImGui::ImFont_AddRemapChar(self, dst, src, overwrite_dst)
1564
+ end
1565
+
1566
+ def BuildLookupTable()
1567
+ ImGui::ImFont_BuildLookupTable(self)
1568
+ end
1569
+
1570
+ def CalcTextSizeA(size, max_width, wrap_width, text_begin, text_end = nil, remaining = nil)
1571
+ pOut = ImVec2.new
1572
+ ImGui::ImFont_CalcTextSizeA(pOut, self, size, max_width, wrap_width, text_begin, text_end, remaining)
1573
+ return pOut
1574
+ end
1575
+
1576
+ def CalcWordWrapPositionA(scale, text, text_end, wrap_width)
1577
+ ImGui::ImFont_CalcWordWrapPositionA(self, scale, text, text_end, wrap_width)
1578
+ end
1579
+
1580
+ def ClearOutputData()
1581
+ ImGui::ImFont_ClearOutputData(self)
1582
+ end
1583
+
1584
+ def FindGlyph(c)
1585
+ ImGui::ImFont_FindGlyph(self, c)
1586
+ end
1587
+
1588
+ def FindGlyphNoFallback(c)
1589
+ ImGui::ImFont_FindGlyphNoFallback(self, c)
1590
+ end
1591
+
1592
+ def GetCharAdvance(c)
1593
+ ImGui::ImFont_GetCharAdvance(self, c)
1594
+ end
1595
+
1596
+ def GetDebugName()
1597
+ ImGui::ImFont_GetDebugName(self)
1598
+ end
1599
+
1600
+ def GrowIndex(new_size)
1601
+ ImGui::ImFont_GrowIndex(self, new_size)
1602
+ end
1603
+
1604
+ def self.create()
1605
+ return ImFont.new(ImGui::ImFont_ImFont())
1606
+ end
1607
+
1608
+ def IsGlyphRangeUnused(c_begin, c_last)
1609
+ ImGui::ImFont_IsGlyphRangeUnused(self, c_begin, c_last)
1610
+ end
1611
+
1612
+ def IsLoaded()
1613
+ ImGui::ImFont_IsLoaded(self)
1614
+ end
1615
+
1616
+ def RenderChar(draw_list, size, pos, col, c)
1617
+ ImGui::ImFont_RenderChar(self, draw_list, size, pos, col, c)
1618
+ end
1619
+
1620
+ def RenderText(draw_list, size, pos, col, clip_rect, text_begin, text_end, wrap_width = 0.0, cpu_fine_clip = false)
1621
+ ImGui::ImFont_RenderText(self, draw_list, size, pos, col, clip_rect, text_begin, text_end, wrap_width, cpu_fine_clip)
1622
+ end
1623
+
1624
+ def SetGlyphVisible(c, visible)
1625
+ ImGui::ImFont_SetGlyphVisible(self, c, visible)
1626
+ end
1627
+
1628
+ def destroy()
1629
+ ImGui::ImFont_destroy(self)
1630
+ end
1631
+
1421
1632
  end
1422
1633
 
1423
1634
  # See ImFontAtlas::AddCustomRectXXX functions.
1424
1635
  class ImFontAtlasCustomRect < FFI::Struct
1425
1636
  layout(
1426
- :Width, :ushort, # Input // Desired rectangle dimension
1637
+ :Width, :ushort,
1427
1638
  :Height, :ushort,
1428
- :X, :ushort, # Output // Packed position in Atlas
1639
+ :X, :ushort,
1429
1640
  :Y, :ushort,
1430
- :GlyphID, :uint, # Input // For custom font glyphs only (ID < 0x110000)
1431
- :GlyphAdvanceX, :float, # Input // For custom font glyphs only: glyph xadvance
1432
- :GlyphOffset, ImVec2.by_value, # Input // For custom font glyphs only: glyph display offset
1433
- :Font, ImFont.ptr # Input // For custom font glyphs only: target font
1641
+ :GlyphID, :uint,
1642
+ :GlyphAdvanceX, :float,
1643
+ :GlyphOffset, ImVec2.by_value,
1644
+ :Font, ImFont.ptr
1434
1645
  )
1646
+
1647
+ def self.create()
1648
+ return ImFontAtlasCustomRect.new(ImGui::ImFontAtlasCustomRect_ImFontAtlasCustomRect())
1649
+ end
1650
+
1651
+ def IsPacked()
1652
+ ImGui::ImFontAtlasCustomRect_IsPacked(self)
1653
+ end
1654
+
1655
+ def destroy()
1656
+ ImGui::ImFontAtlasCustomRect_destroy(self)
1657
+ end
1658
+
1435
1659
  end
1436
1660
 
1437
1661
  class ImFontConfig < FFI::Struct
1438
1662
  layout(
1439
- :FontData, :pointer, # // TTF/OTF data
1440
- :FontDataSize, :int, # // TTF/OTF data size
1441
- :FontDataOwnedByAtlas, :bool, # true // TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself).
1442
- :FontNo, :int, # 0 // Index of font within TTF/OTF file
1443
- :SizePixels, :float, # // Size in pixels for rasterizer (more or less maps to the resulting font height).
1444
- :OversampleH, :int, # 3 // Rasterize at higher quality for sub-pixel positioning. Note the difference between 2 and 3 is minimal so you can reduce this to 2 to save memory. Read https://github.com/nothings/stb/blob/master/tests/oversample/README.md for details.
1445
- :OversampleV, :int, # 1 // Rasterize at higher quality for sub-pixel positioning. This is not really useful as we don't use sub-pixel positions on the Y axis.
1446
- :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.
1447
- :GlyphExtraSpacing, ImVec2.by_value, # 0, 0 // Extra spacing (in pixels) between glyphs. Only X axis is supported for now.
1448
- :GlyphOffset, ImVec2.by_value, # 0, 0 // Offset all glyphs from this font input.
1449
- :GlyphRanges, :pointer, # NULL // THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE. Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list).
1450
- :GlyphMinAdvanceX, :float, # 0 // Minimum AdvanceX for glyphs, set Min to align font icons, set both Min/Max to enforce mono-space font
1451
- :GlyphMaxAdvanceX, :float, # FLT_MAX // Maximum AdvanceX for glyphs
1452
- :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.
1453
- :FontBuilderFlags, :uint, # 0 // Settings for custom font builder. THIS IS BUILDER IMPLEMENTATION DEPENDENT. Leave as zero if unsure.
1454
- :RasterizerMultiply, :float, # 1.0f // Brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable.
1455
- :EllipsisChar, :ushort, # -1 // Explicitly specify unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used.
1456
- :Name, [:char, 40], # Name (strictly to ease debugging)
1663
+ :FontData, :pointer,
1664
+ :FontDataSize, :int,
1665
+ :FontDataOwnedByAtlas, :bool,
1666
+ :FontNo, :int,
1667
+ :SizePixels, :float,
1668
+ :OversampleH, :int,
1669
+ :OversampleV, :int,
1670
+ :PixelSnapH, :bool,
1671
+ :GlyphExtraSpacing, ImVec2.by_value,
1672
+ :GlyphOffset, ImVec2.by_value,
1673
+ :GlyphRanges, :pointer,
1674
+ :GlyphMinAdvanceX, :float,
1675
+ :GlyphMaxAdvanceX, :float,
1676
+ :MergeMode, :bool,
1677
+ :FontBuilderFlags, :uint,
1678
+ :RasterizerMultiply, :float,
1679
+ :RasterizerDensity, :float,
1680
+ :EllipsisChar, :ushort,
1681
+ :Name, [:char, 40],
1457
1682
  :DstFont, ImFont.ptr
1458
1683
  )
1459
1684
 
@@ -1467,11 +1692,30 @@ class ImFontConfig < FFI::Struct
1467
1692
 
1468
1693
  end
1469
1694
 
1695
+ # Hold rendering data for one glyph.
1696
+ # (Note: some language parsers may fail to convert the 31+1 bitfield members, in this case maybe drop store a single u32 or we can rework this)
1697
+ class ImFontGlyph < FFI::Struct
1698
+ layout(
1699
+ :Colored, :uint,
1700
+ :Visible, :uint,
1701
+ :Codepoint, :uint,
1702
+ :AdvanceX, :float,
1703
+ :X0, :float,
1704
+ :Y0, :float,
1705
+ :X1, :float,
1706
+ :Y1, :float,
1707
+ :U0, :float,
1708
+ :V0, :float,
1709
+ :U1, :float,
1710
+ :V1, :float
1711
+ )
1712
+ end
1713
+
1470
1714
  # Helper to build glyph ranges from text/string data. Feed your application strings/characters to it then call BuildRanges().
1471
1715
  # This is essentially a tightly packed of vector of 64k booleans = 8KB storage.
1472
1716
  class ImFontGlyphRangesBuilder < FFI::Struct
1473
1717
  layout(
1474
- :UsedChars, ImVector.by_value # Store 1-bit per Unicode code point (0=unused, 1=used)
1718
+ :UsedChars, ImVector.by_value
1475
1719
  )
1476
1720
 
1477
1721
  def AddChar(c)
@@ -1514,98 +1758,95 @@ end
1514
1758
 
1515
1759
  class ImGuiIO < FFI::Struct
1516
1760
  layout(
1517
- :ConfigFlags, :int, # = 0 // See ImGuiConfigFlags_ enum. Set by user/application. Gamepad/keyboard navigation options, etc.
1518
- :BackendFlags, :int, # = 0 // See ImGuiBackendFlags_ enum. Set by backend (imgui_impl_xxx files or custom backend) to communicate features supported by the backend.
1519
- :DisplaySize, ImVec2.by_value, # <unset> // Main display size, in pixels (generally == GetMainViewport()->Size). May change every frame.
1520
- :DeltaTime, :float, # = 1.0f/60.0f // Time elapsed since last frame, in seconds. May change every frame.
1521
- :IniSavingRate, :float, # = 5.0f // Minimum time between saving positions/sizes to .ini file, in seconds.
1522
- :IniFilename, :pointer, # = "imgui.ini" // Path to .ini file (important: default "imgui.ini" is relative to current working dir!). Set NULL to disable automatic .ini loading/saving or if you want to manually call LoadIniSettingsXXX() / SaveIniSettingsXXX() functions.
1523
- :LogFilename, :pointer, # = "imgui_log.txt"// Path to .log file (default parameter to ImGui::LogToFile when no file is specified).
1524
- :UserData, :pointer, # = NULL // Store your own data.
1525
- :Fonts, ImFontAtlas.ptr, # <auto> // Font atlas: load, rasterize and pack one or more fonts into a single texture.
1526
- :FontGlobalScale, :float, # = 1.0f // Global scale all fonts
1527
- :FontAllowUserScaling, :bool, # = false // Allow user scaling text of individual window with CTRL+Wheel.
1528
- :FontDefault, ImFont.ptr, # = NULL // Font to use on NewFrame(). Use NULL to uses Fonts->Fonts[0].
1529
- :DisplayFramebufferScale, ImVec2.by_value, # = (1, 1) // For retina display or other situations where window coordinates are different from framebuffer coordinates. This generally ends up in ImDrawData::FramebufferScale.
1530
- :MouseDrawCursor, :bool, # = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by backend implementations.
1531
- :ConfigMacOSXBehaviors, :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.
1532
- :ConfigInputTrickleEventQueue, :bool, # = true // Enable input queue trickling: some types of events submitted during the same frame (e.g. button down + up) will be spread over multiple frames, improving interactions with low framerates.
1533
- :ConfigInputTextCursorBlink, :bool, # = true // Enable blinking cursor (optional as some users consider it to be distracting).
1534
- :ConfigInputTextEnterKeepActive, :bool, # = false // [BETA] Pressing Enter will keep item active and select contents (single-line only).
1535
- :ConfigDragClickToInputText, :bool, # = false // [BETA] Enable turning DragXXX widgets into text input with a simple mouse click-release (without moving). Not desirable on devices without a keyboard.
1536
- :ConfigWindowsResizeFromEdges, :bool, # = true // Enable resizing of windows from their edges and from the lower-left corner. This requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback. (This used to be a per-window ImGuiWindowFlags_ResizeFromAnySide flag)
1537
- :ConfigWindowsMoveFromTitleBarOnly, :bool, # = false // Enable allowing to move windows only when clicking on their title bar. Does not apply to windows without a title bar.
1538
- :ConfigMemoryCompactTimer, :float, # = 60.0f // Timer (in seconds) to free transient windows/tables memory buffers when unused. Set to -1.0f to disable.
1539
- :MouseDoubleClickTime, :float, # = 0.30f // Time for a double-click, in seconds.
1540
- :MouseDoubleClickMaxDist, :float, # = 6.0f // Distance threshold to stay in to validate a double-click, in pixels.
1541
- :MouseDragThreshold, :float, # = 6.0f // Distance threshold before considering we are dragging.
1542
- :KeyRepeatDelay, :float, # = 0.275f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
1543
- :KeyRepeatRate, :float, # = 0.050f // When holding a key/button, rate at which it repeats, in seconds.
1544
- :ConfigDebugBeginReturnValueOnce, :bool, # = false // First-time calls to Begin()/BeginChild() will return false. NEEDS TO BE SET AT APPLICATION BOOT TIME if you don't want to miss windows.
1545
- :ConfigDebugBeginReturnValueLoop, :bool, # = false // Some calls to Begin()/BeginChild() will return false. Will cycle through window depths then repeat. Suggested use: add "io.ConfigDebugBeginReturnValue = io.KeyShift" in your main loop then occasionally press SHIFT. Windows should be flickering while running.
1546
- :ConfigDebugIgnoreFocusLoss, :bool, # = false // Ignore io.AddFocusEvent(false), consequently not calling io.ClearInputKeys() in input processing.
1547
- :ConfigDebugIniSettings, :bool, # = false // Save .ini data with extra comments (particularly helpful for Docking, but makes saving slower)
1548
- :BackendPlatformName, :pointer, # = NULL
1549
- :BackendRendererName, :pointer, # = NULL
1550
- :BackendPlatformUserData, :pointer, # = NULL // User data for platform backend
1551
- :BackendRendererUserData, :pointer, # = NULL // User data for renderer backend
1552
- :BackendLanguageUserData, :pointer, # = NULL // User data for non C++ programming language backend
1761
+ :ConfigFlags, :int,
1762
+ :BackendFlags, :int,
1763
+ :DisplaySize, ImVec2.by_value,
1764
+ :DeltaTime, :float,
1765
+ :IniSavingRate, :float,
1766
+ :IniFilename, :pointer,
1767
+ :LogFilename, :pointer,
1768
+ :UserData, :pointer,
1769
+ :Fonts, ImFontAtlas.ptr,
1770
+ :FontGlobalScale, :float,
1771
+ :FontAllowUserScaling, :bool,
1772
+ :FontDefault, ImFont.ptr,
1773
+ :DisplayFramebufferScale, ImVec2.by_value,
1774
+ :MouseDrawCursor, :bool,
1775
+ :ConfigMacOSXBehaviors, :bool,
1776
+ :ConfigInputTrickleEventQueue, :bool,
1777
+ :ConfigInputTextCursorBlink, :bool,
1778
+ :ConfigInputTextEnterKeepActive, :bool,
1779
+ :ConfigDragClickToInputText, :bool,
1780
+ :ConfigWindowsResizeFromEdges, :bool,
1781
+ :ConfigWindowsMoveFromTitleBarOnly, :bool,
1782
+ :ConfigMemoryCompactTimer, :float,
1783
+ :MouseDoubleClickTime, :float,
1784
+ :MouseDoubleClickMaxDist, :float,
1785
+ :MouseDragThreshold, :float,
1786
+ :KeyRepeatDelay, :float,
1787
+ :KeyRepeatRate, :float,
1788
+ :ConfigDebugBeginReturnValueOnce, :bool,
1789
+ :ConfigDebugBeginReturnValueLoop, :bool,
1790
+ :ConfigDebugIgnoreFocusLoss, :bool,
1791
+ :ConfigDebugIniSettings, :bool,
1792
+ :BackendPlatformName, :pointer,
1793
+ :BackendRendererName, :pointer,
1794
+ :BackendPlatformUserData, :pointer,
1795
+ :BackendRendererUserData, :pointer,
1796
+ :BackendLanguageUserData, :pointer,
1553
1797
  :GetClipboardTextFn, :pointer,
1554
1798
  :SetClipboardTextFn, :pointer,
1555
1799
  :ClipboardUserData, :pointer,
1556
1800
  :SetPlatformImeDataFn, :pointer,
1801
+ :PlatformLocaleDecimalPoint, :ushort,
1802
+ :WantCaptureMouse, :bool,
1803
+ :WantCaptureKeyboard, :bool,
1804
+ :WantTextInput, :bool,
1805
+ :WantSetMousePos, :bool,
1806
+ :WantSaveIniSettings, :bool,
1807
+ :NavActive, :bool,
1808
+ :NavVisible, :bool,
1809
+ :Framerate, :float,
1810
+ :MetricsRenderVertices, :int,
1811
+ :MetricsRenderIndices, :int,
1812
+ :MetricsRenderWindows, :int,
1813
+ :MetricsActiveWindows, :int,
1814
+ :MouseDelta, ImVec2.by_value,
1557
1815
  :_UnusedPadding, :pointer,
1558
- :WantCaptureMouse, :bool, # Set when Dear ImGui will use mouse inputs, in this case do not dispatch them to your main game/application (either way, always pass on mouse inputs to imgui). (e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.).
1559
- :WantCaptureKeyboard, :bool, # Set when Dear ImGui will use keyboard inputs, in this case do not dispatch them to your main game/application (either way, always pass keyboard inputs to imgui). (e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.).
1560
- :WantTextInput, :bool, # Mobile/console: when set, you may display an on-screen keyboard. This is set by Dear ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active).
1561
- :WantSetMousePos, :bool, # MousePos has been altered, backend should reposition mouse on next frame. Rarely used! Set only when ImGuiConfigFlags_NavEnableSetMousePos flag is enabled.
1562
- :WantSaveIniSettings, :bool, # When manual .ini load/save is active (io.IniFilename == NULL), this will be set to notify your application that you can call SaveIniSettingsToMemory() and save yourself. Important: clear io.WantSaveIniSettings yourself after saving!
1563
- :NavActive, :bool, # Keyboard/Gamepad navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag.
1564
- :NavVisible, :bool, # Keyboard/Gamepad navigation is visible and allowed (will handle ImGuiKey_NavXXX events).
1565
- :Framerate, :float, # Estimate of application framerate (rolling average over 60 frames, based on io.DeltaTime), in frame per second. Solely for convenience. Slow applications may not want to use a moving average or may want to reset underlying buffers occasionally.
1566
- :MetricsRenderVertices, :int, # Vertices output during last call to Render()
1567
- :MetricsRenderIndices, :int, # Indices output during last call to Render() = number of triangles * 3
1568
- :MetricsRenderWindows, :int, # Number of visible windows
1569
- :MetricsActiveWindows, :int, # Number of active windows
1570
- :MetricsActiveAllocations, :int, # Number of active allocations, updated by MemAlloc/MemFree based on current context. May be off if you have multiple imgui contexts.
1571
- :MouseDelta, ImVec2.by_value, # 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.
1572
- :KeyMap, [:int, 652], # [LEGACY] Input: map of indices into the KeysDown[512] entries array which represent your "native" keyboard state. The first 512 are now unused and should be kept zero. Legacy backend will write into KeyMap[] using ImGuiKey_ indices which are always >512.
1573
- :KeysDown, [:bool, 652], # [LEGACY] Input: 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). This used to be [512] sized. It is now ImGuiKey_COUNT to allow legacy io.KeysDown[GetKeyIndex(...)] to work without an overflow.
1574
- :NavInputs, [:float, 16], # [LEGACY] Since 1.88, NavInputs[] was removed. Backends from 1.60 to 1.86 won't build. Feed gamepad inputs via io.AddKeyEvent() and ImGuiKey_GamepadXXX enums.
1575
- :Ctx, :pointer, # Parent UI context (needs to be set explicitly by parent).
1576
- :MousePos, ImVec2.by_value, # Mouse position, in pixels. Set to ImVec2(-FLT_MAX, -FLT_MAX) if mouse is unavailable (on another screen, etc.)
1577
- :MouseDown, [:bool, 5], # Mouse buttons: 0=left, 1=right, 2=middle + extras (ImGuiMouseButton_COUNT == 5). Dear ImGui mostly uses left and right buttons. Other buttons allow us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.
1578
- :MouseWheel, :float, # Mouse wheel Vertical: 1 unit scrolls about 5 lines text. >0 scrolls Up, <0 scrolls Down. Hold SHIFT to turn vertical scroll into horizontal scroll.
1579
- :MouseWheelH, :float, # Mouse wheel Horizontal. >0 scrolls Left, <0 scrolls Right. Most users don't have a mouse with a horizontal wheel, may not be filled by all backends.
1580
- :MouseSource, :int, # Mouse actual input peripheral (Mouse/TouchScreen/Pen).
1581
- :KeyCtrl, :bool, # Keyboard modifier down: Control
1582
- :KeyShift, :bool, # Keyboard modifier down: Shift
1583
- :KeyAlt, :bool, # Keyboard modifier down: Alt
1584
- :KeySuper, :bool, # Keyboard modifier down: Cmd/Super/Windows
1585
- :KeyMods, :int, # Key mods flags (any of ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Alt/ImGuiMod_Super flags, same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags. DOES NOT CONTAINS ImGuiMod_Shortcut which is pretranslated). Read-only, updated by NewFrame()
1586
- :KeysData, [ImGuiKeyData.by_value, 652], # Key state for all known keys. Use IsKeyXXX() functions to access this.
1587
- :WantCaptureMouseUnlessPopupClose, :bool, # Alternative to WantCaptureMouse: (WantCaptureMouse == true && WantCaptureMouseUnlessPopupClose == false) when a click over void is expected to close a popup.
1588
- :MousePosPrev, ImVec2.by_value, # Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid)
1589
- :MouseClickedPos, [ImVec2.by_value, 5], # Position at time of clicking
1590
- :MouseClickedTime, [:double, 5], # Time of last click (used to figure out double-click)
1591
- :MouseClicked, [:bool, 5], # Mouse button went from !Down to Down (same as MouseClickedCount[x] != 0)
1592
- :MouseDoubleClicked, [:bool, 5], # Has mouse button been double-clicked? (same as MouseClickedCount[x] == 2)
1593
- :MouseClickedCount, [:ushort, 5], # == 0 (not clicked), == 1 (same as MouseClicked[]), == 2 (double-clicked), == 3 (triple-clicked) etc. when going from !Down to Down
1594
- :MouseClickedLastCount, [:ushort, 5], # Count successive number of clicks. Stays valid after mouse release. Reset after another click is done.
1595
- :MouseReleased, [:bool, 5], # Mouse button went from Down to !Down
1596
- :MouseDownOwned, [:bool, 5], # Track if button was clicked inside a dear imgui window or over void blocked by a popup. We don't request mouse capture from the application if click started outside ImGui bounds.
1597
- :MouseDownOwnedUnlessPopupClose, [:bool, 5], # Track if button was clicked inside a dear imgui window.
1598
- :MouseWheelRequestAxisSwap, :bool, # On a non-Mac system, holding SHIFT requests WheelY to perform the equivalent of a WheelX event. On a Mac system this is already enforced by the system.
1599
- :MouseDownDuration, [:float, 5], # Duration the mouse button has been down (0.0f == just clicked)
1600
- :MouseDownDurationPrev, [:float, 5], # Previous time the mouse button has been down
1601
- :MouseDragMaxDistanceSqr, [:float, 5], # Squared maximum distance of how much mouse has traveled from the clicking point (used for moving thresholds)
1602
- :PenPressure, :float, # Touch/Pen pressure (0.0f to 1.0f, should be >0.0f only when MouseDown[0] == true). Helper storage currently unused by Dear ImGui.
1603
- :AppFocusLost, :bool, # Only modify via AddFocusEvent()
1604
- :AppAcceptingEvents, :bool, # Only modify via SetAppAcceptingEvents()
1605
- :BackendUsingLegacyKeyArrays, :char, # -1: unknown, 0: using AddKeyEvent(), 1: using legacy io.KeysDown[]
1606
- :BackendUsingLegacyNavInputArray, :bool, # 0: using AddKeyAnalogEvent(), 1: writing to legacy io.NavInputs[] directly
1607
- :InputQueueSurrogate, :ushort, # For AddInputCharacterUTF16()
1608
- :InputQueueCharacters, ImVector.by_value # Queue of _characters_ input (obtained by platform backend). Fill using AddInputCharacter() helper.
1816
+ :Ctx, :pointer,
1817
+ :MousePos, ImVec2.by_value,
1818
+ :MouseDown, [:bool, 5],
1819
+ :MouseWheel, :float,
1820
+ :MouseWheelH, :float,
1821
+ :MouseSource, :int,
1822
+ :KeyCtrl, :bool,
1823
+ :KeyShift, :bool,
1824
+ :KeyAlt, :bool,
1825
+ :KeySuper, :bool,
1826
+ :KeyMods, :int,
1827
+ :KeysData, [ImGuiKeyData.by_value, 154],
1828
+ :WantCaptureMouseUnlessPopupClose, :bool,
1829
+ :MousePosPrev, ImVec2.by_value,
1830
+ :MouseClickedPos, [ImVec2.by_value, 5],
1831
+ :MouseClickedTime, [:double, 5],
1832
+ :MouseClicked, [:bool, 5],
1833
+ :MouseDoubleClicked, [:bool, 5],
1834
+ :MouseClickedCount, [:ushort, 5],
1835
+ :MouseClickedLastCount, [:ushort, 5],
1836
+ :MouseReleased, [:bool, 5],
1837
+ :MouseDownOwned, [:bool, 5],
1838
+ :MouseDownOwnedUnlessPopupClose, [:bool, 5],
1839
+ :MouseWheelRequestAxisSwap, :bool,
1840
+ :MouseDownDuration, [:float, 5],
1841
+ :MouseDownDurationPrev, [:float, 5],
1842
+ :MouseDragMaxDistanceSqr, [:float, 5],
1843
+ :PenPressure, :float,
1844
+ :AppFocusLost, :bool,
1845
+ :AppAcceptingEvents, :bool,
1846
+ :BackendUsingLegacyKeyArrays, :char,
1847
+ :BackendUsingLegacyNavInputArray, :bool,
1848
+ :InputQueueSurrogate, :ushort,
1849
+ :InputQueueCharacters, ImVector.by_value
1609
1850
  )
1610
1851
 
1611
1852
  def AddFocusEvent(focused)
@@ -1648,8 +1889,8 @@ class ImGuiIO < FFI::Struct
1648
1889
  ImGui::ImGuiIO_AddMouseWheelEvent(self, wheel_x, wheel_y)
1649
1890
  end
1650
1891
 
1651
- def ClearInputCharacters()
1652
- ImGui::ImGuiIO_ClearInputCharacters(self)
1892
+ def ClearEventsQueue()
1893
+ ImGui::ImGuiIO_ClearEventsQueue(self)
1653
1894
  end
1654
1895
 
1655
1896
  def ClearInputKeys()
@@ -1685,93 +1926,308 @@ end
1685
1926
  # - ImGuiInputTextFlags_CallbackResize: Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow.
1686
1927
  class ImGuiInputTextCallbackData < FFI::Struct
1687
1928
  layout(
1688
- :Ctx, :pointer, # Parent UI context
1689
- :EventFlag, :int, # One ImGuiInputTextFlags_Callback* // Read-only
1690
- :Flags, :int, # What user passed to InputText() // Read-only
1691
- :UserData, :pointer, # What user passed to InputText() // Read-only
1692
- :EventChar, :ushort, # Character input // Read-write // [CharFilter] Replace character with another one, or set to zero to drop. return 1 is equivalent to setting EventChar=0;
1693
- :EventKey, :int, # Key pressed (Up/Down/TAB) // Read-only // [Completion,History]
1694
- :Buf, :pointer, # Text buffer // Read-write // [Resize] Can replace pointer / [Completion,History,Always] Only write to pointed data, don't replace the actual pointer!
1695
- :BufTextLen, :int, # Text length (in bytes) // Read-write // [Resize,Completion,History,Always] Exclude zero-terminator storage. In C land: == strlen(some_text), in C++ land: string.length()
1696
- :BufSize, :int, # Buffer size (in bytes) = capacity+1 // Read-only // [Resize,Completion,History,Always] Include zero-terminator storage. In C land == ARRAYSIZE(my_char_array), in C++ land: string.capacity()+1
1697
- :BufDirty, :bool, # Set if you modify Buf/BufTextLen! // Write // [Completion,History,Always]
1698
- :CursorPos, :int, # // Read-write // [Completion,History,Always]
1699
- :SelectionStart, :int, # // Read-write // [Completion,History,Always] == to SelectionEnd when no selection)
1700
- :SelectionEnd, :int # // Read-write // [Completion,History,Always]
1929
+ :Ctx, :pointer,
1930
+ :EventFlag, :int,
1931
+ :Flags, :int,
1932
+ :UserData, :pointer,
1933
+ :EventChar, :ushort,
1934
+ :EventKey, :int,
1935
+ :Buf, :pointer,
1936
+ :BufTextLen, :int,
1937
+ :BufSize, :int,
1938
+ :BufDirty, :bool,
1939
+ :CursorPos, :int,
1940
+ :SelectionStart, :int,
1941
+ :SelectionEnd, :int
1942
+ )
1943
+
1944
+ def ClearSelection()
1945
+ ImGui::ImGuiInputTextCallbackData_ClearSelection(self)
1946
+ end
1947
+
1948
+ def DeleteChars(pos, bytes_count)
1949
+ ImGui::ImGuiInputTextCallbackData_DeleteChars(self, pos, bytes_count)
1950
+ end
1951
+
1952
+ def HasSelection()
1953
+ ImGui::ImGuiInputTextCallbackData_HasSelection(self)
1954
+ end
1955
+
1956
+ def self.create()
1957
+ return ImGuiInputTextCallbackData.new(ImGui::ImGuiInputTextCallbackData_ImGuiInputTextCallbackData())
1958
+ end
1959
+
1960
+ def InsertChars(pos, text, text_end = nil)
1961
+ ImGui::ImGuiInputTextCallbackData_InsertChars(self, pos, text, text_end)
1962
+ end
1963
+
1964
+ def SelectAll()
1965
+ ImGui::ImGuiInputTextCallbackData_SelectAll(self)
1966
+ end
1967
+
1968
+ def destroy()
1969
+ ImGui::ImGuiInputTextCallbackData_destroy(self)
1970
+ end
1971
+
1972
+ end
1973
+
1974
+ # Helper: Manually clip large list of items.
1975
+ # If you have lots evenly spaced items and you have random access to the list, you can perform coarse
1976
+ # clipping based on visibility to only submit items that are in view.
1977
+ # The clipper calculates the range of visible items and advance the cursor to compensate for the non-visible items we have skipped.
1978
+ # (Dear ImGui already clip items based on their bounds but: it needs to first layout the item to do so, and generally
1979
+ # fetching/submitting your own data incurs additional cost. Coarse clipping using ImGuiListClipper allows you to easily
1980
+ # scale using lists with tens of thousands of items without a problem)
1981
+ # Usage:
1982
+ # ImGuiListClipper clipper;
1983
+ # clipper.Begin(1000); // We have 1000 elements, evenly spaced.
1984
+ # while (clipper.Step())
1985
+ # for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
1986
+ # ImGui::Text("line number %d", i);
1987
+ # Generally what happens is:
1988
+ # - Clipper lets you process the first element (DisplayStart = 0, DisplayEnd = 1) regardless of it being visible or not.
1989
+ # - User code submit that one element.
1990
+ # - Clipper can measure the height of the first element
1991
+ # - Clipper calculate the actual range of elements to display based on the current clipping rectangle, position the cursor before the first visible element.
1992
+ # - User code submit visible elements.
1993
+ # - The clipper also handles various subtleties related to keyboard/gamepad navigation, wrapping etc.
1994
+ class ImGuiListClipper < FFI::Struct
1995
+ layout(
1996
+ :Ctx, :pointer,
1997
+ :DisplayStart, :int,
1998
+ :DisplayEnd, :int,
1999
+ :ItemsCount, :int,
2000
+ :ItemsHeight, :float,
2001
+ :StartPosY, :float,
2002
+ :TempData, :pointer
2003
+ )
2004
+
2005
+ def Begin(items_count, items_height = -1.0)
2006
+ ImGui::ImGuiListClipper_Begin(self, items_count, items_height)
2007
+ end
2008
+
2009
+ def End()
2010
+ ImGui::ImGuiListClipper_End(self)
2011
+ end
2012
+
2013
+ def self.create()
2014
+ return ImGuiListClipper.new(ImGui::ImGuiListClipper_ImGuiListClipper())
2015
+ end
2016
+
2017
+ def IncludeItemByIndex(item_index)
2018
+ ImGui::ImGuiListClipper_IncludeItemByIndex(self, item_index)
2019
+ end
2020
+
2021
+ def IncludeItemsByIndex(item_begin, item_end)
2022
+ ImGui::ImGuiListClipper_IncludeItemsByIndex(self, item_begin, item_end)
2023
+ end
2024
+
2025
+ def Step()
2026
+ ImGui::ImGuiListClipper_Step(self)
2027
+ end
2028
+
2029
+ def destroy()
2030
+ ImGui::ImGuiListClipper_destroy(self)
2031
+ end
2032
+
2033
+ end
2034
+
2035
+ # Data payload for Drag and Drop operations: AcceptDragDropPayload(), GetDragDropPayload()
2036
+ class ImGuiPayload < FFI::Struct
2037
+ layout(
2038
+ :Data, :pointer,
2039
+ :DataSize, :int,
2040
+ :SourceId, :uint,
2041
+ :SourceParentId, :uint,
2042
+ :DataFrameCount, :int,
2043
+ :DataType, [:char, 33],
2044
+ :Preview, :bool,
2045
+ :Delivery, :bool
1701
2046
  )
2047
+
2048
+ def Clear()
2049
+ ImGui::ImGuiPayload_Clear(self)
2050
+ end
2051
+
2052
+ def self.create()
2053
+ return ImGuiPayload.new(ImGui::ImGuiPayload_ImGuiPayload())
2054
+ end
2055
+
2056
+ def IsDataType(type)
2057
+ ImGui::ImGuiPayload_IsDataType(self, type)
2058
+ end
2059
+
2060
+ def IsDelivery()
2061
+ ImGui::ImGuiPayload_IsDelivery(self)
2062
+ end
2063
+
2064
+ def IsPreview()
2065
+ ImGui::ImGuiPayload_IsPreview(self)
2066
+ end
2067
+
2068
+ def destroy()
2069
+ ImGui::ImGuiPayload_destroy(self)
2070
+ end
2071
+
1702
2072
  end
1703
2073
 
1704
2074
  # (Optional) Support for IME (Input Method Editor) via the io.SetPlatformImeDataFn() function.
1705
2075
  class ImGuiPlatformImeData < FFI::Struct
1706
2076
  layout(
1707
- :WantVisible, :bool, # A widget wants the IME to be visible
1708
- :InputPos, ImVec2.by_value, # Position of the input cursor
1709
- :InputLineHeight, :float # Line height
2077
+ :WantVisible, :bool,
2078
+ :InputPos, ImVec2.by_value,
2079
+ :InputLineHeight, :float
1710
2080
  )
2081
+
2082
+ def self.create()
2083
+ return ImGuiPlatformImeData.new(ImGui::ImGuiPlatformImeData_ImGuiPlatformImeData())
2084
+ end
2085
+
2086
+ def destroy()
2087
+ ImGui::ImGuiPlatformImeData_destroy(self)
2088
+ end
2089
+
1711
2090
  end
1712
2091
 
1713
2092
  # Resizing callback data to apply custom constraint. As enabled by SetNextWindowSizeConstraints(). Callback is called during the next Begin().
1714
2093
  # NB: For basic min/max size constraint on each axis you don't need to use the callback! The SetNextWindowSizeConstraints() parameters are enough.
1715
2094
  class ImGuiSizeCallbackData < FFI::Struct
1716
2095
  layout(
1717
- :UserData, :pointer, # Read-only. What user passed to SetNextWindowSizeConstraints(). Generally store an integer or float in here (need reinterpret_cast<>).
1718
- :Pos, ImVec2.by_value, # Read-only. Window position, for reference.
1719
- :CurrentSize, ImVec2.by_value, # Read-only. Current window size.
1720
- :DesiredSize, ImVec2.by_value # Read-write. Desired size, based on user's mouse position. Write to this field to restrain resizing.
2096
+ :UserData, :pointer,
2097
+ :Pos, ImVec2.by_value,
2098
+ :CurrentSize, ImVec2.by_value,
2099
+ :DesiredSize, ImVec2.by_value
1721
2100
  )
1722
2101
  end
1723
2102
 
2103
+ # Helper: Key->Value storage
2104
+ # Typically you don't have to worry about this since a storage is held within each Window.
2105
+ # We use it to e.g. store collapse state for a tree (Int 0/1)
2106
+ # This is optimized for efficient lookup (dichotomy into a contiguous buffer) and rare insertion (typically tied to user interactions aka max once a frame)
2107
+ # You can use it as custom user storage for temporary values. Declare your own storage if, for example:
2108
+ # - You want to manipulate the open/close state of a particular sub-tree in your interface (tree node uses Int 0/1 to store their state).
2109
+ # - You want to store custom debug data easily without adding or editing structures in your code (probably not efficient, but convenient)
2110
+ # Types are NOT stored, so it is up to you to make sure your Key don't collide with different types.
2111
+ class ImGuiStorage < FFI::Struct
2112
+ layout(
2113
+ :Data, ImVector.by_value
2114
+ )
2115
+
2116
+ def BuildSortByKey()
2117
+ ImGui::ImGuiStorage_BuildSortByKey(self)
2118
+ end
2119
+
2120
+ def Clear()
2121
+ ImGui::ImGuiStorage_Clear(self)
2122
+ end
2123
+
2124
+ def GetBool(key, default_val = false)
2125
+ ImGui::ImGuiStorage_GetBool(self, key, default_val)
2126
+ end
2127
+
2128
+ def GetBoolRef(key, default_val = false)
2129
+ ImGui::ImGuiStorage_GetBoolRef(self, key, default_val)
2130
+ end
2131
+
2132
+ def GetFloat(key, default_val = 0.0)
2133
+ ImGui::ImGuiStorage_GetFloat(self, key, default_val)
2134
+ end
2135
+
2136
+ def GetFloatRef(key, default_val = 0.0)
2137
+ ImGui::ImGuiStorage_GetFloatRef(self, key, default_val)
2138
+ end
2139
+
2140
+ def GetInt(key, default_val = 0)
2141
+ ImGui::ImGuiStorage_GetInt(self, key, default_val)
2142
+ end
2143
+
2144
+ def GetIntRef(key, default_val = 0)
2145
+ ImGui::ImGuiStorage_GetIntRef(self, key, default_val)
2146
+ end
2147
+
2148
+ def GetVoidPtr(key)
2149
+ ImGui::ImGuiStorage_GetVoidPtr(self, key)
2150
+ end
2151
+
2152
+ def GetVoidPtrRef(key, default_val = nil)
2153
+ ImGui::ImGuiStorage_GetVoidPtrRef(self, key, default_val)
2154
+ end
2155
+
2156
+ def SetAllInt(val)
2157
+ ImGui::ImGuiStorage_SetAllInt(self, val)
2158
+ end
2159
+
2160
+ def SetBool(key, val)
2161
+ ImGui::ImGuiStorage_SetBool(self, key, val)
2162
+ end
2163
+
2164
+ def SetFloat(key, val)
2165
+ ImGui::ImGuiStorage_SetFloat(self, key, val)
2166
+ end
2167
+
2168
+ def SetInt(key, val)
2169
+ ImGui::ImGuiStorage_SetInt(self, key, val)
2170
+ end
2171
+
2172
+ def SetVoidPtr(key, val)
2173
+ ImGui::ImGuiStorage_SetVoidPtr(self, key, val)
2174
+ end
2175
+
2176
+ end
2177
+
1724
2178
  class ImGuiStyle < FFI::Struct
1725
2179
  layout(
1726
- :Alpha, :float, # Global alpha applies to everything in Dear ImGui.
1727
- :DisabledAlpha, :float, # Additional alpha multiplier applied by BeginDisabled(). Multiply over current value of Alpha.
1728
- :WindowPadding, ImVec2.by_value, # Padding within a window.
1729
- :WindowRounding, :float, # Radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended.
1730
- :WindowBorderSize, :float, # Thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
1731
- :WindowMinSize, ImVec2.by_value, # Minimum window size. This is a global setting. If you want to constrain individual windows, use SetNextWindowSizeConstraints().
1732
- :WindowTitleAlign, ImVec2.by_value, # Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.
1733
- :WindowMenuButtonPosition, :int, # Side of the collapsing/docking button in the title bar (None/Left/Right). Defaults to ImGuiDir_Left.
1734
- :ChildRounding, :float, # Radius of child window corners rounding. Set to 0.0f to have rectangular windows.
1735
- :ChildBorderSize, :float, # 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).
1736
- :PopupRounding, :float, # Radius of popup window corners rounding. (Note that tooltip windows use WindowRounding)
1737
- :PopupBorderSize, :float, # Thickness of border around popup/tooltip windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
1738
- :FramePadding, ImVec2.by_value, # Padding within a framed rectangle (used by most widgets).
1739
- :FrameRounding, :float, # Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
1740
- :FrameBorderSize, :float, # Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
1741
- :ItemSpacing, ImVec2.by_value, # Horizontal and vertical spacing between widgets/lines.
1742
- :ItemInnerSpacing, ImVec2.by_value, # Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label).
1743
- :CellPadding, ImVec2.by_value, # Padding within a table cell
1744
- :TouchExtraPadding, ImVec2.by_value, # 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!
1745
- :IndentSpacing, :float, # Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
1746
- :ColumnsMinSpacing, :float, # Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
1747
- :ScrollbarSize, :float, # Width of the vertical scrollbar, Height of the horizontal scrollbar.
1748
- :ScrollbarRounding, :float, # Radius of grab corners for scrollbar.
1749
- :GrabMinSize, :float, # Minimum width/height of a grab box for slider/scrollbar.
1750
- :GrabRounding, :float, # Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
1751
- :LogSliderDeadzone, :float, # The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero.
1752
- :TabRounding, :float, # Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs.
1753
- :TabBorderSize, :float, # Thickness of border around tabs.
1754
- :TabMinWidthForCloseButton, :float, # Minimum width for close button to appear on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected.
1755
- :ColorButtonPosition, :int, # Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
1756
- :ButtonTextAlign, ImVec2.by_value, # Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered).
1757
- :SelectableTextAlign, ImVec2.by_value, # Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.
1758
- :SeparatorTextBorderSize, :float, # Thickkness of border in SeparatorText()
1759
- :SeparatorTextAlign, ImVec2.by_value, # Alignment of text within the separator. Defaults to (0.0f, 0.5f) (left aligned, center).
1760
- :SeparatorTextPadding, ImVec2.by_value, # Horizontal offset of text from each edge of the separator + spacing on other axis. Generally small values. .y is recommended to be == FramePadding.y.
1761
- :DisplayWindowPadding, ImVec2.by_value, # Window position are clamped to be visible within the display area or monitors by at least this amount. Only applies to regular windows.
1762
- :DisplaySafeAreaPadding, ImVec2.by_value, # If you cannot see the edges of your screen (e.g. on a TV) increase the safe area padding. Apply to popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly!
1763
- :MouseCursorScale, :float, # Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later.
1764
- :AntiAliasedLines, :bool, # Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList).
1765
- :AntiAliasedLinesUseTex, :bool, # Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering (NOT point/nearest filtering). Latched at the beginning of the frame (copied to ImDrawList).
1766
- :AntiAliasedFill, :bool, # Enable anti-aliased edges around filled shapes (rounded rectangles, circles, etc.). Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList).
1767
- :CurveTessellationTol, :float, # Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
1768
- :CircleTessellationMaxError, :float, # Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry.
2180
+ :Alpha, :float,
2181
+ :DisabledAlpha, :float,
2182
+ :WindowPadding, ImVec2.by_value,
2183
+ :WindowRounding, :float,
2184
+ :WindowBorderSize, :float,
2185
+ :WindowMinSize, ImVec2.by_value,
2186
+ :WindowTitleAlign, ImVec2.by_value,
2187
+ :WindowMenuButtonPosition, :int,
2188
+ :ChildRounding, :float,
2189
+ :ChildBorderSize, :float,
2190
+ :PopupRounding, :float,
2191
+ :PopupBorderSize, :float,
2192
+ :FramePadding, ImVec2.by_value,
2193
+ :FrameRounding, :float,
2194
+ :FrameBorderSize, :float,
2195
+ :ItemSpacing, ImVec2.by_value,
2196
+ :ItemInnerSpacing, ImVec2.by_value,
2197
+ :CellPadding, ImVec2.by_value,
2198
+ :TouchExtraPadding, ImVec2.by_value,
2199
+ :IndentSpacing, :float,
2200
+ :ColumnsMinSpacing, :float,
2201
+ :ScrollbarSize, :float,
2202
+ :ScrollbarRounding, :float,
2203
+ :GrabMinSize, :float,
2204
+ :GrabRounding, :float,
2205
+ :LogSliderDeadzone, :float,
2206
+ :TabRounding, :float,
2207
+ :TabBorderSize, :float,
2208
+ :TabMinWidthForCloseButton, :float,
2209
+ :TabBarBorderSize, :float,
2210
+ :TableAngledHeadersAngle, :float,
2211
+ :ColorButtonPosition, :int,
2212
+ :ButtonTextAlign, ImVec2.by_value,
2213
+ :SelectableTextAlign, ImVec2.by_value,
2214
+ :SeparatorTextBorderSize, :float,
2215
+ :SeparatorTextAlign, ImVec2.by_value,
2216
+ :SeparatorTextPadding, ImVec2.by_value,
2217
+ :DisplayWindowPadding, ImVec2.by_value,
2218
+ :DisplaySafeAreaPadding, ImVec2.by_value,
2219
+ :MouseCursorScale, :float,
2220
+ :AntiAliasedLines, :bool,
2221
+ :AntiAliasedLinesUseTex, :bool,
2222
+ :AntiAliasedFill, :bool,
2223
+ :CurveTessellationTol, :float,
2224
+ :CircleTessellationMaxError, :float,
1769
2225
  :Colors, [ImVec4.by_value, 53],
1770
- :HoverStationaryDelay, :float, # Delay for IsItemHovered(ImGuiHoveredFlags_Stationary). Time required to consider mouse stationary.
1771
- :HoverDelayShort, :float, # Delay for IsItemHovered(ImGuiHoveredFlags_DelayShort). Usually used along with HoverStationaryDelay.
1772
- :HoverDelayNormal, :float, # Delay for IsItemHovered(ImGuiHoveredFlags_DelayNormal). "
1773
- :HoverFlagsForTooltipMouse, :int, # Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()/SetItemTooltip() while using mouse.
1774
- :HoverFlagsForTooltipNav, :int # Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()/SetItemTooltip() while using keyboard/gamepad.
2226
+ :HoverStationaryDelay, :float,
2227
+ :HoverDelayShort, :float,
2228
+ :HoverDelayNormal, :float,
2229
+ :HoverFlagsForTooltipMouse, :int,
2230
+ :HoverFlagsForTooltipNav, :int
1775
2231
  )
1776
2232
 
1777
2233
  def self.create()
@@ -1791,11 +2247,20 @@ end
1791
2247
  # Sorting specification for one column of a table (sizeof == 12 bytes)
1792
2248
  class ImGuiTableColumnSortSpecs < FFI::Struct
1793
2249
  layout(
1794
- :ColumnUserID, :uint, # User id of the column (if specified by a TableSetupColumn() call)
1795
- :ColumnIndex, :short, # Index of the column
1796
- :SortOrder, :short, # Index within parent ImGuiTableSortSpecs (always stored in order starting from 0, tables sorted on a single criteria will always have a 0 here)
1797
- :SortDirection, :int # ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending (you can use this or SortSign, whichever is more convenient for your sort function)
2250
+ :ColumnUserID, :uint,
2251
+ :ColumnIndex, :short,
2252
+ :SortOrder, :short,
2253
+ :SortDirection, :int
1798
2254
  )
2255
+
2256
+ def self.create()
2257
+ return ImGuiTableColumnSortSpecs.new(ImGui::ImGuiTableColumnSortSpecs_ImGuiTableColumnSortSpecs())
2258
+ end
2259
+
2260
+ def destroy()
2261
+ ImGui::ImGuiTableColumnSortSpecs_destroy(self)
2262
+ end
2263
+
1799
2264
  end
1800
2265
 
1801
2266
  # Sorting specifications for a table (often handling sort specs for a single column, occasionally more)
@@ -1804,10 +2269,72 @@ end
1804
2269
  # Make sure to set 'SpecsDirty = false' after sorting, else you may wastefully sort your data every frame!
1805
2270
  class ImGuiTableSortSpecs < FFI::Struct
1806
2271
  layout(
1807
- :Specs, :pointer, # Pointer to sort spec array.
1808
- :SpecsCount, :int, # Sort spec count. Most often 1. May be > 1 when ImGuiTableFlags_SortMulti is enabled. May be == 0 when ImGuiTableFlags_SortTristate is enabled.
1809
- :SpecsDirty, :bool # Set to true when specs have changed since last time! Use this to sort again, then clear the flag.
2272
+ :Specs, :pointer,
2273
+ :SpecsCount, :int,
2274
+ :SpecsDirty, :bool
1810
2275
  )
2276
+
2277
+ def self.create()
2278
+ return ImGuiTableSortSpecs.new(ImGui::ImGuiTableSortSpecs_ImGuiTableSortSpecs())
2279
+ end
2280
+
2281
+ def destroy()
2282
+ ImGui::ImGuiTableSortSpecs_destroy(self)
2283
+ end
2284
+
2285
+ end
2286
+
2287
+ # Helper: Growable text buffer for logging/accumulating text
2288
+ # (this could be called 'ImGuiTextBuilder' / 'ImGuiStringBuilder')
2289
+ class ImGuiTextBuffer < FFI::Struct
2290
+ layout(
2291
+ :Buf, ImVector.by_value
2292
+ )
2293
+
2294
+ def self.create()
2295
+ return ImGuiTextBuffer.new(ImGui::ImGuiTextBuffer_ImGuiTextBuffer())
2296
+ end
2297
+
2298
+ def append(str, str_end = nil)
2299
+ ImGui::ImGuiTextBuffer_append(self, str, str_end)
2300
+ end
2301
+
2302
+ def appendf(fmt, *varargs)
2303
+ ImGui::ImGuiTextBuffer_appendf(self, fmt, *varargs)
2304
+ end
2305
+
2306
+ def begin()
2307
+ ImGui::ImGuiTextBuffer_begin(self)
2308
+ end
2309
+
2310
+ def c_str()
2311
+ ImGui::ImGuiTextBuffer_c_str(self)
2312
+ end
2313
+
2314
+ def clear()
2315
+ ImGui::ImGuiTextBuffer_clear(self)
2316
+ end
2317
+
2318
+ def destroy()
2319
+ ImGui::ImGuiTextBuffer_destroy(self)
2320
+ end
2321
+
2322
+ def empty()
2323
+ ImGui::ImGuiTextBuffer_empty(self)
2324
+ end
2325
+
2326
+ def end()
2327
+ ImGui::ImGuiTextBuffer_end(self)
2328
+ end
2329
+
2330
+ def reserve(capacity)
2331
+ ImGui::ImGuiTextBuffer_reserve(self, capacity)
2332
+ end
2333
+
2334
+ def size()
2335
+ ImGui::ImGuiTextBuffer_size(self)
2336
+ end
2337
+
1811
2338
  end
1812
2339
 
1813
2340
  # Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
@@ -1848,22 +2375,32 @@ class ImGuiTextFilter < FFI::Struct
1848
2375
 
1849
2376
  end
1850
2377
 
1851
- # - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows.
1852
- # - In 'docking' branch with multi-viewport enabled, we extend this concept to have multiple active viewports.
1853
- # - In the future we will extend this concept further to also represent Platform Monitor and support a "no main platform window" operation mode.
1854
- # - About Main Area vs Work Area:
1855
- # - Main Area = entire viewport.
1856
- # - Work Area = entire viewport minus sections used by main menu bars (for platform windows), or by task bar (for platform monitor).
1857
- # - Windows are generally trying to stay within the Work Area of their host viewport.
1858
- class ImGuiViewport < FFI::Struct
2378
+ class ImGuiTextRange < FFI::Struct
1859
2379
  layout(
1860
- :Flags, :int, # See ImGuiViewportFlags_
1861
- :Pos, ImVec2.by_value, # Main Area: Position of the viewport (Dear ImGui coordinates are the same as OS desktop/native coordinates)
1862
- :Size, ImVec2.by_value, # Main Area: Size of the viewport.
1863
- :WorkPos, ImVec2.by_value, # Work Area: Position of the viewport minus task bars, menus bars, status bars (>= Pos)
1864
- :WorkSize, ImVec2.by_value, # Work Area: Size of the viewport minus task bars, menu bars, status bars (<= Size)
1865
- :PlatformHandleRaw, :pointer # void* to hold lower-level, platform-native window handle (under Win32 this is expected to be a HWND, unused for other platforms)
2380
+ :b, :pointer,
2381
+ :e, :pointer
1866
2382
  )
2383
+
2384
+ def self.create()
2385
+ return ImGuiTextRange.new(ImGui::ImGuiTextRange_ImGuiTextRange_Nil())
2386
+ end
2387
+
2388
+ def self.create(_b, _e)
2389
+ return ImGuiTextRange.new(ImGui::ImGuiTextRange_ImGuiTextRange_Str(_b, _e))
2390
+ end
2391
+
2392
+ def destroy()
2393
+ ImGui::ImGuiTextRange_destroy(self)
2394
+ end
2395
+
2396
+ def empty()
2397
+ ImGui::ImGuiTextRange_empty(self)
2398
+ end
2399
+
2400
+ def split(separator, out)
2401
+ ImGui::ImGuiTextRange_split(self, separator, out)
2402
+ end
2403
+
1867
2404
  end
1868
2405
 
1869
2406
  class ImGuiStoragePair < FFI::Struct
@@ -1871,6 +2408,23 @@ class ImGuiStoragePair < FFI::Struct
1871
2408
  :key, :uint,
1872
2409
  :val_p, :pointer
1873
2410
  )
2411
+
2412
+ def self.create(_key, _val)
2413
+ return ImGuiStoragePair.new(ImGui::ImGuiStoragePair_ImGuiStoragePair_Int(_key, _val))
2414
+ end
2415
+
2416
+ def self.create(_key, _val)
2417
+ return ImGuiStoragePair.new(ImGui::ImGuiStoragePair_ImGuiStoragePair_Float(_key, _val))
2418
+ end
2419
+
2420
+ def self.create(_key, _val)
2421
+ return ImGuiStoragePair.new(ImGui::ImGuiStoragePair_ImGuiStoragePair_Ptr(_key, _val))
2422
+ end
2423
+
2424
+ def destroy()
2425
+ ImGui::ImGuiStoragePair_destroy(self)
2426
+ end
2427
+
1874
2428
  end
1875
2429
 
1876
2430
  # shorthand initializer
@@ -1922,6 +2476,22 @@ module ImGui
1922
2476
  callback :ImGuiSizeCallback, [ImGuiSizeCallbackData], :void
1923
2477
 
1924
2478
  entries = [
2479
+ [:ImDrawCmd_GetTexID, [:pointer], :pointer],
2480
+ [:ImDrawCmd_ImDrawCmd, [], :pointer],
2481
+ [:ImDrawCmd_destroy, [:pointer], :void],
2482
+ [:ImDrawData_AddDrawList, [:pointer, :pointer], :void],
2483
+ [:ImDrawData_Clear, [:pointer], :void],
2484
+ [:ImDrawData_DeIndexAllBuffers, [:pointer], :void],
2485
+ [:ImDrawData_ImDrawData, [], :pointer],
2486
+ [:ImDrawData_ScaleClipRects, [:pointer, ImVec2.by_value], :void],
2487
+ [:ImDrawData_destroy, [:pointer], :void],
2488
+ [:ImDrawListSplitter_Clear, [:pointer], :void],
2489
+ [:ImDrawListSplitter_ClearFreeMemory, [:pointer], :void],
2490
+ [:ImDrawListSplitter_ImDrawListSplitter, [], :pointer],
2491
+ [:ImDrawListSplitter_Merge, [:pointer, :pointer], :void],
2492
+ [:ImDrawListSplitter_SetCurrentChannel, [:pointer, :pointer, :int], :void],
2493
+ [:ImDrawListSplitter_Split, [:pointer, :pointer, :int], :void],
2494
+ [:ImDrawListSplitter_destroy, [:pointer], :void],
1925
2495
  [:ImDrawList_AddBezierCubic, [:pointer, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, :uint, :float, :int], :void],
1926
2496
  [:ImDrawList_AddBezierQuadratic, [:pointer, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, :uint, :float, :int], :void],
1927
2497
  [:ImDrawList_AddCallback, [:pointer, :ImDrawCallback, :pointer], :void],
@@ -1929,6 +2499,8 @@ module ImGui
1929
2499
  [:ImDrawList_AddCircleFilled, [:pointer, ImVec2.by_value, :float, :uint, :int], :void],
1930
2500
  [:ImDrawList_AddConvexPolyFilled, [:pointer, :pointer, :int, :uint], :void],
1931
2501
  [:ImDrawList_AddDrawCmd, [:pointer], :void],
2502
+ [:ImDrawList_AddEllipse, [:pointer, ImVec2.by_value, :float, :float, :uint, :float, :int, :float], :void],
2503
+ [:ImDrawList_AddEllipseFilled, [:pointer, ImVec2.by_value, :float, :float, :uint, :float, :int], :void],
1932
2504
  [:ImDrawList_AddImage, [:pointer, :pointer, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, :uint], :void],
1933
2505
  [:ImDrawList_AddImageQuad, [:pointer, :pointer, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, :uint], :void],
1934
2506
  [:ImDrawList_AddImageRounded, [:pointer, :pointer, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, :uint, :float, :int], :void],
@@ -1957,6 +2529,7 @@ module ImGui
1957
2529
  [:ImDrawList_PathBezierCubicCurveTo, [:pointer, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, :int], :void],
1958
2530
  [:ImDrawList_PathBezierQuadraticCurveTo, [:pointer, ImVec2.by_value, ImVec2.by_value, :int], :void],
1959
2531
  [:ImDrawList_PathClear, [:pointer], :void],
2532
+ [:ImDrawList_PathEllipticalArcTo, [:pointer, ImVec2.by_value, :float, :float, :float, :float, :float, :int], :void],
1960
2533
  [:ImDrawList_PathFillConvex, [:pointer, :uint], :void],
1961
2534
  [:ImDrawList_PathLineTo, [:pointer, ImVec2.by_value], :void],
1962
2535
  [:ImDrawList_PathLineToMergeDuplicate, [:pointer, ImVec2.by_value], :void],
@@ -1986,6 +2559,9 @@ module ImGui
1986
2559
  [:ImDrawList__ResetForNewFrame, [:pointer], :void],
1987
2560
  [:ImDrawList__TryMergeDrawCmds, [:pointer], :void],
1988
2561
  [:ImDrawList_destroy, [:pointer], :void],
2562
+ [:ImFontAtlasCustomRect_ImFontAtlasCustomRect, [], :pointer],
2563
+ [:ImFontAtlasCustomRect_IsPacked, [:pointer], :bool],
2564
+ [:ImFontAtlasCustomRect_destroy, [:pointer], :void],
1989
2565
  [:ImFontAtlas_AddCustomRectFontGlyph, [:pointer, :pointer, :ushort, :int, :int, :float, ImVec2.by_value], :int],
1990
2566
  [:ImFontAtlas_AddCustomRectRegular, [:pointer, :int, :int], :int],
1991
2567
  [:ImFontAtlas_AddFont, [:pointer, :pointer], :pointer],
@@ -2028,6 +2604,24 @@ module ImGui
2028
2604
  [:ImFontGlyphRangesBuilder_ImFontGlyphRangesBuilder, [], :pointer],
2029
2605
  [:ImFontGlyphRangesBuilder_SetBit, [:pointer, :size_t], :void],
2030
2606
  [:ImFontGlyphRangesBuilder_destroy, [:pointer], :void],
2607
+ [:ImFont_AddGlyph, [:pointer, :pointer, :ushort, :float, :float, :float, :float, :float, :float, :float, :float, :float], :void],
2608
+ [:ImFont_AddRemapChar, [:pointer, :ushort, :ushort, :bool], :void],
2609
+ [:ImFont_BuildLookupTable, [:pointer], :void],
2610
+ [:ImFont_CalcTextSizeA, [:pointer, :pointer, :float, :float, :float, :pointer, :pointer, :pointer], :void],
2611
+ [:ImFont_CalcWordWrapPositionA, [:pointer, :float, :pointer, :pointer, :float], :pointer],
2612
+ [:ImFont_ClearOutputData, [:pointer], :void],
2613
+ [:ImFont_FindGlyph, [:pointer, :ushort], :pointer],
2614
+ [:ImFont_FindGlyphNoFallback, [:pointer, :ushort], :pointer],
2615
+ [:ImFont_GetCharAdvance, [:pointer, :ushort], :float],
2616
+ [:ImFont_GetDebugName, [:pointer], :pointer],
2617
+ [:ImFont_GrowIndex, [:pointer, :int], :void],
2618
+ [:ImFont_ImFont, [], :pointer],
2619
+ [:ImFont_IsGlyphRangeUnused, [:pointer, :uint, :uint], :bool],
2620
+ [:ImFont_IsLoaded, [:pointer], :bool],
2621
+ [:ImFont_RenderChar, [:pointer, :pointer, :float, ImVec2.by_value, :uint, :ushort], :void],
2622
+ [:ImFont_RenderText, [:pointer, :pointer, :float, ImVec2.by_value, :uint, ImVec4.by_value, :pointer, :pointer, :float, :bool], :void],
2623
+ [:ImFont_SetGlyphVisible, [:pointer, :ushort, :bool], :void],
2624
+ [:ImFont_destroy, [:pointer], :void],
2031
2625
  [:ImGuiIO_AddFocusEvent, [:pointer, :bool], :void],
2032
2626
  [:ImGuiIO_AddInputCharacter, [:pointer, :uint], :void],
2033
2627
  [:ImGuiIO_AddInputCharacterUTF16, [:pointer, :ushort], :void],
@@ -2038,15 +2632,73 @@ module ImGui
2038
2632
  [:ImGuiIO_AddMousePosEvent, [:pointer, :float, :float], :void],
2039
2633
  [:ImGuiIO_AddMouseSourceEvent, [:pointer, :int], :void],
2040
2634
  [:ImGuiIO_AddMouseWheelEvent, [:pointer, :float, :float], :void],
2041
- [:ImGuiIO_ClearInputCharacters, [:pointer], :void],
2635
+ [:ImGuiIO_ClearEventsQueue, [:pointer], :void],
2042
2636
  [:ImGuiIO_ClearInputKeys, [:pointer], :void],
2043
2637
  [:ImGuiIO_ImGuiIO, [], :pointer],
2044
2638
  [:ImGuiIO_SetAppAcceptingEvents, [:pointer, :bool], :void],
2045
2639
  [:ImGuiIO_SetKeyEventNativeData, [:pointer, :int, :int, :int, :int], :void],
2046
2640
  [:ImGuiIO_destroy, [:pointer], :void],
2641
+ [:ImGuiInputTextCallbackData_ClearSelection, [:pointer], :void],
2642
+ [:ImGuiInputTextCallbackData_DeleteChars, [:pointer, :int, :int], :void],
2643
+ [:ImGuiInputTextCallbackData_HasSelection, [:pointer], :bool],
2644
+ [:ImGuiInputTextCallbackData_ImGuiInputTextCallbackData, [], :pointer],
2645
+ [:ImGuiInputTextCallbackData_InsertChars, [:pointer, :int, :pointer, :pointer], :void],
2646
+ [:ImGuiInputTextCallbackData_SelectAll, [:pointer], :void],
2647
+ [:ImGuiInputTextCallbackData_destroy, [:pointer], :void],
2648
+ [:ImGuiListClipper_Begin, [:pointer, :int, :float], :void],
2649
+ [:ImGuiListClipper_End, [:pointer], :void],
2650
+ [:ImGuiListClipper_ImGuiListClipper, [], :pointer],
2651
+ [:ImGuiListClipper_IncludeItemByIndex, [:pointer, :int], :void],
2652
+ [:ImGuiListClipper_IncludeItemsByIndex, [:pointer, :int, :int], :void],
2653
+ [:ImGuiListClipper_Step, [:pointer], :bool],
2654
+ [:ImGuiListClipper_destroy, [:pointer], :void],
2655
+ [:ImGuiOnceUponAFrame_ImGuiOnceUponAFrame, [], :pointer],
2656
+ [:ImGuiOnceUponAFrame_destroy, [:pointer], :void],
2657
+ [:ImGuiPayload_Clear, [:pointer], :void],
2658
+ [:ImGuiPayload_ImGuiPayload, [], :pointer],
2659
+ [:ImGuiPayload_IsDataType, [:pointer, :pointer], :bool],
2660
+ [:ImGuiPayload_IsDelivery, [:pointer], :bool],
2661
+ [:ImGuiPayload_IsPreview, [:pointer], :bool],
2662
+ [:ImGuiPayload_destroy, [:pointer], :void],
2663
+ [:ImGuiPlatformImeData_ImGuiPlatformImeData, [], :pointer],
2664
+ [:ImGuiPlatformImeData_destroy, [:pointer], :void],
2665
+ [:ImGuiStoragePair_ImGuiStoragePair_Int, [:uint, :int], :pointer],
2666
+ [:ImGuiStoragePair_ImGuiStoragePair_Float, [:uint, :float], :pointer],
2667
+ [:ImGuiStoragePair_ImGuiStoragePair_Ptr, [:uint, :pointer], :pointer],
2668
+ [:ImGuiStoragePair_destroy, [:pointer], :void],
2669
+ [:ImGuiStorage_BuildSortByKey, [:pointer], :void],
2670
+ [:ImGuiStorage_Clear, [:pointer], :void],
2671
+ [:ImGuiStorage_GetBool, [:pointer, :uint, :bool], :bool],
2672
+ [:ImGuiStorage_GetBoolRef, [:pointer, :uint, :bool], :pointer],
2673
+ [:ImGuiStorage_GetFloat, [:pointer, :uint, :float], :float],
2674
+ [:ImGuiStorage_GetFloatRef, [:pointer, :uint, :float], :pointer],
2675
+ [:ImGuiStorage_GetInt, [:pointer, :uint, :int], :int],
2676
+ [:ImGuiStorage_GetIntRef, [:pointer, :uint, :int], :pointer],
2677
+ [:ImGuiStorage_GetVoidPtr, [:pointer, :uint], :pointer],
2678
+ [:ImGuiStorage_GetVoidPtrRef, [:pointer, :uint, :pointer], :pointer],
2679
+ [:ImGuiStorage_SetAllInt, [:pointer, :int], :void],
2680
+ [:ImGuiStorage_SetBool, [:pointer, :uint, :bool], :void],
2681
+ [:ImGuiStorage_SetFloat, [:pointer, :uint, :float], :void],
2682
+ [:ImGuiStorage_SetInt, [:pointer, :uint, :int], :void],
2683
+ [:ImGuiStorage_SetVoidPtr, [:pointer, :uint, :pointer], :void],
2047
2684
  [:ImGuiStyle_ImGuiStyle, [], :pointer],
2048
2685
  [:ImGuiStyle_ScaleAllSizes, [:pointer, :float], :void],
2049
2686
  [:ImGuiStyle_destroy, [:pointer], :void],
2687
+ [:ImGuiTableColumnSortSpecs_ImGuiTableColumnSortSpecs, [], :pointer],
2688
+ [:ImGuiTableColumnSortSpecs_destroy, [:pointer], :void],
2689
+ [:ImGuiTableSortSpecs_ImGuiTableSortSpecs, [], :pointer],
2690
+ [:ImGuiTableSortSpecs_destroy, [:pointer], :void],
2691
+ [:ImGuiTextBuffer_ImGuiTextBuffer, [], :pointer],
2692
+ [:ImGuiTextBuffer_append, [:pointer, :pointer, :pointer], :void],
2693
+ [:ImGuiTextBuffer_appendf, [:pointer, :pointer, :varargs], :void],
2694
+ [:ImGuiTextBuffer_begin, [:pointer], :pointer],
2695
+ [:ImGuiTextBuffer_c_str, [:pointer], :pointer],
2696
+ [:ImGuiTextBuffer_clear, [:pointer], :void],
2697
+ [:ImGuiTextBuffer_destroy, [:pointer], :void],
2698
+ [:ImGuiTextBuffer_empty, [:pointer], :bool],
2699
+ [:ImGuiTextBuffer_end, [:pointer], :pointer],
2700
+ [:ImGuiTextBuffer_reserve, [:pointer, :int], :void],
2701
+ [:ImGuiTextBuffer_size, [:pointer], :int],
2050
2702
  [:ImGuiTextFilter_Build, [:pointer], :void],
2051
2703
  [:ImGuiTextFilter_Clear, [:pointer], :void],
2052
2704
  [:ImGuiTextFilter_Draw, [:pointer, :pointer, :float], :bool],
@@ -2059,13 +2711,16 @@ module ImGui
2059
2711
  [:ImGuiTextRange_destroy, [:pointer], :void],
2060
2712
  [:ImGuiTextRange_empty, [:pointer], :bool],
2061
2713
  [:ImGuiTextRange_split, [:pointer, :char, :pointer], :void],
2714
+ [:ImGuiViewport_GetCenter, [:pointer, :pointer], :void],
2715
+ [:ImGuiViewport_GetWorkCenter, [:pointer, :pointer], :void],
2716
+ [:ImGuiViewport_ImGuiViewport, [], :pointer],
2717
+ [:ImGuiViewport_destroy, [:pointer], :void],
2062
2718
  [:igAcceptDragDropPayload, [:pointer, :int], :pointer],
2063
2719
  [:igAlignTextToFramePadding, [], :void],
2064
2720
  [:igArrowButton, [:pointer, :int], :bool],
2065
2721
  [:igBegin, [:pointer, :pointer, :int], :bool],
2066
- [:igBeginChild_Str, [:pointer, ImVec2.by_value, :bool, :int], :bool],
2067
- [:igBeginChild_ID, [:uint, ImVec2.by_value, :bool, :int], :bool],
2068
- [:igBeginChildFrame, [:uint, ImVec2.by_value, :int], :bool],
2722
+ [:igBeginChild_Str, [:pointer, ImVec2.by_value, :int, :int], :bool],
2723
+ [:igBeginChild_ID, [:uint, ImVec2.by_value, :int, :int], :bool],
2069
2724
  [:igBeginCombo, [:pointer, :pointer, :int], :bool],
2070
2725
  [:igBeginDisabled, [:bool], :void],
2071
2726
  [:igBeginDragDropSource, [:int], :bool],
@@ -2108,7 +2763,7 @@ module ImGui
2108
2763
  [:igColumns, [:int, :pointer, :bool], :void],
2109
2764
  [:igCombo_Str_arr, [:pointer, :pointer, :pointer, :int, :int], :bool],
2110
2765
  [:igCombo_Str, [:pointer, :pointer, :pointer, :int], :bool],
2111
- [:igCombo_FnBoolPtr, [:pointer, :pointer, :pointer, :pointer, :int, :int], :bool],
2766
+ [:igCombo_FnStrPtr, [:pointer, :pointer, :pointer, :pointer, :int, :int], :bool],
2112
2767
  [:igCreateContext, [:pointer], :pointer],
2113
2768
  [:igDebugCheckVersionAndDataLayout, [:pointer, :size_t, :size_t, :size_t, :size_t, :size_t, :size_t], :bool],
2114
2769
  [:igDebugTextEncoding, [:pointer], :void],
@@ -2128,7 +2783,6 @@ module ImGui
2128
2783
  [:igDummy, [ImVec2.by_value], :void],
2129
2784
  [:igEnd, [], :void],
2130
2785
  [:igEndChild, [], :void],
2131
- [:igEndChildFrame, [], :void],
2132
2786
  [:igEndCombo, [], :void],
2133
2787
  [:igEndDisabled, [], :void],
2134
2788
  [:igEndDragDropSource, [], :void],
@@ -2241,6 +2895,7 @@ module ImGui
2241
2895
  [:igIsItemHovered, [:int], :bool],
2242
2896
  [:igIsItemToggledOpen, [], :bool],
2243
2897
  [:igIsItemVisible, [], :bool],
2898
+ [:igIsKeyChordPressed, [:int], :bool],
2244
2899
  [:igIsKeyDown, [:int], :bool],
2245
2900
  [:igIsKeyPressed, [:int, :bool], :bool],
2246
2901
  [:igIsKeyReleased, [:int], :bool],
@@ -2260,7 +2915,7 @@ module ImGui
2260
2915
  [:igIsWindowHovered, [:int], :bool],
2261
2916
  [:igLabelText, [:pointer, :pointer, :varargs], :void],
2262
2917
  [:igListBox_Str_arr, [:pointer, :pointer, :pointer, :int, :int], :bool],
2263
- [:igListBox_FnBoolPtr, [:pointer, :pointer, :pointer, :pointer, :int, :int], :bool],
2918
+ [:igListBox_FnStrPtr, [:pointer, :pointer, :pointer, :pointer, :int, :int], :bool],
2264
2919
  [:igLoadIniSettingsFromDisk, [:pointer], :void],
2265
2920
  [:igLoadIniSettingsFromMemory, [:pointer, :size_t], :void],
2266
2921
  [:igLogButtons, [], :void],
@@ -2368,8 +3023,8 @@ module ImGui
2368
3023
  [:igShowDebugLogWindow, [:pointer], :void],
2369
3024
  [:igShowDemoWindow, [:pointer], :void],
2370
3025
  [:igShowFontSelector, [:pointer], :void],
3026
+ [:igShowIDStackToolWindow, [:pointer], :void],
2371
3027
  [:igShowMetricsWindow, [:pointer], :void],
2372
- [:igShowStackToolWindow, [:pointer], :void],
2373
3028
  [:igShowStyleEditor, [:pointer], :void],
2374
3029
  [:igShowStyleSelector, [:pointer], :bool],
2375
3030
  [:igShowUserGuide, [], :void],
@@ -2390,6 +3045,7 @@ module ImGui
2390
3045
  [:igStyleColorsDark, [:pointer], :void],
2391
3046
  [:igStyleColorsLight, [:pointer], :void],
2392
3047
  [:igTabItemButton, [:pointer, :int], :bool],
3048
+ [:igTableAngledHeadersRow, [], :void],
2393
3049
  [:igTableGetColumnCount, [], :int],
2394
3050
  [:igTableGetColumnFlags, [:int], :int],
2395
3051
  [:igTableGetColumnIndex, [], :int],
@@ -2470,30 +3126,24 @@ module ImGui
2470
3126
  # Some information such as 'flags' or 'p_open' will only be considered by the first call to Begin().
2471
3127
  # - Begin() return false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting
2472
3128
  # anything to the window. Always call a matching End() for each Begin() call, regardless of its return value!
2473
- # [Important: due to legacy reason, this is inconsistent with most other functions such as BeginMenu/EndMenu,
2474
- # BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function
2475
- # returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.]
3129
+ # [Important: due to legacy reason, Begin/End and BeginChild/EndChild are inconsistent with all other functions
3130
+ # such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding
3131
+ # BeginXXX function returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.]
2476
3132
  # - Note that the bottom of window stack always contains a window called "Debug".
2477
3133
  def self.Begin(name, p_open = nil, flags = 0)
2478
3134
  igBegin(name, p_open, flags)
2479
3135
  end
2480
3136
 
2481
- # arg: str_id(const char*), size(ImVec2), border(bool), flags(ImGuiWindowFlags)
3137
+ # arg: str_id(const char*), size(ImVec2), child_flags(ImGuiChildFlags), window_flags(ImGuiWindowFlags)
2482
3138
  # ret: bool
2483
- def self.BeginChild_Str(str_id, size = ImVec2.create(0,0), border = false, flags = 0)
2484
- igBeginChild_Str(str_id, size, border, flags)
3139
+ def self.BeginChild_Str(str_id, size = ImVec2.create(0,0), child_flags = 0, window_flags = 0)
3140
+ igBeginChild_Str(str_id, size, child_flags, window_flags)
2485
3141
  end
2486
3142
 
2487
- # arg: id(ImGuiID), size(ImVec2), border(bool), flags(ImGuiWindowFlags)
3143
+ # arg: id(ImGuiID), size(ImVec2), child_flags(ImGuiChildFlags), window_flags(ImGuiWindowFlags)
2488
3144
  # ret: bool
2489
- def self.BeginChild_ID(id, size = ImVec2.create(0,0), border = false, flags = 0)
2490
- igBeginChild_ID(id, size, border, flags)
2491
- end
2492
-
2493
- # arg: id(ImGuiID), size(ImVec2), flags(ImGuiWindowFlags)
2494
- # ret: bool
2495
- def self.BeginChildFrame(id, size, flags = 0) # helper to create a child window / scrolling region that looks like a normal widget frame
2496
- igBeginChildFrame(id, size, flags)
3145
+ def self.BeginChild_ID(id, size = ImVec2.create(0,0), child_flags = 0, window_flags = 0)
3146
+ igBeginChild_ID(id, size, child_flags, window_flags)
2497
3147
  end
2498
3148
 
2499
3149
  # arg: label(const char*), preview_value(const char*), flags(ImGuiComboFlags)
@@ -2542,9 +3192,9 @@ module ImGui
2542
3192
  # ret: bool
2543
3193
  #
2544
3194
  # Tooltips: helpers for showing a tooltip when hovering an item
2545
- # - BeginItemTooltip() is a shortcut for the 'if (IsItemHovered(ImGuiHoveredFlags_Tooltip) && BeginTooltip())' idiom.
2546
- # - SetItemTooltip() is a shortcut for the 'if (IsItemHovered(ImGuiHoveredFlags_Tooltip)) { SetTooltip(...); }' idiom.
2547
- # - Where 'ImGuiHoveredFlags_Tooltip' itself is a shortcut to use 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav' depending on active input type. For mouse it defaults to 'ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort'.
3195
+ # - BeginItemTooltip() is a shortcut for the 'if (IsItemHovered(ImGuiHoveredFlags_ForTooltip) && BeginTooltip())' idiom.
3196
+ # - SetItemTooltip() is a shortcut for the 'if (IsItemHovered(ImGuiHoveredFlags_ForTooltip)) { SetTooltip(...); }' idiom.
3197
+ # - Where 'ImGuiHoveredFlags_ForTooltip' itself is a shortcut to use 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav' depending on active input type. For mouse it defaults to 'ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort'.
2548
3198
  def self.BeginItemTooltip() # begin/append a tooltip window if preceding item was hovered.
2549
3199
  igBeginItemTooltip()
2550
3200
  end
@@ -2553,8 +3203,8 @@ module ImGui
2553
3203
  # ret: bool
2554
3204
  #
2555
3205
  # Widgets: List Boxes
2556
- # - This is essentially a thin wrapper to using BeginChild/EndChild with some stylistic changes.
2557
- # - The BeginListBox()/EndListBox() api allows you to manage your contents and selection state however you want it, by creating e.g. Selectable() or any items.
3206
+ # - This is essentially a thin wrapper to using BeginChild/EndChild with the ImGuiChildFlags_FrameStyle flag for stylistic changes + displaying a label.
3207
+ # - You can submit contents and manage your selection state however you want it, by creating e.g. Selectable() or any other items.
2558
3208
  # - The simplified/old ListBox() api are helpers over BeginListBox()/EndListBox() which are kept available for convenience purpose. This is analoguous to how Combos are created.
2559
3209
  # - Choose frame width: size.x > 0.0f: custom / size.x < 0.0f or -FLT_MIN: right-align / size.x = 0.0f (default): use current ItemWidth
2560
3210
  # - Choose frame height: size.y > 0.0f: custom / size.y < 0.0f or -FLT_MIN: bottom-align / size.y = 0.0f (default): arbitrary default height which can fit ~7 items
@@ -2832,10 +3482,10 @@ module ImGui
2832
3482
  igCombo_Str(label, current_item, items_separated_by_zeros, popup_max_height_in_items)
2833
3483
  end
2834
3484
 
2835
- # arg: label(const char*), current_item(int*), items_getter(bool(*)(void* data,int idx,const char** out_text)), data(void*), items_count(int), popup_max_height_in_items(int)
3485
+ # arg: label(const char*), current_item(int*), getter(const char*(*)(void* user_data,int idx)), user_data(void*), items_count(int), popup_max_height_in_items(int)
2836
3486
  # ret: bool
2837
- def self.Combo_FnBoolPtr(label, current_item, items_getter, data, items_count, popup_max_height_in_items = -1)
2838
- igCombo_FnBoolPtr(label, current_item, items_getter, data, items_count, popup_max_height_in_items)
3487
+ def self.Combo_FnStrPtr(label, current_item, getter, user_data, items_count, popup_max_height_in_items = -1)
3488
+ igCombo_FnStrPtr(label, current_item, getter, user_data, items_count, popup_max_height_in_items)
2839
3489
  end
2840
3490
 
2841
3491
  # arg: shared_font_atlas(ImFontAtlas*)
@@ -2970,11 +3620,6 @@ module ImGui
2970
3620
  igEndChild()
2971
3621
  end
2972
3622
 
2973
- # ret: void
2974
- def self.EndChildFrame() # always call EndChildFrame() regardless of BeginChildFrame() return values (which indicates a collapsed/clipped window)
2975
- igEndChildFrame()
2976
- end
2977
-
2978
3623
  # ret: void
2979
3624
  def self.EndCombo() # only call EndCombo() if BeginCombo() returns true!
2980
3625
  igEndCombo()
@@ -3135,38 +3780,47 @@ module ImGui
3135
3780
  end
3136
3781
 
3137
3782
  # ret: void
3138
- def self.GetCursorPos() # cursor position in window coordinates (relative to window position)
3783
+ def self.GetCursorPos() # [window-local] cursor position in window coordinates (relative to window position)
3139
3784
  pOut = ImVec2.new
3140
3785
  igGetCursorPos(pOut)
3141
3786
  return pOut
3142
3787
  end
3143
3788
 
3144
3789
  # ret: float
3145
- def self.GetCursorPosX() # (some functions are using window-relative coordinates, such as: GetCursorPos, GetCursorStartPos, GetContentRegionMax, GetWindowContentRegion* etc.
3790
+ def self.GetCursorPosX() # [window-local] "
3146
3791
  igGetCursorPosX()
3147
3792
  end
3148
3793
 
3149
3794
  # ret: float
3150
- def self.GetCursorPosY() # other functions such as GetCursorScreenPos or everything in ImDrawList::
3795
+ def self.GetCursorPosY() # [window-local] "
3151
3796
  igGetCursorPosY()
3152
3797
  end
3153
3798
 
3154
3799
  # ret: void
3155
- def self.GetCursorScreenPos() # cursor position in absolute coordinates (useful to work with ImDrawList API). generally top-left == GetMainViewport()->Pos == (0,0) in single viewport mode, and bottom-right == GetMainViewport()->Pos+Size == io.DisplaySize in single-viewport mode.
3800
+ #
3801
+ # Layout cursor positioning
3802
+ # - By "cursor" we mean the current output position.
3803
+ # - The typical widget behavior is to output themselves at the current cursor position, then move the cursor one line down.
3804
+ # - You can call SameLine() between widgets to undo the last carriage return and output at the right of the preceding widget.
3805
+ # - Attention! We currently have inconsistencies between window-local and absolute positions we will aim to fix with future API:
3806
+ # - Absolute coordinate: GetCursorScreenPos(), SetCursorScreenPos(), all ImDrawList:: functions. -> this is the preferred way forward.
3807
+ # - Window-local coordinates: SameLine(), GetCursorPos(), SetCursorPos(), GetCursorStartPos(), GetContentRegionMax(), GetWindowContentRegion*(), PushTextWrapPos()
3808
+ # - GetCursorScreenPos() = GetCursorPos() + GetWindowPos(). GetWindowPos() is almost only ever useful to convert from window-local to absolute coordinates.
3809
+ def self.GetCursorScreenPos() # cursor position in absolute coordinates (prefer using this, also more useful to work with ImDrawList API).
3156
3810
  pOut = ImVec2.new
3157
3811
  igGetCursorScreenPos(pOut)
3158
3812
  return pOut
3159
3813
  end
3160
3814
 
3161
3815
  # ret: void
3162
- def self.GetCursorStartPos() # initial cursor position in window coordinates
3816
+ def self.GetCursorStartPos() # [window-local] initial cursor position, in window coordinates
3163
3817
  pOut = ImVec2.new
3164
3818
  igGetCursorStartPos(pOut)
3165
3819
  return pOut
3166
3820
  end
3167
3821
 
3168
3822
  # ret: pointer
3169
- def self.GetDragDropPayload() # peek directly into the current payload from anywhere. may return NULL. use ImGuiPayload::IsDataType() to test for the payload type.
3823
+ def self.GetDragDropPayload() # peek directly into the current payload from anywhere. returns NULL when drag and drop is finished or inactive. use ImGuiPayload::IsDataType() to test for the payload type.
3170
3824
  igGetDragDropPayload()
3171
3825
  end
3172
3826
 
@@ -3428,14 +4082,14 @@ module ImGui
3428
4082
  end
3429
4083
 
3430
4084
  # ret: void
3431
- def self.GetWindowPos() # get current window position in screen space (useful if you want to do your own drawing via the DrawList API)
4085
+ def self.GetWindowPos() # get current window position in screen space (note: it is unlikely you need to use this. Consider using current layout pos instead, GetCursorScreenPos())
3432
4086
  pOut = ImVec2.new
3433
4087
  igGetWindowPos(pOut)
3434
4088
  return pOut
3435
4089
  end
3436
4090
 
3437
4091
  # ret: void
3438
- def self.GetWindowSize() # get current window size
4092
+ def self.GetWindowSize() # get current window size (note: it is unlikely you need to use this. Consider using GetCursorScreenPos() and e.g. GetContentRegionAvail() instead)
3439
4093
  pOut = ImVec2.new
3440
4094
  igGetWindowSize(pOut)
3441
4095
  return pOut
@@ -3451,14 +4105,15 @@ module ImGui
3451
4105
  #
3452
4106
  # Widgets: Images
3453
4107
  # - Read about ImTextureID here: https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
4108
+ # - Note that ImageButton() adds style.FramePadding*2.0f to provided size. This is in order to facilitate fitting an image in a button.
3454
4109
  def self.Image(user_texture_id, size, uv0 = ImVec2.create(0,0), uv1 = ImVec2.create(1,1), tint_col = ImVec4.create(1,1,1,1), border_col = ImVec4.create(0,0,0,0)) # Implied uv0 = ImVec2(0, 0), uv1 = ImVec2(1, 1), tint_col = ImVec4(1, 1, 1, 1), border_col = ImVec4(0, 0, 0, 0)
3455
4110
  igImage(user_texture_id, size, uv0, uv1, tint_col, border_col)
3456
4111
  end
3457
4112
 
3458
- # arg: str_id(const char*), user_texture_id(ImTextureID), size(ImVec2), uv0(ImVec2), uv1(ImVec2), bg_col(ImVec4), tint_col(ImVec4)
4113
+ # arg: str_id(const char*), user_texture_id(ImTextureID), image_size(ImVec2), uv0(ImVec2), uv1(ImVec2), bg_col(ImVec4), tint_col(ImVec4)
3459
4114
  # ret: bool
3460
- def self.ImageButton(str_id, user_texture_id, size, uv0 = ImVec2.create(0,0), uv1 = ImVec2.create(1,1), bg_col = ImVec4.create(0,0,0,0), tint_col = ImVec4.create(1,1,1,1)) # Implied uv0 = ImVec2(0, 0), uv1 = ImVec2(1, 1), bg_col = ImVec4(0, 0, 0, 0), tint_col = ImVec4(1, 1, 1, 1)
3461
- igImageButton(str_id, user_texture_id, size, uv0, uv1, bg_col, tint_col)
4115
+ def self.ImageButton(str_id, user_texture_id, image_size, uv0 = ImVec2.create(0,0), uv1 = ImVec2.create(1,1), bg_col = ImVec4.create(0,0,0,0), tint_col = ImVec4.create(1,1,1,1)) # Implied uv0 = ImVec2(0, 0), uv1 = ImVec2(1, 1), bg_col = ImVec4(0, 0, 0, 0), tint_col = ImVec4(1, 1, 1, 1)
4116
+ igImageButton(str_id, user_texture_id, image_size, uv0, uv1, bg_col, tint_col)
3462
4117
  end
3463
4118
 
3464
4119
  # arg: indent_w(float)
@@ -3637,6 +4292,12 @@ module ImGui
3637
4292
  igIsItemVisible()
3638
4293
  end
3639
4294
 
4295
+ # arg: key_chord(ImGuiKeyChord)
4296
+ # ret: bool
4297
+ def self.IsKeyChordPressed(key_chord) # was key chord (mods + key) pressed, e.g. you can pass 'ImGuiMod_Ctrl | ImGuiKey_S' as a key-chord. This doesn't do any routing or focus check, please consider using Shortcut() function instead.
4298
+ igIsKeyChordPressed(key_chord)
4299
+ end
4300
+
3640
4301
  # arg: key(ImGuiKey)
3641
4302
  # ret: bool
3642
4303
  #
@@ -3752,7 +4413,7 @@ module ImGui
3752
4413
 
3753
4414
  # arg: flags(ImGuiHoveredFlags)
3754
4415
  # ret: bool
3755
- def self.IsWindowHovered(flags = 0) # is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. NB: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that! Please read the FAQ!
4416
+ def self.IsWindowHovered(flags = 0) # is current window hovered and hoverable (e.g. not blocked by a popup/modal)? See ImGuiHoveredFlags_ for options. IMPORTANT: If you are trying to check whether your mouse should be dispatched to Dear ImGui or to your underlying app, you should not use this function! Use the 'io.WantCaptureMouse' boolean for that! Refer to FAQ entry "How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?" for details.
3756
4417
  igIsWindowHovered(flags)
3757
4418
  end
3758
4419
 
@@ -3768,10 +4429,10 @@ module ImGui
3768
4429
  igListBox_Str_arr(label, current_item, items, items_count, height_in_items)
3769
4430
  end
3770
4431
 
3771
- # arg: label(const char*), current_item(int*), items_getter(bool(*)(void* data,int idx,const char** out_text)), data(void*), items_count(int), height_in_items(int)
4432
+ # arg: label(const char*), current_item(int*), getter(const char*(*)(void* user_data,int idx)), user_data(void*), items_count(int), height_in_items(int)
3772
4433
  # ret: bool
3773
- def self.ListBox_FnBoolPtr(label, current_item, items_getter, data, items_count, height_in_items = -1)
3774
- igListBox_FnBoolPtr(label, current_item, items_getter, data, items_count, height_in_items)
4434
+ def self.ListBox_FnStrPtr(label, current_item, getter, user_data, items_count, height_in_items = -1)
4435
+ igListBox_FnStrPtr(label, current_item, getter, user_data, items_count, height_in_items)
3775
4436
  end
3776
4437
 
3777
4438
  # arg: ini_filename(const char*)
@@ -4108,13 +4769,7 @@ module ImGui
4108
4769
 
4109
4770
  # ret: void
4110
4771
  #
4111
- # Cursor / Layout
4112
- # - By "cursor" we mean the current output position.
4113
- # - The typical widget behavior is to output themselves at the current cursor position, then move the cursor one line down.
4114
- # - You can call SameLine() between widgets to undo the last carriage return and output at the right of the preceding widget.
4115
- # - Attention! We currently have inconsistencies between window-local and absolute positions we will aim to fix with future API:
4116
- # Window-local coordinates: SameLine(), GetCursorPos(), SetCursorPos(), GetCursorStartPos(), GetContentRegionMax(), GetWindowContentRegion*(), PushTextWrapPos()
4117
- # Absolute coordinate: GetCursorScreenPos(), SetCursorScreenPos(), all ImDrawList:: functions.
4772
+ # Other layout functions
4118
4773
  def self.Separator() # separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.
4119
4774
  igSeparator()
4120
4775
  end
@@ -4168,19 +4823,19 @@ module ImGui
4168
4823
 
4169
4824
  # arg: local_pos(ImVec2)
4170
4825
  # ret: void
4171
- def self.SetCursorPos(local_pos) # are using the main, absolute coordinate system.
4826
+ def self.SetCursorPos(local_pos) # [window-local] "
4172
4827
  igSetCursorPos(local_pos)
4173
4828
  end
4174
4829
 
4175
4830
  # arg: local_x(float)
4176
4831
  # ret: void
4177
- def self.SetCursorPosX(local_x) # GetWindowPos() + GetCursorPos() == GetCursorScreenPos() etc.)
4832
+ def self.SetCursorPosX(local_x) # [window-local] "
4178
4833
  igSetCursorPosX(local_x)
4179
4834
  end
4180
4835
 
4181
4836
  # arg: local_y(float)
4182
4837
  # ret: void
4183
- def self.SetCursorPosY(local_y) #
4838
+ def self.SetCursorPosY(local_y) # [window-local] "
4184
4839
  igSetCursorPosY(local_y)
4185
4840
  end
4186
4841
 
@@ -4299,7 +4954,7 @@ module ImGui
4299
4954
 
4300
4955
  # arg: size_min(ImVec2), size_max(ImVec2), custom_callback(ImGuiSizeCallback), custom_callback_data(void*)
4301
4956
  # ret: void
4302
- def self.SetNextWindowSizeConstraints(size_min, size_max, custom_callback = nil, custom_callback_data = nil) # set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Sizes will be rounded down. Use callback to apply non-trivial programmatic constraints.
4957
+ def self.SetNextWindowSizeConstraints(size_min, size_max, custom_callback = nil, custom_callback_data = nil) # set next window size limits. use 0.0f or FLT_MAX if you don't want limits. Use -1 for both min and max of same axis to preserve current size (which itself is a constraint). Use callback to apply non-trivial programmatic constraints.
4303
4958
  igSetNextWindowSizeConstraints(size_min, size_max, custom_callback, custom_callback_data)
4304
4959
  end
4305
4960
 
@@ -4438,14 +5093,14 @@ module ImGui
4438
5093
 
4439
5094
  # arg: p_open(bool*)
4440
5095
  # ret: void
4441
- def self.ShowMetricsWindow(p_open = nil) # create Metrics/Debugger window. display Dear ImGui internals: windows, draw commands, various internal state, etc.
4442
- igShowMetricsWindow(p_open)
5096
+ def self.ShowIDStackToolWindow(p_open = nil) # Implied p_open = NULL
5097
+ igShowIDStackToolWindow(p_open)
4443
5098
  end
4444
5099
 
4445
5100
  # arg: p_open(bool*)
4446
5101
  # ret: void
4447
- def self.ShowStackToolWindow(p_open = nil) # create Stack Tool window. hover items with mouse to query information about the source of their unique ID.
4448
- igShowStackToolWindow(p_open)
5102
+ def self.ShowMetricsWindow(p_open = nil) # create Metrics/Debugger window. display Dear ImGui internals: windows, draw commands, various internal state, etc.
5103
+ igShowMetricsWindow(p_open)
4449
5104
  end
4450
5105
 
4451
5106
  # arg: ref(ImGuiStyle*)
@@ -4540,7 +5195,7 @@ module ImGui
4540
5195
 
4541
5196
  # arg: label(const char*)
4542
5197
  # ret: bool
4543
- def self.SmallButton(label) # button with FramePadding=(0,0) to easily embed within text
5198
+ def self.SmallButton(label) # button with (FramePadding.y == 0) to easily embed within text
4544
5199
  igSmallButton(label)
4545
5200
  end
4546
5201
 
@@ -4575,6 +5230,11 @@ module ImGui
4575
5230
  igTabItemButton(label, flags)
4576
5231
  end
4577
5232
 
5233
+ # ret: void
5234
+ def self.TableAngledHeadersRow() # submit a row with angled headers for every column with the ImGuiTableColumnFlags_AngledHeader flag. MUST BE FIRST ROW.
5235
+ igTableAngledHeadersRow()
5236
+ end
5237
+
4578
5238
  # ret: int
4579
5239
  def self.TableGetColumnCount() # return number of columns (value passed to BeginTable)
4580
5240
  igTableGetColumnCount()
@@ -4621,7 +5281,7 @@ module ImGui
4621
5281
  end
4622
5282
 
4623
5283
  # ret: void
4624
- def self.TableHeadersRow() # submit all headers cells based on data provided to TableSetupColumn() + submit context menu
5284
+ def self.TableHeadersRow() # submit a row with headers cells based on data provided to TableSetupColumn() + submit context menu
4625
5285
  igTableHeadersRow()
4626
5286
  end
4627
5287
 
@@ -4813,19 +5473,29 @@ module ImGui
4813
5473
  #
4814
5474
  # Child Windows
4815
5475
  # - Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window. Child windows can embed their own child.
4816
- # - For each independent axis of 'size': ==0.0f: use remaining host window size / >0.0f: fixed size / <0.0f: use remaining window size minus abs(size) / Each axis can use a different mode, e.g. ImVec2(0,400).
4817
- # - BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting anything to the window.
4818
- # Always call a matching EndChild() for each BeginChild() call, regardless of its return value.
4819
- # [Important: due to legacy reason, this is inconsistent with most other functions such as BeginMenu/EndMenu,
4820
- # BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function
4821
- # returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.]
5476
+ # - Before 1.90 (November 2023), the "ImGuiChildFlags child_flags = 0" parameter was "bool border = false".
5477
+ # This API is backward compatible with old code, as we guarantee that ImGuiChildFlags_Border == true.
5478
+ # Consider updating your old call sites:
5479
+ # BeginChild("Name", size, false) -> Begin("Name", size, 0); or Begin("Name", size, ImGuiChildFlags_None);
5480
+ # BeginChild("Name", size, true) -> Begin("Name", size, ImGuiChildFlags_Border);
5481
+ # - Manual sizing (each axis can use a different setting e.g. ImVec2(0.0f, 400.0f)):
5482
+ # == 0.0f: use remaining parent window size for this axis.
5483
+ # > 0.0f: use specified size for this axis.
5484
+ # < 0.0f: right/bottom-align to specified distance from available content boundaries.
5485
+ # - Specifying ImGuiChildFlags_AutoResizeX or ImGuiChildFlags_AutoResizeY makes the sizing automatic based on child contents.
5486
+ # Combining both ImGuiChildFlags_AutoResizeX _and_ ImGuiChildFlags_AutoResizeY defeats purpose of a scrolling region and is NOT recommended.
5487
+ # - BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting
5488
+ # anything to the window. Always call a matching EndChild() for each BeginChild() call, regardless of its return value.
5489
+ # [Important: due to legacy reason, Begin/End and BeginChild/EndChild are inconsistent with all other functions
5490
+ # such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding
5491
+ # BeginXXX function returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.]
4822
5492
  def self.BeginChild(*arg)
4823
- # arg: 0:str_id(const char*), 1:size(ImVec2), 2:border(bool), 3:flags(ImGuiWindowFlags)
5493
+ # arg: 0:str_id(const char*), 1:size(ImVec2), 2:child_flags(ImGuiChildFlags), 3:window_flags(ImGuiWindowFlags)
4824
5494
  # ret: bool
4825
- return igBeginChild_Str(arg[0], arg[1], arg[2], arg[3]) if arg.length == 4 && (arg[0].kind_of?(String) && arg[1].kind_of?(ImVec2) && (arg[2].is_a?(TrueClass) || arg[2].is_a?(FalseClass)) && arg[3].kind_of?(Integer))
4826
- # arg: 0:id(ImGuiID), 1:size(ImVec2), 2:border(bool), 3:flags(ImGuiWindowFlags)
5495
+ return igBeginChild_Str(arg[0], arg[1], arg[2], arg[3]) if arg.length == 4 && (arg[0].kind_of?(String) && arg[1].kind_of?(ImVec2) && arg[2].kind_of?(Integer) && arg[3].kind_of?(Integer))
5496
+ # arg: 0:id(ImGuiID), 1:size(ImVec2), 2:child_flags(ImGuiChildFlags), 3:window_flags(ImGuiWindowFlags)
4827
5497
  # ret: bool
4828
- return igBeginChild_ID(arg[0], arg[1], arg[2], arg[3]) if arg.length == 4 && (arg[0].kind_of?(Integer) && arg[1].kind_of?(ImVec2) && (arg[2].is_a?(TrueClass) || arg[2].is_a?(FalseClass)) && arg[3].kind_of?(Integer))
5498
+ return igBeginChild_ID(arg[0], arg[1], arg[2], arg[3]) if arg.length == 4 && (arg[0].kind_of?(Integer) && arg[1].kind_of?(ImVec2) && arg[2].kind_of?(Integer) && arg[3].kind_of?(Integer))
4829
5499
  $stderr.puts("[Warning] BeginChild : No matching functions found (#{arg})")
4830
5500
  end
4831
5501
 
@@ -4856,9 +5526,9 @@ module ImGui
4856
5526
  # arg: 0:label(const char*), 1:current_item(int*), 2:items_separated_by_zeros(const char*), 3:popup_max_height_in_items(int)
4857
5527
  # ret: bool
4858
5528
  return igCombo_Str(arg[0], arg[1], arg[2], arg[3]) if arg.length == 4 && (arg[0].kind_of?(String) && arg[1].kind_of?(FFI::Pointer) && arg[2].kind_of?(String) && arg[3].kind_of?(Integer))
4859
- # arg: 0:label(const char*), 1:current_item(int*), 2:items_getter(bool(*)(void* data,int idx,const char** out_text)), 3:data(void*), 4:items_count(int), 5:popup_max_height_in_items(int)
5529
+ # arg: 0:label(const char*), 1:current_item(int*), 2:getter(const char*(*)(void* user_data,int idx)), 3:user_data(void*), 4:items_count(int), 5:popup_max_height_in_items(int)
4860
5530
  # ret: bool
4861
- return igCombo_FnBoolPtr(arg[0], arg[1], arg[2], arg[3], arg[4], arg[5]) if arg.length == 6 && (arg[0].kind_of?(String) && arg[1].kind_of?(FFI::Pointer) && arg[2].kind_of?(String) && arg[3].kind_of?(FFI::Pointer) && arg[4].kind_of?(Integer) && arg[5].kind_of?(Integer))
5531
+ return igCombo_FnStrPtr(arg[0], arg[1], arg[2], arg[3], arg[4], arg[5]) if arg.length == 6 && (arg[0].kind_of?(String) && arg[1].kind_of?(FFI::Pointer) && arg[2].kind_of?(String) && arg[3].kind_of?(FFI::Pointer) && arg[4].kind_of?(Integer) && arg[5].kind_of?(Integer))
4862
5532
  $stderr.puts("[Warning] Combo : No matching functions found (#{arg})")
4863
5533
  end
4864
5534
 
@@ -4902,9 +5572,9 @@ module ImGui
4902
5572
  # arg: 0:label(const char*), 1:current_item(int*), 2:items(const char* const[]), 3:items_count(int), 4:height_in_items(int)
4903
5573
  # ret: bool
4904
5574
  return igListBox_Str_arr(arg[0], arg[1], arg[2], arg[3], arg[4]) if arg.length == 5 && (arg[0].kind_of?(String) && arg[1].kind_of?(FFI::Pointer) && arg[2].kind_of?(FFI::Pointer) && arg[3].kind_of?(Integer) && arg[4].kind_of?(Integer))
4905
- # arg: 0:label(const char*), 1:current_item(int*), 2:items_getter(bool(*)(void* data,int idx,const char** out_text)), 3:data(void*), 4:items_count(int), 5:height_in_items(int)
5575
+ # arg: 0:label(const char*), 1:current_item(int*), 2:getter(const char*(*)(void* user_data,int idx)), 3:user_data(void*), 4:items_count(int), 5:height_in_items(int)
4906
5576
  # ret: bool
4907
- return igListBox_FnBoolPtr(arg[0], arg[1], arg[2], arg[3], arg[4], arg[5]) if arg.length == 6 && (arg[0].kind_of?(String) && arg[1].kind_of?(FFI::Pointer) && arg[2].kind_of?(String) && arg[3].kind_of?(FFI::Pointer) && arg[4].kind_of?(Integer) && arg[5].kind_of?(Integer))
5577
+ return igListBox_FnStrPtr(arg[0], arg[1], arg[2], arg[3], arg[4], arg[5]) if arg.length == 6 && (arg[0].kind_of?(String) && arg[1].kind_of?(FFI::Pointer) && arg[2].kind_of?(String) && arg[3].kind_of?(FFI::Pointer) && arg[4].kind_of?(Integer) && arg[5].kind_of?(Integer))
4908
5578
  $stderr.puts("[Warning] ListBox : No matching functions found (#{arg})")
4909
5579
  end
4910
5580