imgui-bindings 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d87ec8e99e502e7af7a1140e077bfc391588de648388862181eb33d69f6a743a
4
- data.tar.gz: 524fdc84f32f61cc4728d8bf3cba79aa712e6d12427929ad116632327f10d337
3
+ metadata.gz: bc25695edcc3a2e8f96335f2b2d9981da7f35a5a9e3fa0589a2b7ad994a2ae8e
4
+ data.tar.gz: 7456b6e28ad9b9daa3197ccc5f9d221d200b264bd736a2181b2d1d669b64809c
5
5
  SHA512:
6
- metadata.gz: 760108258fef2289eae2dc61e05dd58f6f4ea4442989d1ff94daae0a8e3a9531b47a3a1a8c47fd2c53b3aa7ec9c6b84c04f4fa92dd4de67dcc8d11f7f0351c92
7
- data.tar.gz: 7a40dcc27963521f71eb965c92eedb3df3c092a62c0352608670e29f34ead83c54d01dd3642598933d2b0334d429781522d8226886468028f23e8dc50ff20032
6
+ metadata.gz: 01fde890de2b920ec21fd6e0a71fa440023172b4d1926e50137e00e513aa5c2d5ea13636bc0aa73224452269b179649747ba8bbd939d6af2922b059de4db86b6
7
+ data.tar.gz: 595e8412c5de791acbf56284aea8af640baa4d019b613c896298f92826d61c353747b1b55df7aedc20d01e8d7ad233b62a6ca170ff7f6693ccd172d6a7b592f5
data/ChangeLog CHANGED
@@ -1,3 +1,12 @@
1
+ 2023-09-09 vaiorabbit <http://twitter.com/vaiorabbit>
2
+
3
+ * ImGui v1.89.9
4
+ * Added several structs
5
+
6
+ 2023-08-10 vaiorabbit <http://twitter.com/vaiorabbit>
7
+
8
+ * ImGui v1.89.8
9
+
1
10
  2023-07-29 vaiorabbit <http://twitter.com/vaiorabbit>
2
11
 
3
12
  * ImGui v1.89.7
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  # Yet another ImGui wrapper for Ruby #
4
4
 
5
5
  * Created : 2019-01-05
6
- * Last modified : 2023-07-29
6
+ * Last modified : 2023-09-09
7
7
 
8
8
  <img src="https://raw.githubusercontent.com/vaiorabbit/ruby-imgui/master/doc/jpfont_test.png" width="250">
9
9
 
data/lib/imgui.aarch64.so CHANGED
Binary file
data/lib/imgui.dll CHANGED
Binary file
data/lib/imgui.dylib CHANGED
Binary file
data/lib/imgui.rb CHANGED
@@ -297,12 +297,12 @@ ImGuiHoveredFlags_NoNavOverride = 2048 # 1 << 11 # IsItemHovered()
297
297
  ImGuiHoveredFlags_AllowWhenOverlapped = 768 # ImGuiHoveredFlags_AllowWhenOverlappedByItem | ImGuiHoveredFlags_AllowWhenOverlappedByWindow
298
298
  ImGuiHoveredFlags_RectOnly = 928 # ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped
299
299
  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)
300
+ ImGuiHoveredFlags_ForTooltip = 4096 # 1 << 12 # Shortcut for standard flags when using IsItemHovered() + SetTooltip() sequence.
301
+ 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.
302
+ ImGuiHoveredFlags_DelayNone = 16384 # 1 << 14 # IsItemHovered() only: Return true immediately (default). As this is the default you generally ignore this.
303
+ 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).
304
+ 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).
305
+ 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
306
 
307
307
  # ImGuiInputTextFlags_
308
308
  # Flags for ImGui::InputText()
@@ -779,7 +779,7 @@ ImGuiTreeNodeFlags_DefaultOpen = 32 # 1 << 5 # Default node to be ope
779
779
  ImGuiTreeNodeFlags_OpenOnDoubleClick = 64 # 1 << 6 # Need double-click to open node
780
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
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
782
+ 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!
783
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
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
785
  ImGuiTreeNodeFlags_SpanFullWidth = 4096 # 1 << 12 # Extend hit box to the left-most and right-most edges (bypass the indented area).
@@ -869,6 +869,35 @@ class ImDrawListSplitter < FFI::Struct
869
869
  :_Count, :int, # Number of active channels (1+)
870
870
  :_Channels, ImVector.by_value # Draw channels (not resized down so _Count might be < Channels.Size)
871
871
  )
872
+
873
+ def Clear()
874
+ ImGui::ImDrawListSplitter_Clear(self)
875
+ end
876
+
877
+ def ClearFreeMemory()
878
+ ImGui::ImDrawListSplitter_ClearFreeMemory(self)
879
+ end
880
+
881
+ def self.create()
882
+ return ImDrawListSplitter.new(ImGui::ImDrawListSplitter_ImDrawListSplitter())
883
+ end
884
+
885
+ def Merge(draw_list)
886
+ ImGui::ImDrawListSplitter_Merge(self, draw_list)
887
+ end
888
+
889
+ def SetCurrentChannel(draw_list, channel_idx)
890
+ ImGui::ImDrawListSplitter_SetCurrentChannel(self, draw_list, channel_idx)
891
+ end
892
+
893
+ def Split(draw_list, count)
894
+ ImGui::ImDrawListSplitter_Split(self, draw_list, count)
895
+ end
896
+
897
+ def destroy()
898
+ ImGui::ImDrawListSplitter_destroy(self)
899
+ end
900
+
872
901
  end
873
902
 
874
903
  # Typically, 1 command = 1 GPU draw call (unless command is a callback)
@@ -886,6 +915,19 @@ class ImDrawCmd < FFI::Struct
886
915
  :UserCallback, :pointer, # 4-8 // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
887
916
  :UserCallbackData, :pointer # 4-8 // The draw callback code can access this.
888
917
  )
918
+
919
+ def GetTexID()
920
+ ImGui::ImDrawCmd_GetTexID(self)
921
+ end
922
+
923
+ def self.create()
924
+ return ImDrawCmd.new(ImGui::ImDrawCmd_ImDrawCmd())
925
+ end
926
+
927
+ def destroy()
928
+ ImGui::ImDrawCmd_destroy(self)
929
+ end
930
+
889
931
  end
890
932
 
891
933
  # [Internal] For use by ImDrawList
@@ -1367,6 +1409,45 @@ class ImGuiKeyData < FFI::Struct
1367
1409
  )
1368
1410
  end
1369
1411
 
1412
+ # - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows.
1413
+ # - In 'docking' branch with multi-viewport enabled, we extend this concept to have multiple active viewports.
1414
+ # - In the future we will extend this concept further to also represent Platform Monitor and support a "no main platform window" operation mode.
1415
+ # - About Main Area vs Work Area:
1416
+ # - Main Area = entire viewport.
1417
+ # - Work Area = entire viewport minus sections used by main menu bars (for platform windows), or by task bar (for platform monitor).
1418
+ # - Windows are generally trying to stay within the Work Area of their host viewport.
1419
+ class ImGuiViewport < FFI::Struct
1420
+ layout(
1421
+ :Flags, :int, # See ImGuiViewportFlags_
1422
+ :Pos, ImVec2.by_value, # Main Area: Position of the viewport (Dear ImGui coordinates are the same as OS desktop/native coordinates)
1423
+ :Size, ImVec2.by_value, # Main Area: Size of the viewport.
1424
+ :WorkPos, ImVec2.by_value, # Work Area: Position of the viewport minus task bars, menus bars, status bars (>= Pos)
1425
+ :WorkSize, ImVec2.by_value, # Work Area: Size of the viewport minus task bars, menu bars, status bars (<= Size)
1426
+ :PlatformHandleRaw, :pointer # void* to hold lower-level, platform-native window handle (under Win32 this is expected to be a HWND, unused for other platforms)
1427
+ )
1428
+
1429
+ def GetCenter()
1430
+ pOut = ImVec2.new
1431
+ ImGui::ImGuiViewport_GetCenter(pOut, self)
1432
+ return pOut
1433
+ end
1434
+
1435
+ def GetWorkCenter()
1436
+ pOut = ImVec2.new
1437
+ ImGui::ImGuiViewport_GetWorkCenter(pOut, self)
1438
+ return pOut
1439
+ end
1440
+
1441
+ def self.create()
1442
+ return ImGuiViewport.new(ImGui::ImGuiViewport_ImGuiViewport())
1443
+ end
1444
+
1445
+ def destroy()
1446
+ ImGui::ImGuiViewport_destroy(self)
1447
+ end
1448
+
1449
+ end
1450
+
1370
1451
  # Helper: ImColor() implicitly converts colors to either ImU32 (packed 4x1 byte) or ImVec4 (4x1 float)
1371
1452
  # Prefer using IM_COL32() macros if you want a guaranteed compile-time ImU32 for usage with ImDrawList API.
1372
1453
  # **Avoid storing ImColor! Store either u32 of ImVec4. This is not a full-featured color class. MAY OBSOLETE.
@@ -1383,14 +1464,40 @@ end
1383
1464
  class ImDrawData < FFI::Struct
1384
1465
  layout(
1385
1466
  :Valid, :bool, # Only valid after Render() is called and before the next NewFrame() is called.
1386
- :CmdListsCount, :int, # Number of ImDrawList* to render
1467
+ :CmdListsCount, :int, # Number of ImDrawList* to render (should always be == CmdLists.size)
1387
1468
  :TotalIdxCount, :int, # For convenience, sum of all ImDrawList's IdxBuffer.Size
1388
1469
  :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.
1470
+ :CmdLists, ImVector.by_value, # Array of ImDrawList* to render. The ImDrawLists are owned by ImGuiContext and only pointed to from here.
1390
1471
  :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
1472
  :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.
1473
+ :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.
1474
+ :OwnerViewport, ImGuiViewport.ptr # Viewport carrying the ImDrawData instance, might be of use to the renderer (generally not).
1393
1475
  )
1476
+
1477
+ def AddDrawList(draw_list)
1478
+ ImGui::ImDrawData_AddDrawList(self, draw_list)
1479
+ end
1480
+
1481
+ def Clear()
1482
+ ImGui::ImDrawData_Clear(self)
1483
+ end
1484
+
1485
+ def DeIndexAllBuffers()
1486
+ ImGui::ImDrawData_DeIndexAllBuffers(self)
1487
+ end
1488
+
1489
+ def self.create()
1490
+ return ImDrawData.new(ImGui::ImDrawData_ImDrawData())
1491
+ end
1492
+
1493
+ def ScaleClipRects(fb_scale)
1494
+ ImGui::ImDrawData_ScaleClipRects(self, fb_scale)
1495
+ end
1496
+
1497
+ def destroy()
1498
+ ImGui::ImDrawData_destroy(self)
1499
+ end
1500
+
1394
1501
  end
1395
1502
 
1396
1503
  # Font runtime data and rendering
@@ -1418,6 +1525,81 @@ class ImFont < FFI::Struct
1418
1525
  :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
1526
  :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.
1420
1527
  )
1528
+
1529
+ def AddGlyph(src_cfg, c, x0, y0, x1, y1, u0, v0, u1, v1, advance_x)
1530
+ ImGui::ImFont_AddGlyph(self, src_cfg, c, x0, y0, x1, y1, u0, v0, u1, v1, advance_x)
1531
+ end
1532
+
1533
+ def AddRemapChar(dst, src, overwrite_dst = true)
1534
+ ImGui::ImFont_AddRemapChar(self, dst, src, overwrite_dst)
1535
+ end
1536
+
1537
+ def BuildLookupTable()
1538
+ ImGui::ImFont_BuildLookupTable(self)
1539
+ end
1540
+
1541
+ def CalcTextSizeA(size, max_width, wrap_width, text_begin, text_end = nil, remaining = nil)
1542
+ pOut = ImVec2.new
1543
+ ImGui::ImFont_CalcTextSizeA(pOut, self, size, max_width, wrap_width, text_begin, text_end, remaining)
1544
+ return pOut
1545
+ end
1546
+
1547
+ def CalcWordWrapPositionA(scale, text, text_end, wrap_width)
1548
+ ImGui::ImFont_CalcWordWrapPositionA(self, scale, text, text_end, wrap_width)
1549
+ end
1550
+
1551
+ def ClearOutputData()
1552
+ ImGui::ImFont_ClearOutputData(self)
1553
+ end
1554
+
1555
+ def FindGlyph(c)
1556
+ ImGui::ImFont_FindGlyph(self, c)
1557
+ end
1558
+
1559
+ def FindGlyphNoFallback(c)
1560
+ ImGui::ImFont_FindGlyphNoFallback(self, c)
1561
+ end
1562
+
1563
+ def GetCharAdvance(c)
1564
+ ImGui::ImFont_GetCharAdvance(self, c)
1565
+ end
1566
+
1567
+ def GetDebugName()
1568
+ ImGui::ImFont_GetDebugName(self)
1569
+ end
1570
+
1571
+ def GrowIndex(new_size)
1572
+ ImGui::ImFont_GrowIndex(self, new_size)
1573
+ end
1574
+
1575
+ def self.create()
1576
+ return ImFont.new(ImGui::ImFont_ImFont())
1577
+ end
1578
+
1579
+ def IsGlyphRangeUnused(c_begin, c_last)
1580
+ ImGui::ImFont_IsGlyphRangeUnused(self, c_begin, c_last)
1581
+ end
1582
+
1583
+ def IsLoaded()
1584
+ ImGui::ImFont_IsLoaded(self)
1585
+ end
1586
+
1587
+ def RenderChar(draw_list, size, pos, col, c)
1588
+ ImGui::ImFont_RenderChar(self, draw_list, size, pos, col, c)
1589
+ end
1590
+
1591
+ def RenderText(draw_list, size, pos, col, clip_rect, text_begin, text_end, wrap_width = 0.0, cpu_fine_clip = false)
1592
+ ImGui::ImFont_RenderText(self, draw_list, size, pos, col, clip_rect, text_begin, text_end, wrap_width, cpu_fine_clip)
1593
+ end
1594
+
1595
+ def SetGlyphVisible(c, visible)
1596
+ ImGui::ImFont_SetGlyphVisible(self, c, visible)
1597
+ end
1598
+
1599
+ def destroy()
1600
+ ImGui::ImFont_destroy(self)
1601
+ end
1602
+
1421
1603
  end
1422
1604
 
1423
1605
  # See ImFontAtlas::AddCustomRectXXX functions.
@@ -1432,6 +1614,19 @@ class ImFontAtlasCustomRect < FFI::Struct
1432
1614
  :GlyphOffset, ImVec2.by_value, # Input // For custom font glyphs only: glyph display offset
1433
1615
  :Font, ImFont.ptr # Input // For custom font glyphs only: target font
1434
1616
  )
1617
+
1618
+ def self.create()
1619
+ return ImFontAtlasCustomRect.new(ImGui::ImFontAtlasCustomRect_ImFontAtlasCustomRect())
1620
+ end
1621
+
1622
+ def IsPacked()
1623
+ ImGui::ImFontAtlasCustomRect_IsPacked(self)
1624
+ end
1625
+
1626
+ def destroy()
1627
+ ImGui::ImFontAtlasCustomRect_destroy(self)
1628
+ end
1629
+
1435
1630
  end
1436
1631
 
1437
1632
  class ImFontConfig < FFI::Struct
@@ -1441,7 +1636,7 @@ class ImFontConfig < FFI::Struct
1441
1636
  :FontDataOwnedByAtlas, :bool, # true // TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself).
1442
1637
  :FontNo, :int, # 0 // Index of font within TTF/OTF file
1443
1638
  :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.
1639
+ :OversampleH, :int, # 2 // Rasterize at higher quality for sub-pixel positioning. Note the difference between 2 and 3 is minimal. You can reduce this to 1 for large glyphs save memory. Read https://github.com/nothings/stb/blob/master/tests/oversample/README.md for details.
1445
1640
  :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
1641
  :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
1642
  :GlyphExtraSpacing, ImVec2.by_value, # 0, 0 // Extra spacing (in pixels) between glyphs. Only X axis is supported for now.
@@ -1467,6 +1662,25 @@ class ImFontConfig < FFI::Struct
1467
1662
 
1468
1663
  end
1469
1664
 
1665
+ # Hold rendering data for one glyph.
1666
+ # (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)
1667
+ class ImFontGlyph < FFI::Struct
1668
+ layout(
1669
+ :Colored, :uint, # Flag to indicate glyph is colored and should generally ignore tinting (make it usable with no shift on little-endian as this is used in loops)
1670
+ :Visible, :uint, # Flag to indicate glyph has no visible pixels (e.g. space). Allow early out when rendering.
1671
+ :Codepoint, :uint, # 0x0000..0x10FFFF
1672
+ :AdvanceX, :float, # Distance to next character (= data from font + ImFontConfig::GlyphExtraSpacing.x baked in)
1673
+ :X0, :float, # Glyph corners
1674
+ :Y0, :float,
1675
+ :X1, :float,
1676
+ :Y1, :float,
1677
+ :U0, :float, # Texture coordinates
1678
+ :V0, :float,
1679
+ :U1, :float,
1680
+ :V1, :float
1681
+ )
1682
+ end
1683
+
1470
1684
  # Helper to build glyph ranges from text/string data. Feed your application strings/characters to it then call BuildRanges().
1471
1685
  # This is essentially a tightly packed of vector of 64k booleans = 8KB storage.
1472
1686
  class ImFontGlyphRangesBuilder < FFI::Struct
@@ -1555,6 +1769,7 @@ class ImGuiIO < FFI::Struct
1555
1769
  :ClipboardUserData, :pointer,
1556
1770
  :SetPlatformImeDataFn, :pointer,
1557
1771
  :_UnusedPadding, :pointer,
1772
+ :PlatformLocaleDecimalPoint, :ushort, # '.' // [Experimental] Configure decimal point e.g. '.' or ',' useful for some languages (e.g. German), generally pulled from *localeconv()->decimal_point
1558
1773
  :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
1774
  :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
1775
  :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).
@@ -1648,8 +1863,8 @@ class ImGuiIO < FFI::Struct
1648
1863
  ImGui::ImGuiIO_AddMouseWheelEvent(self, wheel_x, wheel_y)
1649
1864
  end
1650
1865
 
1651
- def ClearInputCharacters()
1652
- ImGui::ImGuiIO_ClearInputCharacters(self)
1866
+ def ClearEventsQueue()
1867
+ ImGui::ImGuiIO_ClearEventsQueue(self)
1653
1868
  end
1654
1869
 
1655
1870
  def ClearInputKeys()
@@ -1699,6 +1914,135 @@ class ImGuiInputTextCallbackData < FFI::Struct
1699
1914
  :SelectionStart, :int, # // Read-write // [Completion,History,Always] == to SelectionEnd when no selection)
1700
1915
  :SelectionEnd, :int # // Read-write // [Completion,History,Always]
1701
1916
  )
1917
+
1918
+ def ClearSelection()
1919
+ ImGui::ImGuiInputTextCallbackData_ClearSelection(self)
1920
+ end
1921
+
1922
+ def DeleteChars(pos, bytes_count)
1923
+ ImGui::ImGuiInputTextCallbackData_DeleteChars(self, pos, bytes_count)
1924
+ end
1925
+
1926
+ def HasSelection()
1927
+ ImGui::ImGuiInputTextCallbackData_HasSelection(self)
1928
+ end
1929
+
1930
+ def self.create()
1931
+ return ImGuiInputTextCallbackData.new(ImGui::ImGuiInputTextCallbackData_ImGuiInputTextCallbackData())
1932
+ end
1933
+
1934
+ def InsertChars(pos, text, text_end = nil)
1935
+ ImGui::ImGuiInputTextCallbackData_InsertChars(self, pos, text, text_end)
1936
+ end
1937
+
1938
+ def SelectAll()
1939
+ ImGui::ImGuiInputTextCallbackData_SelectAll(self)
1940
+ end
1941
+
1942
+ def destroy()
1943
+ ImGui::ImGuiInputTextCallbackData_destroy(self)
1944
+ end
1945
+
1946
+ end
1947
+
1948
+ # Helper: Manually clip large list of items.
1949
+ # If you have lots evenly spaced items and you have random access to the list, you can perform coarse
1950
+ # clipping based on visibility to only submit items that are in view.
1951
+ # The clipper calculates the range of visible items and advance the cursor to compensate for the non-visible items we have skipped.
1952
+ # (Dear ImGui already clip items based on their bounds but: it needs to first layout the item to do so, and generally
1953
+ # fetching/submitting your own data incurs additional cost. Coarse clipping using ImGuiListClipper allows you to easily
1954
+ # scale using lists with tens of thousands of items without a problem)
1955
+ # Usage:
1956
+ # ImGuiListClipper clipper;
1957
+ # clipper.Begin(1000); // We have 1000 elements, evenly spaced.
1958
+ # while (clipper.Step())
1959
+ # for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
1960
+ # ImGui::Text("line number %d", i);
1961
+ # Generally what happens is:
1962
+ # - Clipper lets you process the first element (DisplayStart = 0, DisplayEnd = 1) regardless of it being visible or not.
1963
+ # - User code submit that one element.
1964
+ # - Clipper can measure the height of the first element
1965
+ # - Clipper calculate the actual range of elements to display based on the current clipping rectangle, position the cursor before the first visible element.
1966
+ # - User code submit visible elements.
1967
+ # - The clipper also handles various subtleties related to keyboard/gamepad navigation, wrapping etc.
1968
+ class ImGuiListClipper < FFI::Struct
1969
+ layout(
1970
+ :Ctx, :pointer, # Parent UI context
1971
+ :DisplayStart, :int, # First item to display, updated by each call to Step()
1972
+ :DisplayEnd, :int, # End of items to display (exclusive)
1973
+ :ItemsCount, :int, # [Internal] Number of items
1974
+ :ItemsHeight, :float, # [Internal] Height of item after a first step and item submission can calculate it
1975
+ :StartPosY, :float, # [Internal] Cursor position at the time of Begin() or after table frozen rows are all processed
1976
+ :TempData, :pointer # [Internal] Internal data
1977
+ )
1978
+
1979
+ def Begin(items_count, items_height = -1.0)
1980
+ ImGui::ImGuiListClipper_Begin(self, items_count, items_height)
1981
+ end
1982
+
1983
+ def End()
1984
+ ImGui::ImGuiListClipper_End(self)
1985
+ end
1986
+
1987
+ def self.create()
1988
+ return ImGuiListClipper.new(ImGui::ImGuiListClipper_ImGuiListClipper())
1989
+ end
1990
+
1991
+ def IncludeItemByIndex(item_index)
1992
+ ImGui::ImGuiListClipper_IncludeItemByIndex(self, item_index)
1993
+ end
1994
+
1995
+ def IncludeItemsByIndex(item_begin, item_end)
1996
+ ImGui::ImGuiListClipper_IncludeItemsByIndex(self, item_begin, item_end)
1997
+ end
1998
+
1999
+ def Step()
2000
+ ImGui::ImGuiListClipper_Step(self)
2001
+ end
2002
+
2003
+ def destroy()
2004
+ ImGui::ImGuiListClipper_destroy(self)
2005
+ end
2006
+
2007
+ end
2008
+
2009
+ # Data payload for Drag and Drop operations: AcceptDragDropPayload(), GetDragDropPayload()
2010
+ class ImGuiPayload < FFI::Struct
2011
+ layout(
2012
+ :Data, :pointer, # Data (copied and owned by dear imgui)
2013
+ :DataSize, :int, # Data size
2014
+ :SourceId, :uint, # Source item id
2015
+ :SourceParentId, :uint, # Source parent id (if available)
2016
+ :DataFrameCount, :int, # Data timestamp
2017
+ :DataType, [:char, 33], # Data type tag (short user-supplied string, 32 characters max)
2018
+ :Preview, :bool, # Set when AcceptDragDropPayload() was called and mouse has been hovering the target item (nb: handle overlapping drag targets)
2019
+ :Delivery, :bool # Set when AcceptDragDropPayload() was called and mouse button is released over the target item.
2020
+ )
2021
+
2022
+ def Clear()
2023
+ ImGui::ImGuiPayload_Clear(self)
2024
+ end
2025
+
2026
+ def self.create()
2027
+ return ImGuiPayload.new(ImGui::ImGuiPayload_ImGuiPayload())
2028
+ end
2029
+
2030
+ def IsDataType(type)
2031
+ ImGui::ImGuiPayload_IsDataType(self, type)
2032
+ end
2033
+
2034
+ def IsDelivery()
2035
+ ImGui::ImGuiPayload_IsDelivery(self)
2036
+ end
2037
+
2038
+ def IsPreview()
2039
+ ImGui::ImGuiPayload_IsPreview(self)
2040
+ end
2041
+
2042
+ def destroy()
2043
+ ImGui::ImGuiPayload_destroy(self)
2044
+ end
2045
+
1702
2046
  end
1703
2047
 
1704
2048
  # (Optional) Support for IME (Input Method Editor) via the io.SetPlatformImeDataFn() function.
@@ -1708,6 +2052,15 @@ class ImGuiPlatformImeData < FFI::Struct
1708
2052
  :InputPos, ImVec2.by_value, # Position of the input cursor
1709
2053
  :InputLineHeight, :float # Line height
1710
2054
  )
2055
+
2056
+ def self.create()
2057
+ return ImGuiPlatformImeData.new(ImGui::ImGuiPlatformImeData_ImGuiPlatformImeData())
2058
+ end
2059
+
2060
+ def destroy()
2061
+ ImGui::ImGuiPlatformImeData_destroy(self)
2062
+ end
2063
+
1711
2064
  end
1712
2065
 
1713
2066
  # Resizing callback data to apply custom constraint. As enabled by SetNextWindowSizeConstraints(). Callback is called during the next Begin().
@@ -1721,6 +2074,81 @@ class ImGuiSizeCallbackData < FFI::Struct
1721
2074
  )
1722
2075
  end
1723
2076
 
2077
+ # Helper: Key->Value storage
2078
+ # Typically you don't have to worry about this since a storage is held within each Window.
2079
+ # We use it to e.g. store collapse state for a tree (Int 0/1)
2080
+ # This is optimized for efficient lookup (dichotomy into a contiguous buffer) and rare insertion (typically tied to user interactions aka max once a frame)
2081
+ # You can use it as custom user storage for temporary values. Declare your own storage if, for example:
2082
+ # - 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).
2083
+ # - You want to store custom debug data easily without adding or editing structures in your code (probably not efficient, but convenient)
2084
+ # Types are NOT stored, so it is up to you to make sure your Key don't collide with different types.
2085
+ class ImGuiStorage < FFI::Struct
2086
+ layout(
2087
+ :Data, ImVector.by_value
2088
+ )
2089
+
2090
+ def BuildSortByKey()
2091
+ ImGui::ImGuiStorage_BuildSortByKey(self)
2092
+ end
2093
+
2094
+ def Clear()
2095
+ ImGui::ImGuiStorage_Clear(self)
2096
+ end
2097
+
2098
+ def GetBool(key, default_val = false)
2099
+ ImGui::ImGuiStorage_GetBool(self, key, default_val)
2100
+ end
2101
+
2102
+ def GetBoolRef(key, default_val = false)
2103
+ ImGui::ImGuiStorage_GetBoolRef(self, key, default_val)
2104
+ end
2105
+
2106
+ def GetFloat(key, default_val = 0.0)
2107
+ ImGui::ImGuiStorage_GetFloat(self, key, default_val)
2108
+ end
2109
+
2110
+ def GetFloatRef(key, default_val = 0.0)
2111
+ ImGui::ImGuiStorage_GetFloatRef(self, key, default_val)
2112
+ end
2113
+
2114
+ def GetInt(key, default_val = 0)
2115
+ ImGui::ImGuiStorage_GetInt(self, key, default_val)
2116
+ end
2117
+
2118
+ def GetIntRef(key, default_val = 0)
2119
+ ImGui::ImGuiStorage_GetIntRef(self, key, default_val)
2120
+ end
2121
+
2122
+ def GetVoidPtr(key)
2123
+ ImGui::ImGuiStorage_GetVoidPtr(self, key)
2124
+ end
2125
+
2126
+ def GetVoidPtrRef(key, default_val = nil)
2127
+ ImGui::ImGuiStorage_GetVoidPtrRef(self, key, default_val)
2128
+ end
2129
+
2130
+ def SetAllInt(val)
2131
+ ImGui::ImGuiStorage_SetAllInt(self, val)
2132
+ end
2133
+
2134
+ def SetBool(key, val)
2135
+ ImGui::ImGuiStorage_SetBool(self, key, val)
2136
+ end
2137
+
2138
+ def SetFloat(key, val)
2139
+ ImGui::ImGuiStorage_SetFloat(self, key, val)
2140
+ end
2141
+
2142
+ def SetInt(key, val)
2143
+ ImGui::ImGuiStorage_SetInt(self, key, val)
2144
+ end
2145
+
2146
+ def SetVoidPtr(key, val)
2147
+ ImGui::ImGuiStorage_SetVoidPtr(self, key, val)
2148
+ end
2149
+
2150
+ end
2151
+
1724
2152
  class ImGuiStyle < FFI::Struct
1725
2153
  layout(
1726
2154
  :Alpha, :float, # Global alpha applies to everything in Dear ImGui.
@@ -1740,7 +2168,7 @@ class ImGuiStyle < FFI::Struct
1740
2168
  :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
2169
  :ItemSpacing, ImVec2.by_value, # Horizontal and vertical spacing between widgets/lines.
1742
2170
  :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
2171
+ :CellPadding, ImVec2.by_value, # Padding within a table cell. CellPadding.y may be altered between different rows.
1744
2172
  :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
2173
  :IndentSpacing, :float, # Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
1746
2174
  :ColumnsMinSpacing, :float, # Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
@@ -1796,6 +2224,15 @@ class ImGuiTableColumnSortSpecs < FFI::Struct
1796
2224
  :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
2225
  :SortDirection, :int # ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending (you can use this or SortSign, whichever is more convenient for your sort function)
1798
2226
  )
2227
+
2228
+ def self.create()
2229
+ return ImGuiTableColumnSortSpecs.new(ImGui::ImGuiTableColumnSortSpecs_ImGuiTableColumnSortSpecs())
2230
+ end
2231
+
2232
+ def destroy()
2233
+ ImGui::ImGuiTableColumnSortSpecs_destroy(self)
2234
+ end
2235
+
1799
2236
  end
1800
2237
 
1801
2238
  # Sorting specifications for a table (often handling sort specs for a single column, occasionally more)
@@ -1808,6 +2245,68 @@ class ImGuiTableSortSpecs < FFI::Struct
1808
2245
  :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
2246
  :SpecsDirty, :bool # Set to true when specs have changed since last time! Use this to sort again, then clear the flag.
1810
2247
  )
2248
+
2249
+ def self.create()
2250
+ return ImGuiTableSortSpecs.new(ImGui::ImGuiTableSortSpecs_ImGuiTableSortSpecs())
2251
+ end
2252
+
2253
+ def destroy()
2254
+ ImGui::ImGuiTableSortSpecs_destroy(self)
2255
+ end
2256
+
2257
+ end
2258
+
2259
+ # Helper: Growable text buffer for logging/accumulating text
2260
+ # (this could be called 'ImGuiTextBuilder' / 'ImGuiStringBuilder')
2261
+ class ImGuiTextBuffer < FFI::Struct
2262
+ layout(
2263
+ :Buf, ImVector.by_value
2264
+ )
2265
+
2266
+ def self.create()
2267
+ return ImGuiTextBuffer.new(ImGui::ImGuiTextBuffer_ImGuiTextBuffer())
2268
+ end
2269
+
2270
+ def append(str, str_end = nil)
2271
+ ImGui::ImGuiTextBuffer_append(self, str, str_end)
2272
+ end
2273
+
2274
+ def appendf(fmt, *varargs)
2275
+ ImGui::ImGuiTextBuffer_appendf(self, fmt, *varargs)
2276
+ end
2277
+
2278
+ def begin()
2279
+ ImGui::ImGuiTextBuffer_begin(self)
2280
+ end
2281
+
2282
+ def c_str()
2283
+ ImGui::ImGuiTextBuffer_c_str(self)
2284
+ end
2285
+
2286
+ def clear()
2287
+ ImGui::ImGuiTextBuffer_clear(self)
2288
+ end
2289
+
2290
+ def destroy()
2291
+ ImGui::ImGuiTextBuffer_destroy(self)
2292
+ end
2293
+
2294
+ def empty()
2295
+ ImGui::ImGuiTextBuffer_empty(self)
2296
+ end
2297
+
2298
+ def end()
2299
+ ImGui::ImGuiTextBuffer_end(self)
2300
+ end
2301
+
2302
+ def reserve(capacity)
2303
+ ImGui::ImGuiTextBuffer_reserve(self, capacity)
2304
+ end
2305
+
2306
+ def size()
2307
+ ImGui::ImGuiTextBuffer_size(self)
2308
+ end
2309
+
1811
2310
  end
1812
2311
 
1813
2312
  # Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
@@ -1848,22 +2347,32 @@ class ImGuiTextFilter < FFI::Struct
1848
2347
 
1849
2348
  end
1850
2349
 
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
2350
+ class ImGuiTextRange < FFI::Struct
1859
2351
  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)
2352
+ :b, :pointer,
2353
+ :e, :pointer
1866
2354
  )
2355
+
2356
+ def self.create()
2357
+ return ImGuiTextRange.new(ImGui::ImGuiTextRange_ImGuiTextRange_Nil())
2358
+ end
2359
+
2360
+ def self.create(_b, _e)
2361
+ return ImGuiTextRange.new(ImGui::ImGuiTextRange_ImGuiTextRange_Str(_b, _e))
2362
+ end
2363
+
2364
+ def destroy()
2365
+ ImGui::ImGuiTextRange_destroy(self)
2366
+ end
2367
+
2368
+ def empty()
2369
+ ImGui::ImGuiTextRange_empty(self)
2370
+ end
2371
+
2372
+ def split(separator, out)
2373
+ ImGui::ImGuiTextRange_split(self, separator, out)
2374
+ end
2375
+
1867
2376
  end
1868
2377
 
1869
2378
  class ImGuiStoragePair < FFI::Struct
@@ -1871,6 +2380,23 @@ class ImGuiStoragePair < FFI::Struct
1871
2380
  :key, :uint,
1872
2381
  :val_p, :pointer
1873
2382
  )
2383
+
2384
+ def self.create(_key, _val_i)
2385
+ return ImGuiStoragePair.new(ImGui::ImGuiStoragePair_ImGuiStoragePair_Int(_key, _val_i))
2386
+ end
2387
+
2388
+ def self.create(_key, _val_f)
2389
+ return ImGuiStoragePair.new(ImGui::ImGuiStoragePair_ImGuiStoragePair_Float(_key, _val_f))
2390
+ end
2391
+
2392
+ def self.create(_key, _val_p)
2393
+ return ImGuiStoragePair.new(ImGui::ImGuiStoragePair_ImGuiStoragePair_Ptr(_key, _val_p))
2394
+ end
2395
+
2396
+ def destroy()
2397
+ ImGui::ImGuiStoragePair_destroy(self)
2398
+ end
2399
+
1874
2400
  end
1875
2401
 
1876
2402
  # shorthand initializer
@@ -1922,6 +2448,22 @@ module ImGui
1922
2448
  callback :ImGuiSizeCallback, [ImGuiSizeCallbackData], :void
1923
2449
 
1924
2450
  entries = [
2451
+ [:ImDrawCmd_GetTexID, [:pointer], :pointer],
2452
+ [:ImDrawCmd_ImDrawCmd, [], :pointer],
2453
+ [:ImDrawCmd_destroy, [:pointer], :void],
2454
+ [:ImDrawData_AddDrawList, [:pointer, :pointer], :void],
2455
+ [:ImDrawData_Clear, [:pointer], :void],
2456
+ [:ImDrawData_DeIndexAllBuffers, [:pointer], :void],
2457
+ [:ImDrawData_ImDrawData, [], :pointer],
2458
+ [:ImDrawData_ScaleClipRects, [:pointer, ImVec2.by_value], :void],
2459
+ [:ImDrawData_destroy, [:pointer], :void],
2460
+ [:ImDrawListSplitter_Clear, [:pointer], :void],
2461
+ [:ImDrawListSplitter_ClearFreeMemory, [:pointer], :void],
2462
+ [:ImDrawListSplitter_ImDrawListSplitter, [], :pointer],
2463
+ [:ImDrawListSplitter_Merge, [:pointer, :pointer], :void],
2464
+ [:ImDrawListSplitter_SetCurrentChannel, [:pointer, :pointer, :int], :void],
2465
+ [:ImDrawListSplitter_Split, [:pointer, :pointer, :int], :void],
2466
+ [:ImDrawListSplitter_destroy, [:pointer], :void],
1925
2467
  [:ImDrawList_AddBezierCubic, [:pointer, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, :uint, :float, :int], :void],
1926
2468
  [:ImDrawList_AddBezierQuadratic, [:pointer, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, :uint, :float, :int], :void],
1927
2469
  [:ImDrawList_AddCallback, [:pointer, :ImDrawCallback, :pointer], :void],
@@ -1986,6 +2528,9 @@ module ImGui
1986
2528
  [:ImDrawList__ResetForNewFrame, [:pointer], :void],
1987
2529
  [:ImDrawList__TryMergeDrawCmds, [:pointer], :void],
1988
2530
  [:ImDrawList_destroy, [:pointer], :void],
2531
+ [:ImFontAtlasCustomRect_ImFontAtlasCustomRect, [], :pointer],
2532
+ [:ImFontAtlasCustomRect_IsPacked, [:pointer], :bool],
2533
+ [:ImFontAtlasCustomRect_destroy, [:pointer], :void],
1989
2534
  [:ImFontAtlas_AddCustomRectFontGlyph, [:pointer, :pointer, :ushort, :int, :int, :float, ImVec2.by_value], :int],
1990
2535
  [:ImFontAtlas_AddCustomRectRegular, [:pointer, :int, :int], :int],
1991
2536
  [:ImFontAtlas_AddFont, [:pointer, :pointer], :pointer],
@@ -2028,6 +2573,24 @@ module ImGui
2028
2573
  [:ImFontGlyphRangesBuilder_ImFontGlyphRangesBuilder, [], :pointer],
2029
2574
  [:ImFontGlyphRangesBuilder_SetBit, [:pointer, :size_t], :void],
2030
2575
  [:ImFontGlyphRangesBuilder_destroy, [:pointer], :void],
2576
+ [:ImFont_AddGlyph, [:pointer, :pointer, :ushort, :float, :float, :float, :float, :float, :float, :float, :float, :float], :void],
2577
+ [:ImFont_AddRemapChar, [:pointer, :ushort, :ushort, :bool], :void],
2578
+ [:ImFont_BuildLookupTable, [:pointer], :void],
2579
+ [:ImFont_CalcTextSizeA, [:pointer, :pointer, :float, :float, :float, :pointer, :pointer, :pointer], :void],
2580
+ [:ImFont_CalcWordWrapPositionA, [:pointer, :float, :pointer, :pointer, :float], :pointer],
2581
+ [:ImFont_ClearOutputData, [:pointer], :void],
2582
+ [:ImFont_FindGlyph, [:pointer, :ushort], :pointer],
2583
+ [:ImFont_FindGlyphNoFallback, [:pointer, :ushort], :pointer],
2584
+ [:ImFont_GetCharAdvance, [:pointer, :ushort], :float],
2585
+ [:ImFont_GetDebugName, [:pointer], :pointer],
2586
+ [:ImFont_GrowIndex, [:pointer, :int], :void],
2587
+ [:ImFont_ImFont, [], :pointer],
2588
+ [:ImFont_IsGlyphRangeUnused, [:pointer, :uint, :uint], :bool],
2589
+ [:ImFont_IsLoaded, [:pointer], :bool],
2590
+ [:ImFont_RenderChar, [:pointer, :pointer, :float, ImVec2.by_value, :uint, :ushort], :void],
2591
+ [:ImFont_RenderText, [:pointer, :pointer, :float, ImVec2.by_value, :uint, ImVec4.by_value, :pointer, :pointer, :float, :bool], :void],
2592
+ [:ImFont_SetGlyphVisible, [:pointer, :ushort, :bool], :void],
2593
+ [:ImFont_destroy, [:pointer], :void],
2031
2594
  [:ImGuiIO_AddFocusEvent, [:pointer, :bool], :void],
2032
2595
  [:ImGuiIO_AddInputCharacter, [:pointer, :uint], :void],
2033
2596
  [:ImGuiIO_AddInputCharacterUTF16, [:pointer, :ushort], :void],
@@ -2038,15 +2601,73 @@ module ImGui
2038
2601
  [:ImGuiIO_AddMousePosEvent, [:pointer, :float, :float], :void],
2039
2602
  [:ImGuiIO_AddMouseSourceEvent, [:pointer, :int], :void],
2040
2603
  [:ImGuiIO_AddMouseWheelEvent, [:pointer, :float, :float], :void],
2041
- [:ImGuiIO_ClearInputCharacters, [:pointer], :void],
2604
+ [:ImGuiIO_ClearEventsQueue, [:pointer], :void],
2042
2605
  [:ImGuiIO_ClearInputKeys, [:pointer], :void],
2043
2606
  [:ImGuiIO_ImGuiIO, [], :pointer],
2044
2607
  [:ImGuiIO_SetAppAcceptingEvents, [:pointer, :bool], :void],
2045
2608
  [:ImGuiIO_SetKeyEventNativeData, [:pointer, :int, :int, :int, :int], :void],
2046
2609
  [:ImGuiIO_destroy, [:pointer], :void],
2610
+ [:ImGuiInputTextCallbackData_ClearSelection, [:pointer], :void],
2611
+ [:ImGuiInputTextCallbackData_DeleteChars, [:pointer, :int, :int], :void],
2612
+ [:ImGuiInputTextCallbackData_HasSelection, [:pointer], :bool],
2613
+ [:ImGuiInputTextCallbackData_ImGuiInputTextCallbackData, [], :pointer],
2614
+ [:ImGuiInputTextCallbackData_InsertChars, [:pointer, :int, :pointer, :pointer], :void],
2615
+ [:ImGuiInputTextCallbackData_SelectAll, [:pointer], :void],
2616
+ [:ImGuiInputTextCallbackData_destroy, [:pointer], :void],
2617
+ [:ImGuiListClipper_Begin, [:pointer, :int, :float], :void],
2618
+ [:ImGuiListClipper_End, [:pointer], :void],
2619
+ [:ImGuiListClipper_ImGuiListClipper, [], :pointer],
2620
+ [:ImGuiListClipper_IncludeItemByIndex, [:pointer, :int], :void],
2621
+ [:ImGuiListClipper_IncludeItemsByIndex, [:pointer, :int, :int], :void],
2622
+ [:ImGuiListClipper_Step, [:pointer], :bool],
2623
+ [:ImGuiListClipper_destroy, [:pointer], :void],
2624
+ [:ImGuiOnceUponAFrame_ImGuiOnceUponAFrame, [], :pointer],
2625
+ [:ImGuiOnceUponAFrame_destroy, [:pointer], :void],
2626
+ [:ImGuiPayload_Clear, [:pointer], :void],
2627
+ [:ImGuiPayload_ImGuiPayload, [], :pointer],
2628
+ [:ImGuiPayload_IsDataType, [:pointer, :pointer], :bool],
2629
+ [:ImGuiPayload_IsDelivery, [:pointer], :bool],
2630
+ [:ImGuiPayload_IsPreview, [:pointer], :bool],
2631
+ [:ImGuiPayload_destroy, [:pointer], :void],
2632
+ [:ImGuiPlatformImeData_ImGuiPlatformImeData, [], :pointer],
2633
+ [:ImGuiPlatformImeData_destroy, [:pointer], :void],
2634
+ [:ImGuiStoragePair_ImGuiStoragePair_Int, [:uint, :int], :pointer],
2635
+ [:ImGuiStoragePair_ImGuiStoragePair_Float, [:uint, :float], :pointer],
2636
+ [:ImGuiStoragePair_ImGuiStoragePair_Ptr, [:uint, :pointer], :pointer],
2637
+ [:ImGuiStoragePair_destroy, [:pointer], :void],
2638
+ [:ImGuiStorage_BuildSortByKey, [:pointer], :void],
2639
+ [:ImGuiStorage_Clear, [:pointer], :void],
2640
+ [:ImGuiStorage_GetBool, [:pointer, :uint, :bool], :bool],
2641
+ [:ImGuiStorage_GetBoolRef, [:pointer, :uint, :bool], :pointer],
2642
+ [:ImGuiStorage_GetFloat, [:pointer, :uint, :float], :float],
2643
+ [:ImGuiStorage_GetFloatRef, [:pointer, :uint, :float], :pointer],
2644
+ [:ImGuiStorage_GetInt, [:pointer, :uint, :int], :int],
2645
+ [:ImGuiStorage_GetIntRef, [:pointer, :uint, :int], :pointer],
2646
+ [:ImGuiStorage_GetVoidPtr, [:pointer, :uint], :pointer],
2647
+ [:ImGuiStorage_GetVoidPtrRef, [:pointer, :uint, :pointer], :pointer],
2648
+ [:ImGuiStorage_SetAllInt, [:pointer, :int], :void],
2649
+ [:ImGuiStorage_SetBool, [:pointer, :uint, :bool], :void],
2650
+ [:ImGuiStorage_SetFloat, [:pointer, :uint, :float], :void],
2651
+ [:ImGuiStorage_SetInt, [:pointer, :uint, :int], :void],
2652
+ [:ImGuiStorage_SetVoidPtr, [:pointer, :uint, :pointer], :void],
2047
2653
  [:ImGuiStyle_ImGuiStyle, [], :pointer],
2048
2654
  [:ImGuiStyle_ScaleAllSizes, [:pointer, :float], :void],
2049
2655
  [:ImGuiStyle_destroy, [:pointer], :void],
2656
+ [:ImGuiTableColumnSortSpecs_ImGuiTableColumnSortSpecs, [], :pointer],
2657
+ [:ImGuiTableColumnSortSpecs_destroy, [:pointer], :void],
2658
+ [:ImGuiTableSortSpecs_ImGuiTableSortSpecs, [], :pointer],
2659
+ [:ImGuiTableSortSpecs_destroy, [:pointer], :void],
2660
+ [:ImGuiTextBuffer_ImGuiTextBuffer, [], :pointer],
2661
+ [:ImGuiTextBuffer_append, [:pointer, :pointer, :pointer], :void],
2662
+ [:ImGuiTextBuffer_appendf, [:pointer, :pointer, :varargs], :void],
2663
+ [:ImGuiTextBuffer_begin, [:pointer], :pointer],
2664
+ [:ImGuiTextBuffer_c_str, [:pointer], :pointer],
2665
+ [:ImGuiTextBuffer_clear, [:pointer], :void],
2666
+ [:ImGuiTextBuffer_destroy, [:pointer], :void],
2667
+ [:ImGuiTextBuffer_empty, [:pointer], :bool],
2668
+ [:ImGuiTextBuffer_end, [:pointer], :pointer],
2669
+ [:ImGuiTextBuffer_reserve, [:pointer, :int], :void],
2670
+ [:ImGuiTextBuffer_size, [:pointer], :int],
2050
2671
  [:ImGuiTextFilter_Build, [:pointer], :void],
2051
2672
  [:ImGuiTextFilter_Clear, [:pointer], :void],
2052
2673
  [:ImGuiTextFilter_Draw, [:pointer, :pointer, :float], :bool],
@@ -2059,6 +2680,10 @@ module ImGui
2059
2680
  [:ImGuiTextRange_destroy, [:pointer], :void],
2060
2681
  [:ImGuiTextRange_empty, [:pointer], :bool],
2061
2682
  [:ImGuiTextRange_split, [:pointer, :char, :pointer], :void],
2683
+ [:ImGuiViewport_GetCenter, [:pointer, :pointer], :void],
2684
+ [:ImGuiViewport_GetWorkCenter, [:pointer, :pointer], :void],
2685
+ [:ImGuiViewport_ImGuiViewport, [], :pointer],
2686
+ [:ImGuiViewport_destroy, [:pointer], :void],
2062
2687
  [:igAcceptDragDropPayload, [:pointer, :int], :pointer],
2063
2688
  [:igAlignTextToFramePadding, [], :void],
2064
2689
  [:igArrowButton, [:pointer, :int], :bool],
@@ -3428,14 +4053,14 @@ module ImGui
3428
4053
  end
3429
4054
 
3430
4055
  # 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)
4056
+ 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, GetScreenCursorPos())
3432
4057
  pOut = ImVec2.new
3433
4058
  igGetWindowPos(pOut)
3434
4059
  return pOut
3435
4060
  end
3436
4061
 
3437
4062
  # ret: void
3438
- def self.GetWindowSize() # get current window size
4063
+ def self.GetWindowSize() # get current window size (note: it is unlikely you need to use this. Consider using GetScreenCursorPos() and e.g. GetContentRegionAvail() instead)
3439
4064
  pOut = ImVec2.new
3440
4065
  igGetWindowSize(pOut)
3441
4066
  return pOut
data/lib/imgui.x86_64.so CHANGED
Binary file
@@ -55,7 +55,7 @@ module ImGui
55
55
 
56
56
  # Render command lists
57
57
  draw_data[:CmdListsCount].times do |n|
58
- cmd_list = ImDrawList.new((draw_data[:CmdLists].pointer + 8 * n).read_pointer) # 8 == const ImDrawList*
58
+ cmd_list = ImDrawList.new((draw_data[:CmdLists][:Data] + 8 * n).read_pointer) # 8 == const ImDrawList*
59
59
  vtx_buffer = ImDrawVert.new(cmd_list[:VtxBuffer][:Data]) # const ImDrawVert*
60
60
  idx_buffer = cmd_list[:IdxBuffer][:Data] # const ImDrawIdx*
61
61
  GL.VertexPointer(2, GL::FLOAT, ImDrawVert.size, Fiddle::Pointer.new((cmd_list[:VtxBuffer][:Data] + vtx_buffer.offset_of(:pos))) )
@@ -139,7 +139,7 @@ module ImGui
139
139
  # Render command lists
140
140
  draw_data[:CmdListsCount].times do |n|
141
141
 
142
- cmd_list = ImDrawList.new((draw_data[:CmdLists].pointer + 8 * n).read_pointer) # 8 == const ImDrawList*
142
+ cmd_list = ImDrawList.new((draw_data[:CmdLists][:Data] + 8 * n).read_pointer) # 8 == const ImDrawList*
143
143
  # vtx_buffer = ImDrawVert.new(cmd_list[:VtxBuffer][:Data]) # const ImDrawVert*
144
144
  # idx_buffer = cmd_list[:IdxBuffer][:Data] # const ImDrawIdx*
145
145
 
@@ -393,7 +393,7 @@ module ImGui
393
393
 
394
394
  clip_offset = draw_data[:DisplayPos]
395
395
  draw_data[:CmdListsCount].times do |n|
396
- cmd_list = ImDrawList.new((draw_data[:CmdLists].pointer + FFI.type_size(:pointer) * n).read_pointer)
396
+ cmd_list = ImDrawList.new((draw_data[:CmdLists][:Data] + FFI.type_size(:pointer) * n).read_pointer)
397
397
  vtx_buffer = cmd_list[:VtxBuffer][:Data] # const ImDrawVert*
398
398
  idx_buffer = cmd_list[:IdxBuffer][:Data] # const ImDrawIdx*
399
399
 
@@ -99,7 +99,7 @@ module ImGui
99
99
  # Render command lists
100
100
  ImplSDLRenderer_SetupRenderState()
101
101
  draw_data[:CmdListsCount].times do |n|
102
- cmd_list = ImDrawList.new((draw_data[:CmdLists].pointer + FFI.type_size(:pointer) * n).read_pointer)
102
+ cmd_list = ImDrawList.new((draw_data[:CmdLists][:Data] + FFI.type_size(:pointer) * n).read_pointer)
103
103
  vtx_buffer = cmd_list[:VtxBuffer][:Data] # const ImDrawVert*
104
104
  idx_buffer = cmd_list[:IdxBuffer][:Data] # const ImDrawIdx*
105
105
 
Binary file
data/lib/imnodes.dll CHANGED
Binary file
data/lib/imnodes.dylib CHANGED
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imgui-bindings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaiorabbit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-29 00:00:00.000000000 Z
11
+ date: 2023-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi