imgui-bindings 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +13 -0
- data/README.md +1 -1
- data/lib/imgui.aarch64.so +0 -0
- data/lib/imgui.dll +0 -0
- data/lib/imgui.dylib +0 -0
- data/lib/imgui.rb +712 -57
- data/lib/imgui.x86_64.so +0 -0
- data/lib/imgui_impl_opengl2.rb +1 -1
- data/lib/imgui_impl_opengl3.rb +1 -1
- data/lib/imgui_impl_raylib.rb +1 -1
- data/lib/imgui_impl_sdlrenderer.rb +1 -1
- data/lib/imnodes.aarch64.so +0 -0
- data/lib/imnodes.dll +0 -0
- data/lib/imnodes.dylib +0 -0
- data/lib/imnodes.x86_64.so +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc25695edcc3a2e8f96335f2b2d9981da7f35a5a9e3fa0589a2b7ad994a2ae8e
|
4
|
+
data.tar.gz: 7456b6e28ad9b9daa3197ccc5f9d221d200b264bd736a2181b2d1d669b64809c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01fde890de2b920ec21fd6e0a71fa440023172b4d1926e50137e00e513aa5c2d5ea13636bc0aa73224452269b179649747ba8bbd939d6af2922b059de4db86b6
|
7
|
+
data.tar.gz: 595e8412c5de791acbf56284aea8af640baa4d019b613c896298f92826d61c353747b1b55df7aedc20d01e8d7ad233b62a6ca170ff7f6693ccd172d6a7b592f5
|
data/ChangeLog
CHANGED
@@ -1,3 +1,16 @@
|
|
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
|
+
|
10
|
+
2023-07-29 vaiorabbit <http://twitter.com/vaiorabbit>
|
11
|
+
|
12
|
+
* ImGui v1.89.7
|
13
|
+
|
1
14
|
2023-07-02 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
15
|
|
3
16
|
* ImGui v1.89.6
|
data/README.md
CHANGED
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
@@ -290,14 +290,19 @@ ImGuiHoveredFlags_AnyWindow = 4 # 1 << 2 # IsWindowHovered(
|
|
290
290
|
ImGuiHoveredFlags_NoPopupHierarchy = 8 # 1 << 3 # IsWindowHovered() only: Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with _ChildWindows or _RootWindow)
|
291
291
|
ImGuiHoveredFlags_AllowWhenBlockedByPopup = 32 # 1 << 5 # Return true even if a popup window is normally blocking access to this item/window
|
292
292
|
ImGuiHoveredFlags_AllowWhenBlockedByActiveItem = 128 # 1 << 7 # Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns.
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
293
|
+
ImGuiHoveredFlags_AllowWhenOverlappedByItem = 256 # 1 << 8 # IsItemHovered() only: Return true even if the item uses AllowOverlap mode and is overlapped by another hoverable item.
|
294
|
+
ImGuiHoveredFlags_AllowWhenOverlappedByWindow = 512 # 1 << 9 # IsItemHovered() only: Return true even if the position is obstructed or overlapped by another window.
|
295
|
+
ImGuiHoveredFlags_AllowWhenDisabled = 1024 # 1 << 10 # IsItemHovered() only: Return true even if the item is disabled
|
296
|
+
ImGuiHoveredFlags_NoNavOverride = 2048 # 1 << 11 # IsItemHovered() only: Disable using gamepad/keyboard navigation state when active, always query mouse
|
297
|
+
ImGuiHoveredFlags_AllowWhenOverlapped = 768 # ImGuiHoveredFlags_AllowWhenOverlappedByItem | ImGuiHoveredFlags_AllowWhenOverlappedByWindow
|
298
|
+
ImGuiHoveredFlags_RectOnly = 928 # ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped
|
297
299
|
ImGuiHoveredFlags_RootAndChildWindows = 3 # ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows
|
298
|
-
|
299
|
-
|
300
|
-
|
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)
|
301
306
|
|
302
307
|
# ImGuiInputTextFlags_
|
303
308
|
# Flags for ImGui::InputText()
|
@@ -564,12 +569,12 @@ ImGuiPopupFlags_AnyPopup = 384 # ImGuiPopupFlags_AnyPopupId | ImGu
|
|
564
569
|
|
565
570
|
# ImGuiSelectableFlags_
|
566
571
|
# Flags for ImGui::Selectable()
|
567
|
-
ImGuiSelectableFlags_None = 0
|
568
|
-
ImGuiSelectableFlags_DontClosePopups = 1
|
569
|
-
ImGuiSelectableFlags_SpanAllColumns = 2
|
570
|
-
ImGuiSelectableFlags_AllowDoubleClick = 4
|
571
|
-
ImGuiSelectableFlags_Disabled = 8
|
572
|
-
|
572
|
+
ImGuiSelectableFlags_None = 0 # 0
|
573
|
+
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)
|
575
|
+
ImGuiSelectableFlags_AllowDoubleClick = 4 # 1 << 2 # Generate press events on double clicks too
|
576
|
+
ImGuiSelectableFlags_Disabled = 8 # 1 << 3 # Cannot be selected, display grayed out text
|
577
|
+
ImGuiSelectableFlags_AllowOverlap = 16 # 1 << 4 # (WIP) Hit testing to allow subsequent widgets to overlap this one
|
573
578
|
|
574
579
|
# ImGuiSliderFlags_
|
575
580
|
# Flags for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc.
|
@@ -767,14 +772,14 @@ ImGuiTableRowFlags_Headers = 1 # 1 << 0 # Identify header row (set default backg
|
|
767
772
|
ImGuiTreeNodeFlags_None = 0 # 0
|
768
773
|
ImGuiTreeNodeFlags_Selected = 1 # 1 << 0 # Draw as selected
|
769
774
|
ImGuiTreeNodeFlags_Framed = 2 # 1 << 1 # Draw frame with background (e.g. for CollapsingHeader)
|
770
|
-
|
775
|
+
ImGuiTreeNodeFlags_AllowOverlap = 4 # 1 << 2 # Hit testing to allow subsequent widgets to overlap this one
|
771
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
|
772
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)
|
773
778
|
ImGuiTreeNodeFlags_DefaultOpen = 32 # 1 << 5 # Default node to be open
|
774
779
|
ImGuiTreeNodeFlags_OpenOnDoubleClick = 64 # 1 << 6 # Need double-click to open node
|
775
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.
|
776
781
|
ImGuiTreeNodeFlags_Leaf = 256 # 1 << 8 # No collapsing, no arrow (use as a convenience for leaf nodes).
|
777
|
-
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!
|
778
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().
|
779
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.
|
780
785
|
ImGuiTreeNodeFlags_SpanFullWidth = 4096 # 1 << 12 # Extend hit box to the left-most and right-most edges (bypass the indented area).
|
@@ -864,6 +869,35 @@ class ImDrawListSplitter < FFI::Struct
|
|
864
869
|
:_Count, :int, # Number of active channels (1+)
|
865
870
|
:_Channels, ImVector.by_value # Draw channels (not resized down so _Count might be < Channels.Size)
|
866
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
|
+
|
867
901
|
end
|
868
902
|
|
869
903
|
# Typically, 1 command = 1 GPU draw call (unless command is a callback)
|
@@ -881,6 +915,19 @@ class ImDrawCmd < FFI::Struct
|
|
881
915
|
:UserCallback, :pointer, # 4-8 // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
|
882
916
|
:UserCallbackData, :pointer # 4-8 // The draw callback code can access this.
|
883
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
|
+
|
884
931
|
end
|
885
932
|
|
886
933
|
# [Internal] For use by ImDrawList
|
@@ -1362,6 +1409,45 @@ class ImGuiKeyData < FFI::Struct
|
|
1362
1409
|
)
|
1363
1410
|
end
|
1364
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
|
+
|
1365
1451
|
# Helper: ImColor() implicitly converts colors to either ImU32 (packed 4x1 byte) or ImVec4 (4x1 float)
|
1366
1452
|
# Prefer using IM_COL32() macros if you want a guaranteed compile-time ImU32 for usage with ImDrawList API.
|
1367
1453
|
# **Avoid storing ImColor! Store either u32 of ImVec4. This is not a full-featured color class. MAY OBSOLETE.
|
@@ -1378,14 +1464,40 @@ end
|
|
1378
1464
|
class ImDrawData < FFI::Struct
|
1379
1465
|
layout(
|
1380
1466
|
:Valid, :bool, # Only valid after Render() is called and before the next NewFrame() is called.
|
1381
|
-
:CmdListsCount, :int, # Number of ImDrawList* to render
|
1467
|
+
:CmdListsCount, :int, # Number of ImDrawList* to render (should always be == CmdLists.size)
|
1382
1468
|
:TotalIdxCount, :int, # For convenience, sum of all ImDrawList's IdxBuffer.Size
|
1383
1469
|
:TotalVtxCount, :int, # For convenience, sum of all ImDrawList's VtxBuffer.Size
|
1384
|
-
:CmdLists,
|
1470
|
+
:CmdLists, ImVector.by_value, # Array of ImDrawList* to render. The ImDrawLists are owned by ImGuiContext and only pointed to from here.
|
1385
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)
|
1386
1472
|
:DisplaySize, ImVec2.by_value, # Size of the viewport to render (== GetMainViewport()->Size for the main viewport, == io.DisplaySize in most single-viewport applications)
|
1387
|
-
:FramebufferScale, ImVec2.by_value
|
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).
|
1388
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
|
+
|
1389
1501
|
end
|
1390
1502
|
|
1391
1503
|
# Font runtime data and rendering
|
@@ -1413,6 +1525,81 @@ class ImFont < FFI::Struct
|
|
1413
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)
|
1414
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.
|
1415
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
|
+
|
1416
1603
|
end
|
1417
1604
|
|
1418
1605
|
# See ImFontAtlas::AddCustomRectXXX functions.
|
@@ -1427,6 +1614,19 @@ class ImFontAtlasCustomRect < FFI::Struct
|
|
1427
1614
|
:GlyphOffset, ImVec2.by_value, # Input // For custom font glyphs only: glyph display offset
|
1428
1615
|
:Font, ImFont.ptr # Input // For custom font glyphs only: target font
|
1429
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
|
+
|
1430
1630
|
end
|
1431
1631
|
|
1432
1632
|
class ImFontConfig < FFI::Struct
|
@@ -1436,7 +1636,7 @@ class ImFontConfig < FFI::Struct
|
|
1436
1636
|
:FontDataOwnedByAtlas, :bool, # true // TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself).
|
1437
1637
|
:FontNo, :int, # 0 // Index of font within TTF/OTF file
|
1438
1638
|
:SizePixels, :float, # // Size in pixels for rasterizer (more or less maps to the resulting font height).
|
1439
|
-
:OversampleH, :int, #
|
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.
|
1440
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.
|
1441
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.
|
1442
1642
|
:GlyphExtraSpacing, ImVec2.by_value, # 0, 0 // Extra spacing (in pixels) between glyphs. Only X axis is supported for now.
|
@@ -1462,6 +1662,25 @@ class ImFontConfig < FFI::Struct
|
|
1462
1662
|
|
1463
1663
|
end
|
1464
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
|
+
|
1465
1684
|
# Helper to build glyph ranges from text/string data. Feed your application strings/characters to it then call BuildRanges().
|
1466
1685
|
# This is essentially a tightly packed of vector of 64k booleans = 8KB storage.
|
1467
1686
|
class ImFontGlyphRangesBuilder < FFI::Struct
|
@@ -1516,13 +1735,6 @@ class ImGuiIO < FFI::Struct
|
|
1516
1735
|
:IniSavingRate, :float, # = 5.0f // Minimum time between saving positions/sizes to .ini file, in seconds.
|
1517
1736
|
: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.
|
1518
1737
|
:LogFilename, :pointer, # = "imgui_log.txt"// Path to .log file (default parameter to ImGui::LogToFile when no file is specified).
|
1519
|
-
:MouseDoubleClickTime, :float, # = 0.30f // Time for a double-click, in seconds.
|
1520
|
-
:MouseDoubleClickMaxDist, :float, # = 6.0f // Distance threshold to stay in to validate a double-click, in pixels.
|
1521
|
-
:MouseDragThreshold, :float, # = 6.0f // Distance threshold before considering we are dragging.
|
1522
|
-
:KeyRepeatDelay, :float, # = 0.275f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
|
1523
|
-
:KeyRepeatRate, :float, # = 0.050f // When holding a key/button, rate at which it repeats, in seconds.
|
1524
|
-
:HoverDelayNormal, :float, # = 0.30 sec // Delay on hovering before IsItemHovered(ImGuiHoveredFlags_DelayNormal) returns true.
|
1525
|
-
:HoverDelayShort, :float, # = 0.10 sec // Delay on hovering before IsItemHovered(ImGuiHoveredFlags_DelayShort) returns true.
|
1526
1738
|
:UserData, :pointer, # = NULL // Store your own data.
|
1527
1739
|
:Fonts, ImFontAtlas.ptr, # <auto> // Font atlas: load, rasterize and pack one or more fonts into a single texture.
|
1528
1740
|
:FontGlobalScale, :float, # = 1.0f // Global scale all fonts
|
@@ -1538,9 +1750,15 @@ class ImGuiIO < FFI::Struct
|
|
1538
1750
|
: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)
|
1539
1751
|
:ConfigWindowsMoveFromTitleBarOnly, :bool, # = false // Enable allowing to move windows only when clicking on their title bar. Does not apply to windows without a title bar.
|
1540
1752
|
:ConfigMemoryCompactTimer, :float, # = 60.0f // Timer (in seconds) to free transient windows/tables memory buffers when unused. Set to -1.0f to disable.
|
1753
|
+
:MouseDoubleClickTime, :float, # = 0.30f // Time for a double-click, in seconds.
|
1754
|
+
:MouseDoubleClickMaxDist, :float, # = 6.0f // Distance threshold to stay in to validate a double-click, in pixels.
|
1755
|
+
:MouseDragThreshold, :float, # = 6.0f // Distance threshold before considering we are dragging.
|
1756
|
+
:KeyRepeatDelay, :float, # = 0.275f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
|
1757
|
+
:KeyRepeatRate, :float, # = 0.050f // When holding a key/button, rate at which it repeats, in seconds.
|
1541
1758
|
: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.
|
1542
1759
|
: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.
|
1543
1760
|
:ConfigDebugIgnoreFocusLoss, :bool, # = false // Ignore io.AddFocusEvent(false), consequently not calling io.ClearInputKeys() in input processing.
|
1761
|
+
:ConfigDebugIniSettings, :bool, # = false // Save .ini data with extra comments (particularly helpful for Docking, but makes saving slower)
|
1544
1762
|
:BackendPlatformName, :pointer, # = NULL
|
1545
1763
|
:BackendRendererName, :pointer, # = NULL
|
1546
1764
|
:BackendPlatformUserData, :pointer, # = NULL // User data for platform backend
|
@@ -1551,6 +1769,7 @@ class ImGuiIO < FFI::Struct
|
|
1551
1769
|
:ClipboardUserData, :pointer,
|
1552
1770
|
:SetPlatformImeDataFn, :pointer,
|
1553
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
|
1554
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.).
|
1555
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.).
|
1556
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).
|
@@ -1644,8 +1863,8 @@ class ImGuiIO < FFI::Struct
|
|
1644
1863
|
ImGui::ImGuiIO_AddMouseWheelEvent(self, wheel_x, wheel_y)
|
1645
1864
|
end
|
1646
1865
|
|
1647
|
-
def
|
1648
|
-
ImGui::
|
1866
|
+
def ClearEventsQueue()
|
1867
|
+
ImGui::ImGuiIO_ClearEventsQueue(self)
|
1649
1868
|
end
|
1650
1869
|
|
1651
1870
|
def ClearInputKeys()
|
@@ -1695,6 +1914,135 @@ class ImGuiInputTextCallbackData < FFI::Struct
|
|
1695
1914
|
:SelectionStart, :int, # // Read-write // [Completion,History,Always] == to SelectionEnd when no selection)
|
1696
1915
|
:SelectionEnd, :int # // Read-write // [Completion,History,Always]
|
1697
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
|
+
|
1698
2046
|
end
|
1699
2047
|
|
1700
2048
|
# (Optional) Support for IME (Input Method Editor) via the io.SetPlatformImeDataFn() function.
|
@@ -1704,6 +2052,15 @@ class ImGuiPlatformImeData < FFI::Struct
|
|
1704
2052
|
:InputPos, ImVec2.by_value, # Position of the input cursor
|
1705
2053
|
:InputLineHeight, :float # Line height
|
1706
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
|
+
|
1707
2064
|
end
|
1708
2065
|
|
1709
2066
|
# Resizing callback data to apply custom constraint. As enabled by SetNextWindowSizeConstraints(). Callback is called during the next Begin().
|
@@ -1717,6 +2074,81 @@ class ImGuiSizeCallbackData < FFI::Struct
|
|
1717
2074
|
)
|
1718
2075
|
end
|
1719
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
|
+
|
1720
2152
|
class ImGuiStyle < FFI::Struct
|
1721
2153
|
layout(
|
1722
2154
|
:Alpha, :float, # Global alpha applies to everything in Dear ImGui.
|
@@ -1736,7 +2168,7 @@ class ImGuiStyle < FFI::Struct
|
|
1736
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).
|
1737
2169
|
:ItemSpacing, ImVec2.by_value, # Horizontal and vertical spacing between widgets/lines.
|
1738
2170
|
:ItemInnerSpacing, ImVec2.by_value, # Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label).
|
1739
|
-
: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.
|
1740
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!
|
1741
2173
|
:IndentSpacing, :float, # Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
|
1742
2174
|
:ColumnsMinSpacing, :float, # Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
|
@@ -1762,7 +2194,12 @@ class ImGuiStyle < FFI::Struct
|
|
1762
2194
|
: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).
|
1763
2195
|
: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.
|
1764
2196
|
: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.
|
1765
|
-
:Colors, [ImVec4.by_value, 53]
|
2197
|
+
:Colors, [ImVec4.by_value, 53],
|
2198
|
+
:HoverStationaryDelay, :float, # Delay for IsItemHovered(ImGuiHoveredFlags_Stationary). Time required to consider mouse stationary.
|
2199
|
+
:HoverDelayShort, :float, # Delay for IsItemHovered(ImGuiHoveredFlags_DelayShort). Usually used along with HoverStationaryDelay.
|
2200
|
+
:HoverDelayNormal, :float, # Delay for IsItemHovered(ImGuiHoveredFlags_DelayNormal). "
|
2201
|
+
:HoverFlagsForTooltipMouse, :int, # Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()/SetItemTooltip() while using mouse.
|
2202
|
+
:HoverFlagsForTooltipNav, :int # Default flags when using IsItemHovered(ImGuiHoveredFlags_ForTooltip) or BeginItemTooltip()/SetItemTooltip() while using keyboard/gamepad.
|
1766
2203
|
)
|
1767
2204
|
|
1768
2205
|
def self.create()
|
@@ -1787,6 +2224,15 @@ class ImGuiTableColumnSortSpecs < FFI::Struct
|
|
1787
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)
|
1788
2225
|
:SortDirection, :int # ImGuiSortDirection_Ascending or ImGuiSortDirection_Descending (you can use this or SortSign, whichever is more convenient for your sort function)
|
1789
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
|
+
|
1790
2236
|
end
|
1791
2237
|
|
1792
2238
|
# Sorting specifications for a table (often handling sort specs for a single column, occasionally more)
|
@@ -1799,6 +2245,68 @@ class ImGuiTableSortSpecs < FFI::Struct
|
|
1799
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.
|
1800
2246
|
:SpecsDirty, :bool # Set to true when specs have changed since last time! Use this to sort again, then clear the flag.
|
1801
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
|
+
|
1802
2310
|
end
|
1803
2311
|
|
1804
2312
|
# Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
|
@@ -1839,22 +2347,32 @@ class ImGuiTextFilter < FFI::Struct
|
|
1839
2347
|
|
1840
2348
|
end
|
1841
2349
|
|
1842
|
-
|
1843
|
-
# - In 'docking' branch with multi-viewport enabled, we extend this concept to have multiple active viewports.
|
1844
|
-
# - In the future we will extend this concept further to also represent Platform Monitor and support a "no main platform window" operation mode.
|
1845
|
-
# - About Main Area vs Work Area:
|
1846
|
-
# - Main Area = entire viewport.
|
1847
|
-
# - Work Area = entire viewport minus sections used by main menu bars (for platform windows), or by task bar (for platform monitor).
|
1848
|
-
# - Windows are generally trying to stay within the Work Area of their host viewport.
|
1849
|
-
class ImGuiViewport < FFI::Struct
|
2350
|
+
class ImGuiTextRange < FFI::Struct
|
1850
2351
|
layout(
|
1851
|
-
:
|
1852
|
-
:
|
1853
|
-
:Size, ImVec2.by_value, # Main Area: Size of the viewport.
|
1854
|
-
:WorkPos, ImVec2.by_value, # Work Area: Position of the viewport minus task bars, menus bars, status bars (>= Pos)
|
1855
|
-
:WorkSize, ImVec2.by_value, # Work Area: Size of the viewport minus task bars, menu bars, status bars (<= Size)
|
1856
|
-
: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
|
1857
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
|
+
|
1858
2376
|
end
|
1859
2377
|
|
1860
2378
|
class ImGuiStoragePair < FFI::Struct
|
@@ -1862,6 +2380,23 @@ class ImGuiStoragePair < FFI::Struct
|
|
1862
2380
|
:key, :uint,
|
1863
2381
|
:val_p, :pointer
|
1864
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
|
+
|
1865
2400
|
end
|
1866
2401
|
|
1867
2402
|
# shorthand initializer
|
@@ -1913,6 +2448,22 @@ module ImGui
|
|
1913
2448
|
callback :ImGuiSizeCallback, [ImGuiSizeCallbackData], :void
|
1914
2449
|
|
1915
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],
|
1916
2467
|
[:ImDrawList_AddBezierCubic, [:pointer, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, :uint, :float, :int], :void],
|
1917
2468
|
[:ImDrawList_AddBezierQuadratic, [:pointer, ImVec2.by_value, ImVec2.by_value, ImVec2.by_value, :uint, :float, :int], :void],
|
1918
2469
|
[:ImDrawList_AddCallback, [:pointer, :ImDrawCallback, :pointer], :void],
|
@@ -1977,6 +2528,9 @@ module ImGui
|
|
1977
2528
|
[:ImDrawList__ResetForNewFrame, [:pointer], :void],
|
1978
2529
|
[:ImDrawList__TryMergeDrawCmds, [:pointer], :void],
|
1979
2530
|
[:ImDrawList_destroy, [:pointer], :void],
|
2531
|
+
[:ImFontAtlasCustomRect_ImFontAtlasCustomRect, [], :pointer],
|
2532
|
+
[:ImFontAtlasCustomRect_IsPacked, [:pointer], :bool],
|
2533
|
+
[:ImFontAtlasCustomRect_destroy, [:pointer], :void],
|
1980
2534
|
[:ImFontAtlas_AddCustomRectFontGlyph, [:pointer, :pointer, :ushort, :int, :int, :float, ImVec2.by_value], :int],
|
1981
2535
|
[:ImFontAtlas_AddCustomRectRegular, [:pointer, :int, :int], :int],
|
1982
2536
|
[:ImFontAtlas_AddFont, [:pointer, :pointer], :pointer],
|
@@ -2019,6 +2573,24 @@ module ImGui
|
|
2019
2573
|
[:ImFontGlyphRangesBuilder_ImFontGlyphRangesBuilder, [], :pointer],
|
2020
2574
|
[:ImFontGlyphRangesBuilder_SetBit, [:pointer, :size_t], :void],
|
2021
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],
|
2022
2594
|
[:ImGuiIO_AddFocusEvent, [:pointer, :bool], :void],
|
2023
2595
|
[:ImGuiIO_AddInputCharacter, [:pointer, :uint], :void],
|
2024
2596
|
[:ImGuiIO_AddInputCharacterUTF16, [:pointer, :ushort], :void],
|
@@ -2029,15 +2601,73 @@ module ImGui
|
|
2029
2601
|
[:ImGuiIO_AddMousePosEvent, [:pointer, :float, :float], :void],
|
2030
2602
|
[:ImGuiIO_AddMouseSourceEvent, [:pointer, :int], :void],
|
2031
2603
|
[:ImGuiIO_AddMouseWheelEvent, [:pointer, :float, :float], :void],
|
2032
|
-
[:
|
2604
|
+
[:ImGuiIO_ClearEventsQueue, [:pointer], :void],
|
2033
2605
|
[:ImGuiIO_ClearInputKeys, [:pointer], :void],
|
2034
2606
|
[:ImGuiIO_ImGuiIO, [], :pointer],
|
2035
2607
|
[:ImGuiIO_SetAppAcceptingEvents, [:pointer, :bool], :void],
|
2036
2608
|
[:ImGuiIO_SetKeyEventNativeData, [:pointer, :int, :int, :int, :int], :void],
|
2037
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],
|
2038
2653
|
[:ImGuiStyle_ImGuiStyle, [], :pointer],
|
2039
2654
|
[:ImGuiStyle_ScaleAllSizes, [:pointer, :float], :void],
|
2040
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],
|
2041
2671
|
[:ImGuiTextFilter_Build, [:pointer], :void],
|
2042
2672
|
[:ImGuiTextFilter_Clear, [:pointer], :void],
|
2043
2673
|
[:ImGuiTextFilter_Draw, [:pointer, :pointer, :float], :bool],
|
@@ -2050,6 +2680,10 @@ module ImGui
|
|
2050
2680
|
[:ImGuiTextRange_destroy, [:pointer], :void],
|
2051
2681
|
[:ImGuiTextRange_empty, [:pointer], :bool],
|
2052
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],
|
2053
2687
|
[:igAcceptDragDropPayload, [:pointer, :int], :pointer],
|
2054
2688
|
[:igAlignTextToFramePadding, [], :void],
|
2055
2689
|
[:igArrowButton, [:pointer, :int], :bool],
|
@@ -2062,6 +2696,7 @@ module ImGui
|
|
2062
2696
|
[:igBeginDragDropSource, [:int], :bool],
|
2063
2697
|
[:igBeginDragDropTarget, [], :bool],
|
2064
2698
|
[:igBeginGroup, [], :void],
|
2699
|
+
[:igBeginItemTooltip, [], :bool],
|
2065
2700
|
[:igBeginListBox, [:pointer, ImVec2.by_value], :bool],
|
2066
2701
|
[:igBeginMainMenuBar, [], :bool],
|
2067
2702
|
[:igBeginMenu, [:pointer, :bool], :bool],
|
@@ -2319,12 +2954,13 @@ module ImGui
|
|
2319
2954
|
[:igSetCursorPosY, [:float], :void],
|
2320
2955
|
[:igSetCursorScreenPos, [ImVec2.by_value], :void],
|
2321
2956
|
[:igSetDragDropPayload, [:pointer, :pointer, :size_t, :int], :bool],
|
2322
|
-
[:igSetItemAllowOverlap, [], :void],
|
2323
2957
|
[:igSetItemDefaultFocus, [], :void],
|
2958
|
+
[:igSetItemTooltip, [:pointer, :varargs], :void],
|
2324
2959
|
[:igSetKeyboardFocusHere, [:int], :void],
|
2325
2960
|
[:igSetMouseCursor, [:int], :void],
|
2326
2961
|
[:igSetNextFrameWantCaptureKeyboard, [:bool], :void],
|
2327
2962
|
[:igSetNextFrameWantCaptureMouse, [:bool], :void],
|
2963
|
+
[:igSetNextItemAllowOverlap, [], :void],
|
2328
2964
|
[:igSetNextItemOpen, [:bool, :int], :void],
|
2329
2965
|
[:igSetNextItemWidth, [:float], :void],
|
2330
2966
|
[:igSetNextWindowBgAlpha, [:float], :void],
|
@@ -2528,6 +3164,16 @@ module ImGui
|
|
2528
3164
|
igBeginGroup()
|
2529
3165
|
end
|
2530
3166
|
|
3167
|
+
# ret: bool
|
3168
|
+
#
|
3169
|
+
# Tooltips: helpers for showing a tooltip when hovering an item
|
3170
|
+
# - BeginItemTooltip() is a shortcut for the 'if (IsItemHovered(ImGuiHoveredFlags_Tooltip) && BeginTooltip())' idiom.
|
3171
|
+
# - SetItemTooltip() is a shortcut for the 'if (IsItemHovered(ImGuiHoveredFlags_Tooltip)) { SetTooltip(...); }' idiom.
|
3172
|
+
# - 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'.
|
3173
|
+
def self.BeginItemTooltip() # begin/append a tooltip window if preceding item was hovered.
|
3174
|
+
igBeginItemTooltip()
|
3175
|
+
end
|
3176
|
+
|
2531
3177
|
# arg: label(const char*), size(ImVec2)
|
2532
3178
|
# ret: bool
|
2533
3179
|
#
|
@@ -2651,8 +3297,9 @@ module ImGui
|
|
2651
3297
|
# ret: bool
|
2652
3298
|
#
|
2653
3299
|
# Tooltips
|
2654
|
-
# -
|
2655
|
-
|
3300
|
+
# - Tooltips are windows following the mouse. They do not take focus away.
|
3301
|
+
# - A tooltip window can contain items of any types. SetTooltip() is a shortcut for the 'if (BeginTooltip()) { Text(...); EndTooltip(); }' idiom.
|
3302
|
+
def self.BeginTooltip() # begin/append a tooltip window.
|
2656
3303
|
igBeginTooltip()
|
2657
3304
|
end
|
2658
3305
|
|
@@ -3024,7 +3671,7 @@ module ImGui
|
|
3024
3671
|
end
|
3025
3672
|
|
3026
3673
|
# ret: void
|
3027
|
-
def self.EndTooltip() # only call EndTooltip() if BeginTooltip() returns true!
|
3674
|
+
def self.EndTooltip() # only call EndTooltip() if BeginTooltip()/BeginItemTooltip() returns true!
|
3028
3675
|
igEndTooltip()
|
3029
3676
|
end
|
3030
3677
|
|
@@ -3406,14 +4053,14 @@ module ImGui
|
|
3406
4053
|
end
|
3407
4054
|
|
3408
4055
|
# ret: void
|
3409
|
-
def self.GetWindowPos() # get current window position in screen space (
|
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())
|
3410
4057
|
pOut = ImVec2.new
|
3411
4058
|
igGetWindowPos(pOut)
|
3412
4059
|
return pOut
|
3413
4060
|
end
|
3414
4061
|
|
3415
4062
|
# ret: void
|
3416
|
-
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)
|
3417
4064
|
pOut = ImVec2.new
|
3418
4065
|
igGetWindowSize(pOut)
|
3419
4066
|
return pOut
|
@@ -4174,11 +4821,6 @@ module ImGui
|
|
4174
4821
|
igSetDragDropPayload(type, data, sz, cond)
|
4175
4822
|
end
|
4176
4823
|
|
4177
|
-
# ret: void
|
4178
|
-
def self.SetItemAllowOverlap() # allow last item to be overlapped by a subsequent item. sometimes useful with invisible buttons, selectables, etc. to catch unused area.
|
4179
|
-
igSetItemAllowOverlap()
|
4180
|
-
end
|
4181
|
-
|
4182
4824
|
# ret: void
|
4183
4825
|
#
|
4184
4826
|
# Focus, Activation
|
@@ -4187,6 +4829,12 @@ module ImGui
|
|
4187
4829
|
igSetItemDefaultFocus()
|
4188
4830
|
end
|
4189
4831
|
|
4832
|
+
# arg: fmt(const char*), ...(...)
|
4833
|
+
# ret: void
|
4834
|
+
def self.SetItemTooltip(fmt, *varargs) # set a text-only tooltip if preceeding item was hovered. override any previous call to SetTooltip().
|
4835
|
+
igSetItemTooltip(fmt, *varargs)
|
4836
|
+
end
|
4837
|
+
|
4190
4838
|
# arg: offset(int)
|
4191
4839
|
# ret: void
|
4192
4840
|
def self.SetKeyboardFocusHere(offset = 0) # Implied offset = 0
|
@@ -4211,6 +4859,13 @@ module ImGui
|
|
4211
4859
|
igSetNextFrameWantCaptureMouse(want_capture_mouse)
|
4212
4860
|
end
|
4213
4861
|
|
4862
|
+
# ret: void
|
4863
|
+
#
|
4864
|
+
# Overlapping mode
|
4865
|
+
def self.SetNextItemAllowOverlap() # allow next item to be overlapped by a subsequent item. Useful with invisible buttons, selectable, treenode covering an area where subsequent items may need to be added. Note that both Selectable() and TreeNode() have dedicated flags doing this.
|
4866
|
+
igSetNextItemAllowOverlap()
|
4867
|
+
end
|
4868
|
+
|
4214
4869
|
# arg: is_open(bool), cond(ImGuiCond)
|
4215
4870
|
# ret: void
|
4216
4871
|
def self.SetNextItemOpen(is_open, cond = 0) # set next TreeNode/CollapsingHeader open state.
|
@@ -4323,7 +4978,7 @@ module ImGui
|
|
4323
4978
|
|
4324
4979
|
# arg: fmt(const char*), ...(...)
|
4325
4980
|
# ret: void
|
4326
|
-
def self.SetTooltip(fmt, *varargs) # set a text-only tooltip
|
4981
|
+
def self.SetTooltip(fmt, *varargs) # set a text-only tooltip. Often used after a ImGui::IsItemHovered() check. Override any previous call to SetTooltip().
|
4327
4982
|
igSetTooltip(fmt, *varargs)
|
4328
4983
|
end
|
4329
4984
|
|
data/lib/imgui.x86_64.so
CHANGED
Binary file
|
data/lib/imgui_impl_opengl2.rb
CHANGED
@@ -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]
|
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))) )
|
data/lib/imgui_impl_opengl3.rb
CHANGED
@@ -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]
|
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
|
|
data/lib/imgui_impl_raylib.rb
CHANGED
@@ -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]
|
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]
|
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
|
|
data/lib/imnodes.aarch64.so
CHANGED
Binary file
|
data/lib/imnodes.dll
CHANGED
Binary file
|
data/lib/imnodes.dylib
CHANGED
Binary file
|
data/lib/imnodes.x86_64.so
CHANGED
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.
|
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-
|
11
|
+
date: 2023-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|