imgui-bindings 0.1.13 → 0.1.14

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: b5de8b1ce56ca56a70064f0d7e79e28f36ec92e4db20c45187f5dec1917c3800
4
- data.tar.gz: a5024371f9af50dd0faaa9db4d102d5975dea1f3e7b06958edc758e50d091f7f
3
+ metadata.gz: a010bc4af9ffe48e7e18df858d89eaf2cc0b6bcfa75cc40086acf64ba9e39910
4
+ data.tar.gz: 9136a4d7999fb240b3572cc417d0587ce530a02d17edd030a66a50cf2eff044f
5
5
  SHA512:
6
- metadata.gz: e999c745e6d515588898e97b6ff9e564388ce4dc3d994c257ffd23c8d6e0896681d205562065aafce19ac12da6a2936a4855d9ba23fc6444ae4eac544b522b6c
7
- data.tar.gz: cb9b4a626eaebbabf3ea5f44bd065a5c3e88e9c6bcf7849d4e73e6676c7cea4b94bbc7f9d44011d1d263712579cdd3abd499eb7eb9c972ea9d49949f4aae1edb
6
+ metadata.gz: d2dc23b5d55ef742505553720c9a217d0c844d31b984f73561040f382ccdd726aaa11079d93344635c8afe7b794ce6f3982ea5efacab571592e18446f4d762e7
7
+ data.tar.gz: ae5ee78ec39720a81a04f2b9c4a463809c67944a359a0e97969842e5a9579b40ce27625f548278dadaea8e6ecaf69738e617d625cc63f08d5ff9da7862952902
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ 2024-08-04 vaiorabbit <http://twitter.com/vaiorabbit>
2
+
3
+ * ImGui v1.91.0
4
+
1
5
  2024-07-14 vaiorabbit <http://twitter.com/vaiorabbit>
2
6
 
3
7
  * ImGui v1.90.9
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 : 2024-07-14
6
+ * Last modified : 2024-08-04
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
Binary file
data/lib/imgui.dll CHANGED
Binary file
data/lib/imgui.rb CHANGED
@@ -26,13 +26,16 @@ FFI.typedef :int, :ImGuiHoveredFlags
26
26
  FFI.typedef :uint, :ImGuiID
27
27
  FFI.typedef :int, :ImGuiInputFlags
28
28
  FFI.typedef :int, :ImGuiInputTextFlags
29
+ FFI.typedef :int, :ImGuiItemFlags
29
30
  FFI.typedef :int, :ImGuiKeyChord
30
31
  FFI.typedef :pointer, :ImGuiMemAllocFunc
31
32
  FFI.typedef :pointer, :ImGuiMemFreeFunc
32
33
  FFI.typedef :int, :ImGuiMouseButton
33
34
  FFI.typedef :int, :ImGuiMouseCursor
35
+ FFI.typedef :int, :ImGuiMultiSelectFlags
34
36
  FFI.typedef :int, :ImGuiPopupFlags
35
37
  FFI.typedef :int, :ImGuiSelectableFlags
38
+ FFI.typedef :int64, :ImGuiSelectionUserData
36
39
  FFI.typedef :int, :ImGuiSliderFlags
37
40
  FFI.typedef :int, :ImGuiStyleVar
38
41
  FFI.typedef :int, :ImGuiTabBarFlags
@@ -61,6 +64,46 @@ FFI.typedef :int, :ImGuiKey
61
64
  FFI.typedef :int, :ImGuiMouseSource
62
65
  FFI.typedef :uchar, :ImGuiSortDirection
63
66
 
67
+ FFI.typedef :int32, :ImDrawFlags_
68
+ FFI.typedef :int32, :ImDrawListFlags_
69
+ FFI.typedef :int32, :ImFontAtlasFlags_
70
+ FFI.typedef :int32, :ImGuiBackendFlags_
71
+ FFI.typedef :int32, :ImGuiButtonFlags_
72
+ FFI.typedef :int32, :ImGuiChildFlags_
73
+ FFI.typedef :int32, :ImGuiCol_
74
+ FFI.typedef :int32, :ImGuiColorEditFlags_
75
+ FFI.typedef :int32, :ImGuiComboFlags_
76
+ FFI.typedef :int32, :ImGuiCond_
77
+ FFI.typedef :int32, :ImGuiConfigFlags_
78
+ FFI.typedef :int32, :ImGuiDataType_
79
+ FFI.typedef :int32, :ImGuiDir
80
+ FFI.typedef :int32, :ImGuiDragDropFlags_
81
+ FFI.typedef :int32, :ImGuiFocusedFlags_
82
+ FFI.typedef :int32, :ImGuiHoveredFlags_
83
+ FFI.typedef :int32, :ImGuiInputFlags_
84
+ FFI.typedef :int32, :ImGuiInputTextFlags_
85
+ FFI.typedef :int32, :ImGuiItemFlags_
86
+ FFI.typedef :int32, :ImGuiKey
87
+ FFI.typedef :int32, :ImGuiMouseButton_
88
+ FFI.typedef :int32, :ImGuiMouseCursor_
89
+ FFI.typedef :int32, :ImGuiMouseSource
90
+ FFI.typedef :int32, :ImGuiMultiSelectFlags_
91
+ FFI.typedef :int32, :ImGuiPopupFlags_
92
+ FFI.typedef :int32, :ImGuiSelectableFlags_
93
+ FFI.typedef :int32, :ImGuiSelectionRequestType
94
+ FFI.typedef :int32, :ImGuiSliderFlags_
95
+ FFI.typedef :int32, :ImGuiSortDirection
96
+ FFI.typedef :int32, :ImGuiStyleVar_
97
+ FFI.typedef :int32, :ImGuiTabBarFlags_
98
+ FFI.typedef :int32, :ImGuiTabItemFlags_
99
+ FFI.typedef :int32, :ImGuiTableBgTarget_
100
+ FFI.typedef :int32, :ImGuiTableColumnFlags_
101
+ FFI.typedef :int32, :ImGuiTableFlags_
102
+ FFI.typedef :int32, :ImGuiTableRowFlags_
103
+ FFI.typedef :int32, :ImGuiTreeNodeFlags_
104
+ FFI.typedef :int32, :ImGuiViewportFlags_
105
+ FFI.typedef :int32, :ImGuiWindowFlags_
106
+
64
107
  # ImDrawFlags_
65
108
  # Flags for ImDrawList functions
66
109
  # (Legacy: bit 0 must always correspond to ImDrawFlags_Closed to be backward compatible with old API using a bool. Bits 1..3 must be unused)
@@ -109,7 +152,7 @@ ImGuiButtonFlags_None = 0 # 0
109
152
  ImGuiButtonFlags_MouseButtonLeft = 1 # 1 << 0 # React on left mouse button (default)
110
153
  ImGuiButtonFlags_MouseButtonRight = 2 # 1 << 1 # React on right mouse button
111
154
  ImGuiButtonFlags_MouseButtonMiddle = 4 # 1 << 2 # React on center mouse button
112
- ImGuiButtonFlags_MouseButtonMask_ = 7 # ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_MouseButtonMiddle
155
+ ImGuiButtonFlags_MouseButtonMask_ = 7 # ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_MouseButtonMiddle # [Internal]
113
156
 
114
157
  # ImGuiChildFlags_
115
158
  # Flags for ImGui::BeginChild()
@@ -130,7 +173,7 @@ ImGuiChildFlags_AutoResizeX = 16 # 1 << 4 # Enable auto-resizing width
130
173
  ImGuiChildFlags_AutoResizeY = 32 # 1 << 5 # Enable auto-resizing height. Read "IMPORTANT: Size measurement" details above.
131
174
  ImGuiChildFlags_AlwaysAutoResize = 64 # 1 << 6 # Combined with AutoResizeX/AutoResizeY. Always measure size even when child is hidden, always return true, always disable clipping optimization! NOT RECOMMENDED.
132
175
  ImGuiChildFlags_FrameStyle = 128 # 1 << 7 # Style the child window like a framed item: use FrameBg, FrameRounding, FrameBorderSize, FramePadding instead of ChildBg, ChildRounding, ChildBorderSize, WindowPadding.
133
- ImGuiChildFlags_NavFlattened = 256 # 1 << 8
176
+ ImGuiChildFlags_NavFlattened = 256 # 1 << 8 # [BETA] Share focus scope, allow gamepad/keyboard navigation to cross over parent border to this child or between sibling child windows.
134
177
 
135
178
  # ImGuiCol_
136
179
  # Enumeration for PushStyleColor() / PopStyleColor()
@@ -167,13 +210,13 @@ ImGuiCol_SeparatorActive = 29 # 29
167
210
  ImGuiCol_ResizeGrip = 30 # 30 # Resize grip in lower-right and lower-left corners of windows.
168
211
  ImGuiCol_ResizeGripHovered = 31 # 31
169
212
  ImGuiCol_ResizeGripActive = 32 # 32
170
- ImGuiCol_TabHovered = 33 # 33
171
- ImGuiCol_Tab = 34 # 34 # TabItem in a TabBar
172
- ImGuiCol_TabSelected = 35 # 35
173
- ImGuiCol_TabSelectedOverline = 36 # 36
174
- ImGuiCol_TabDimmed = 37 # 37
175
- ImGuiCol_TabDimmedSelected = 38 # 38
176
- ImGuiCol_TabDimmedSelectedOverline = 39 # 39
213
+ ImGuiCol_TabHovered = 33 # 33 # Tab background, when hovered
214
+ ImGuiCol_Tab = 34 # 34 # Tab background, when tab-bar is focused & tab is unselected
215
+ ImGuiCol_TabSelected = 35 # 35 # Tab background, when tab-bar is focused & tab is selected
216
+ ImGuiCol_TabSelectedOverline = 36 # 36 # Tab horizontal overline, when tab-bar is focused & tab is selected
217
+ ImGuiCol_TabDimmed = 37 # 37 # Tab background, when tab-bar is unfocused & tab is unselected
218
+ ImGuiCol_TabDimmedSelected = 38 # 38 # Tab background, when tab-bar is unfocused & tab is selected
219
+ ImGuiCol_TabDimmedSelectedOverline = 39 # 39 #..horizontal overline, when tab-bar is unfocused & tab is selected
177
220
  ImGuiCol_PlotLines = 40 # 40
178
221
  ImGuiCol_PlotLinesHovered = 41 # 41
179
222
  ImGuiCol_PlotHistogram = 42 # 42
@@ -183,7 +226,7 @@ ImGuiCol_TableBorderStrong = 45 # 45 # Table outer and header borders (p
183
226
  ImGuiCol_TableBorderLight = 46 # 46 # Table inner borders (prefer using Alpha=1.0 here)
184
227
  ImGuiCol_TableRowBg = 47 # 47 # Table row background (even rows)
185
228
  ImGuiCol_TableRowBgAlt = 48 # 48 # Table row background (odd rows)
186
- ImGuiCol_TextLink = 49 # 49
229
+ ImGuiCol_TextLink = 49 # 49 # Hyperlink color
187
230
  ImGuiCol_TextSelectedBg = 50 # 50
188
231
  ImGuiCol_DragDropTarget = 51 # 51 # Rectangle highlighting a drop target
189
232
  ImGuiCol_NavHighlight = 52 # 52 # Gamepad/keyboard: current highlighted item
@@ -254,9 +297,9 @@ ImGuiConfigFlags_NavEnableKeyboard = 1 # 1 << 0 # Master keyboard navigation
254
297
  ImGuiConfigFlags_NavEnableGamepad = 2 # 1 << 1 # Master gamepad navigation enable flag. Backend also needs to set ImGuiBackendFlags_HasGamepad.
255
298
  ImGuiConfigFlags_NavEnableSetMousePos = 4 # 1 << 2 # Instruct navigation to move the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your backend, otherwise ImGui will react as if the mouse is jumping around back and forth.
256
299
  ImGuiConfigFlags_NavNoCaptureKeyboard = 8 # 1 << 3 # Instruct navigation to not set the io.WantCaptureKeyboard flag when io.NavActive is set.
257
- ImGuiConfigFlags_NoMouse = 16 # 1 << 4 # Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information set by the backend.
300
+ ImGuiConfigFlags_NoMouse = 16 # 1 << 4 # Instruct dear imgui to disable mouse inputs and interactions.
258
301
  ImGuiConfigFlags_NoMouseCursorChange = 32 # 1 << 5 # Instruct backend to not alter mouse cursor shape and visibility. Use if the backend cursor changes are interfering with yours and you don't want to use SetMouseCursor() to change mouse cursor. You may want to honor requests from imgui by reading GetMouseCursor() yourself instead.
259
- ImGuiConfigFlags_NoKeyboard = 64 # 1 << 6
302
+ ImGuiConfigFlags_NoKeyboard = 64 # 1 << 6 # Instruct dear imgui to disable keyboard inputs and interactions. This is done by ignoring keyboard events and clearing existing states.
260
303
  ImGuiConfigFlags_IsSRGB = 1048576 # 1 << 20 # Application is SRGB-aware.
261
304
  ImGuiConfigFlags_IsTouchScreen = 2097152 # 1 << 21 # Application is using a touch screen instead of a mouse.
262
305
 
@@ -272,9 +315,11 @@ ImGuiDataType_S64 = 6 # 6 # long long / __int64
272
315
  ImGuiDataType_U64 = 7 # 7 # unsigned long long / unsigned __int64
273
316
  ImGuiDataType_Float = 8 # 8 # float
274
317
  ImGuiDataType_Double = 9 # 9 # double
275
- ImGuiDataType_COUNT = 10 # 10
318
+ ImGuiDataType_Bool = 10 # 10 # bool (provided for user convenience, not supported by scalar widgets)
319
+ ImGuiDataType_COUNT = 11 # 11
276
320
 
277
321
  # ImGuiDir
322
+ # A cardinal direction
278
323
  ImGuiDir_None = -1 # -1
279
324
  ImGuiDir_Left = 0 # 0
280
325
  ImGuiDir_Right = 1 # 1
@@ -290,9 +335,9 @@ ImGuiDragDropFlags_SourceNoDisableHover = 2 # 1 << 1 # By default, when dr
290
335
  ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 4 # 1 << 2 # Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item.
291
336
  ImGuiDragDropFlags_SourceAllowNullID = 8 # 1 << 3 # Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit.
292
337
  ImGuiDragDropFlags_SourceExtern = 16 # 1 << 4 # External source (from outside of dear imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously.
293
- ImGuiDragDropFlags_PayloadAutoExpire = 32 # 1 << 5
294
- ImGuiDragDropFlags_PayloadNoCrossContext = 64 # 1 << 6
295
- ImGuiDragDropFlags_PayloadNoCrossProcess = 128 # 1 << 7
338
+ ImGuiDragDropFlags_PayloadAutoExpire = 32 # 1 << 5 # Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged)
339
+ ImGuiDragDropFlags_PayloadNoCrossContext = 64 # 1 << 6 # Hint to specify that the payload may not be copied outside current dear imgui context.
340
+ ImGuiDragDropFlags_PayloadNoCrossProcess = 128 # 1 << 7 # Hint to specify that the payload may not be copied outside current process.
296
341
  ImGuiDragDropFlags_AcceptBeforeDelivery = 1024 # 1 << 10 # AcceptDragDropPayload() will returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered.
297
342
  ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 2048 # 1 << 11 # Do not draw the default highlight rectangle when hovering over target.
298
343
  ImGuiDragDropFlags_AcceptNoPreviewTooltip = 4096 # 1 << 12 # Request hiding the BeginDragDropSource tooltip from the BeginDragDropTarget site.
@@ -333,17 +378,20 @@ ImGuiHoveredFlags_DelayNormal = 65536 # 1 << 16 # IsItemHovered()
333
378
  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)
334
379
 
335
380
  # ImGuiInputFlags_
381
+ # Flags for Shortcut(), SetNextItemShortcut(),
382
+ # (and for upcoming extended versions of IsKeyPressed(), IsMouseClicked(), Shortcut(), SetKeyOwner(), SetItemKeyOwner() that are still in imgui_internal.h)
383
+ # Don't mistake with ImGuiInputTextFlags! (which is for ImGui::InputText() function)
336
384
  ImGuiInputFlags_None = 0 # 0
337
- ImGuiInputFlags_Repeat = 1 # 1 << 0
338
- ImGuiInputFlags_RouteActive = 1024 # 1 << 10
339
- ImGuiInputFlags_RouteFocused = 2048 # 1 << 11
340
- ImGuiInputFlags_RouteGlobal = 4096 # 1 << 12
341
- ImGuiInputFlags_RouteAlways = 8192 # 1 << 13
342
- ImGuiInputFlags_RouteOverFocused = 16384 # 1 << 14
343
- ImGuiInputFlags_RouteOverActive = 32768 # 1 << 15
344
- ImGuiInputFlags_RouteUnlessBgFocused = 65536 # 1 << 16
345
- ImGuiInputFlags_RouteFromRootWindow = 131072 # 1 << 17
346
- ImGuiInputFlags_Tooltip = 262144 # 1 << 18
385
+ ImGuiInputFlags_Repeat = 1 # 1 << 0 # Enable repeat. Return true on successive repeats. Default for legacy IsKeyPressed(). NOT Default for legacy IsMouseClicked(). MUST BE == 1.
386
+ ImGuiInputFlags_RouteActive = 1024 # 1 << 10 # Route to active item only.
387
+ ImGuiInputFlags_RouteFocused = 2048 # 1 << 11 # Route to windows in the focus stack (DEFAULT). Deep-most focused window takes inputs. Active item takes inputs over deep-most focused window.
388
+ ImGuiInputFlags_RouteGlobal = 4096 # 1 << 12 # Global route (unless a focused window or active item registered the route).
389
+ ImGuiInputFlags_RouteAlways = 8192 # 1 << 13 # Do not register route, poll keys directly.
390
+ ImGuiInputFlags_RouteOverFocused = 16384 # 1 << 14 # Option: global route: higher priority than focused route (unless active item in focused route).
391
+ ImGuiInputFlags_RouteOverActive = 32768 # 1 << 15 # Option: global route: higher priority than active item. Unlikely you need to use that: will interfere with every active items, e.g. CTRL+A registered by InputText will be overridden by this. May not be fully honored as user/internal code is likely to always assume they can access keys when active.
392
+ ImGuiInputFlags_RouteUnlessBgFocused = 65536 # 1 << 16 # Option: global route: will not be applied if underlying background/void is focused (== no Dear ImGui windows are focused). Useful for overlay applications.
393
+ ImGuiInputFlags_RouteFromRootWindow = 131072 # 1 << 17 # Option: route evaluated from the point of view of root window rather than current window.
394
+ ImGuiInputFlags_Tooltip = 262144 # 1 << 18 # Automatically display a tooltip when hovering item [BETA] Unsure of right api (opt-in/opt-out)
347
395
 
348
396
  # ImGuiInputTextFlags_
349
397
  # Flags for ImGui::InputText()
@@ -357,13 +405,13 @@ ImGuiInputTextFlags_CharsNoBlank = 16 # 1 << 4 # Filter out spaces, t
357
405
  ImGuiInputTextFlags_AllowTabInput = 32 # 1 << 5 # Pressing TAB input a '\t' character into the text field
358
406
  ImGuiInputTextFlags_EnterReturnsTrue = 64 # 1 << 6 # Return 'true' when Enter is pressed (as opposed to every time the value was modified). Consider looking at the IsItemDeactivatedAfterEdit() function.
359
407
  ImGuiInputTextFlags_EscapeClearsAll = 128 # 1 << 7 # Escape key clears content if not empty, and deactivate otherwise (contrast to default behavior of Escape to revert)
360
- ImGuiInputTextFlags_CtrlEnterForNewLine = 256 # 1 << 8 # In multi-line mode, unfocus with Enter, add new line with Ctrl+Enter (default is opposite: unfocus with Ctrl+Enter, add line with Enter).
408
+ ImGuiInputTextFlags_CtrlEnterForNewLine = 256 # 1 << 8 # In multi-line mode, validate with Enter, add new line with Ctrl+Enter (default is opposite: validate with Ctrl+Enter, add line with Enter).
361
409
  ImGuiInputTextFlags_ReadOnly = 512 # 1 << 9 # Read-only mode
362
- ImGuiInputTextFlags_Password = 1024 # 1 << 10 # Password mode, display all characters as '*'
410
+ ImGuiInputTextFlags_Password = 1024 # 1 << 10 # Password mode, display all characters as '*', disable copy
363
411
  ImGuiInputTextFlags_AlwaysOverwrite = 2048 # 1 << 11 # Overwrite mode
364
412
  ImGuiInputTextFlags_AutoSelectAll = 4096 # 1 << 12 # Select entire text when first taking mouse focus
365
- ImGuiInputTextFlags_ParseEmptyRefVal = 8192 # 1 << 13
366
- ImGuiInputTextFlags_DisplayEmptyRefVal = 16384 # 1 << 14
413
+ ImGuiInputTextFlags_ParseEmptyRefVal = 8192 # 1 << 13 # InputFloat(), InputInt(), InputScalar() etc. only: parse empty string as zero value.
414
+ ImGuiInputTextFlags_DisplayEmptyRefVal = 16384 # 1 << 14 # InputFloat(), InputInt(), InputScalar() etc. only: when value is zero, do not display it. Generally used with ImGuiInputTextFlags_ParseEmptyRefVal.
367
415
  ImGuiInputTextFlags_NoHorizontalScroll = 32768 # 1 << 15 # Disable following the cursor horizontally
368
416
  ImGuiInputTextFlags_NoUndoRedo = 65536 # 1 << 16 # Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID().
369
417
  ImGuiInputTextFlags_CallbackCompletion = 131072 # 1 << 17 # Callback on pressing TAB (for completion handling)
@@ -373,6 +421,16 @@ ImGuiInputTextFlags_CallbackCharFilter = 1048576 # 1 << 20 # Callback on charact
373
421
  ImGuiInputTextFlags_CallbackResize = 2097152 # 1 << 21 # Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this)
374
422
  ImGuiInputTextFlags_CallbackEdit = 4194304 # 1 << 22 # Callback on any edit (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active)
375
423
 
424
+ # ImGuiItemFlags_
425
+ # Flags for ImGui::PushItemFlag()
426
+ # (Those are shared by all items)
427
+ ImGuiItemFlags_None = 0 # 0 # (Default)
428
+ ImGuiItemFlags_NoTabStop = 1 # 1 << 0 # false // Disable keyboard tabbing. This is a "lighter" version of ImGuiItemFlags_NoNav.
429
+ ImGuiItemFlags_NoNav = 2 # 1 << 1 # false // Disable any form of focusing (keyboard/gamepad directional navigation and SetKeyboardFocusHere() calls).
430
+ ImGuiItemFlags_NoNavDefaultFocus = 4 # 1 << 2 # false // Disable item being a candidate for default focus (e.g. used by title bar items).
431
+ ImGuiItemFlags_ButtonRepeat = 8 # 1 << 3 # false // Any button-like behavior will have repeat mode enabled (based on io.KeyRepeatDelay and io.KeyRepeatRate values). Note that you can also call IsItemActive() after any button to tell if it is being held.
432
+ ImGuiItemFlags_AutoClosePopups = 16 # 1 << 4 # true // MenuItem()/Selectable() automatically close their parent popup window.
433
+
376
434
  # ImGuiKey
377
435
  # A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value): can represent Keyboard, Mouse and Gamepad values.
378
436
  # All our named keys are >= 512. Keys value 0 to 511 are left unused as legacy native/opaque key values (< 1.87).
@@ -537,11 +595,11 @@ ImGuiKey_ReservedForModAlt = 664 # 664
537
595
  ImGuiKey_ReservedForModSuper = 665 # 665
538
596
  ImGuiKey_COUNT = 666 # 666
539
597
  ImGuiMod_None = 0 # 0
540
- ImGuiMod_Ctrl = 4096 # 1 << 12 # Ctrl
598
+ ImGuiMod_Ctrl = 4096 # 1 << 12 # Ctrl (non-macOS), Cmd (macOS)
541
599
  ImGuiMod_Shift = 8192 # 1 << 13 # Shift
542
600
  ImGuiMod_Alt = 16384 # 1 << 14 # Option/Menu
543
- ImGuiMod_Super = 32768 # 1 << 15 # Cmd/Super/Windows
544
- ImGuiMod_Mask_ = 61440 # 0xF000 # 5-bits
601
+ ImGuiMod_Super = 32768 # 1 << 15 # Windows/Super (non-macOS), Ctrl (macOS)
602
+ ImGuiMod_Mask_ = 61440 # 0xF000 # 4-bits
545
603
  ImGuiKey_NamedKey_BEGIN = 512 # 512
546
604
  ImGuiKey_NamedKey_END = 666 # ImGuiKey_COUNT
547
605
  ImGuiKey_NamedKey_COUNT = 154 # ImGuiKey_NamedKey_END - ImGuiKey_NamedKey_BEGIN
@@ -581,6 +639,26 @@ ImGuiMouseSource_TouchScreen = 1 # 1 # Input is coming from a touch screen (no h
581
639
  ImGuiMouseSource_Pen = 2 # 2 # Input is coming from a pressure/magnetic pen (often used in conjunction with high-sampling rates).
582
640
  ImGuiMouseSource_COUNT = 3 # 3
583
641
 
642
+ # ImGuiMultiSelectFlags_
643
+ # Flags for BeginMultiSelect()
644
+ ImGuiMultiSelectFlags_None = 0 # 0
645
+ ImGuiMultiSelectFlags_SingleSelect = 1 # 1 << 0 # Disable selecting more than one item. This is available to allow single-selection code to share same code/logic if desired. It essentially disables the main purpose of BeginMultiSelect() tho!
646
+ ImGuiMultiSelectFlags_NoSelectAll = 2 # 1 << 1 # Disable CTRL+A shortcut to select all.
647
+ ImGuiMultiSelectFlags_NoRangeSelect = 4 # 1 << 2 # Disable Shift+selection mouse/keyboard support (useful for unordered 2D selection). With BoxSelect is also ensure contiguous SetRange requests are not combined into one. This allows not handling interpolation in SetRange requests.
648
+ ImGuiMultiSelectFlags_NoAutoSelect = 8 # 1 << 3 # Disable selecting items when navigating (useful for e.g. supporting range-select in a list of checkboxes).
649
+ ImGuiMultiSelectFlags_NoAutoClear = 16 # 1 << 4 # Disable clearing selection when navigating or selecting another one (generally used with ImGuiMultiSelectFlags_NoAutoSelect. useful for e.g. supporting range-select in a list of checkboxes).
650
+ ImGuiMultiSelectFlags_NoAutoClearOnReselect = 32 # 1 << 5 # Disable clearing selection when clicking/selecting an already selected item.
651
+ ImGuiMultiSelectFlags_BoxSelect1d = 64 # 1 << 6 # Enable box-selection with same width and same x pos items (e.g. full row Selectable()). Box-selection works better with little bit of spacing between items hit-box in order to be able to aim at empty space.
652
+ ImGuiMultiSelectFlags_BoxSelect2d = 128 # 1 << 7 # Enable box-selection with varying width or varying x pos items support (e.g. different width labels, or 2D layout/grid). This is slower: alters clipping logic so that e.g. horizontal movements will update selection of normally clipped items.
653
+ ImGuiMultiSelectFlags_BoxSelectNoScroll = 256 # 1 << 8 # Disable scrolling when box-selecting near edges of scope.
654
+ ImGuiMultiSelectFlags_ClearOnEscape = 512 # 1 << 9 # Clear selection when pressing Escape while scope is focused.
655
+ ImGuiMultiSelectFlags_ClearOnClickVoid = 1024 # 1 << 10 # Clear selection when clicking on empty location within scope.
656
+ ImGuiMultiSelectFlags_ScopeWindow = 2048 # 1 << 11 # Scope for _BoxSelect and _ClearOnClickVoid is whole window (Default). Use if BeginMultiSelect() covers a whole window or used a single time in same window.
657
+ ImGuiMultiSelectFlags_ScopeRect = 4096 # 1 << 12 # Scope for _BoxSelect and _ClearOnClickVoid is rectangle encompassing BeginMultiSelect()/EndMultiSelect(). Use if BeginMultiSelect() is called multiple times in same window.
658
+ ImGuiMultiSelectFlags_SelectOnClick = 8192 # 1 << 13 # Apply selection on mouse down when clicking on unselected item. (Default)
659
+ ImGuiMultiSelectFlags_SelectOnClickRelease = 16384 # 1 << 14 # Apply selection on mouse release when clicking an unselected item. Allow dragging an unselected item without altering selection.
660
+ ImGuiMultiSelectFlags_NavWrapX = 65536 # 1 << 16 # [Temporary] Enable navigation wrapping on X axis. Provided as a convenience because we don't have a design for the general Nav API for this yet. When the more general feature be public we may obsolete this flag in favor of new one.
661
+
584
662
  # ImGuiPopupFlags_
585
663
  # Flags for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() functions.
586
664
  # - To be backward compatible with older API which took an 'int mouse_button = 1' argument instead of 'ImGuiPopupFlags flags',
@@ -605,12 +683,19 @@ ImGuiPopupFlags_AnyPopup = 3072 # ImGuiPopupFlags_AnyPopupId | ImG
605
683
 
606
684
  # ImGuiSelectableFlags_
607
685
  # Flags for ImGui::Selectable()
608
- ImGuiSelectableFlags_None = 0 # 0
609
- ImGuiSelectableFlags_DontClosePopups = 1 # 1 << 0 # Clicking this doesn't close parent popup window
610
- ImGuiSelectableFlags_SpanAllColumns = 2 # 1 << 1 # Frame will span all columns of its container table (text will still fit in current column)
611
- ImGuiSelectableFlags_AllowDoubleClick = 4 # 1 << 2 # Generate press events on double clicks too
612
- ImGuiSelectableFlags_Disabled = 8 # 1 << 3 # Cannot be selected, display grayed out text
613
- ImGuiSelectableFlags_AllowOverlap = 16 # 1 << 4 # (WIP) Hit testing to allow subsequent widgets to overlap this one
686
+ ImGuiSelectableFlags_None = 0 # 0
687
+ ImGuiSelectableFlags_NoAutoClosePopups = 1 # 1 << 0 # Clicking this doesn't close parent popup window (overrides ImGuiItemFlags_AutoClosePopups)
688
+ ImGuiSelectableFlags_SpanAllColumns = 2 # 1 << 1 # Frame will span all columns of its container table (text will still fit in current column)
689
+ ImGuiSelectableFlags_AllowDoubleClick = 4 # 1 << 2 # Generate press events on double clicks too
690
+ ImGuiSelectableFlags_Disabled = 8 # 1 << 3 # Cannot be selected, display grayed out text
691
+ ImGuiSelectableFlags_AllowOverlap = 16 # 1 << 4 # (WIP) Hit testing to allow subsequent widgets to overlap this one
692
+ ImGuiSelectableFlags_Highlight = 32 # 1 << 5 # Make the item be displayed as if it is hovered
693
+
694
+ # ImGuiSelectionRequestType
695
+ # Selection request type
696
+ ImGuiSelectionRequestType_None = 0 # 0
697
+ ImGuiSelectionRequestType_SetAll = 1 # 1 # Request app to clear selection (if Selected==false) or select all items (if Selected==true). We cannot set RangeFirstItem/RangeLastItem as its contents is entirely up to user (not necessarily an index)
698
+ ImGuiSelectionRequestType_SetRange = 2 # 2 # Request app to select/unselect [RangeFirstItem..RangeLastItem] items (inclusive) based on value of Selected. Only EndMultiSelect() request this, app code can read after BeginMultiSelect() and it will always be false.
614
699
 
615
700
  # ImGuiSliderFlags_
616
701
  # Flags for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc.
@@ -619,15 +704,16 @@ ImGuiSelectableFlags_AllowOverlap = 16 # 1 << 4 # (WIP) Hit testing to allow
619
704
  ImGuiSliderFlags_None = 0 # 0
620
705
  ImGuiSliderFlags_AlwaysClamp = 16 # 1 << 4 # Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.
621
706
  ImGuiSliderFlags_Logarithmic = 32 # 1 << 5 # Make the widget logarithmic (linear otherwise). Consider using ImGuiSliderFlags_NoRoundToFormat with this if using a format-string with small amount of digits.
622
- ImGuiSliderFlags_NoRoundToFormat = 64 # 1 << 6 # Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits)
623
- ImGuiSliderFlags_NoInput = 128 # 1 << 7 # Disable CTRL+Click or Enter key allowing to input text directly into the widget
624
- ImGuiSliderFlags_WrapAround = 256 # 1 << 8
707
+ ImGuiSliderFlags_NoRoundToFormat = 64 # 1 << 6 # Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits).
708
+ ImGuiSliderFlags_NoInput = 128 # 1 << 7 # Disable CTRL+Click or Enter key allowing to input text directly into the widget.
709
+ ImGuiSliderFlags_WrapAround = 256 # 1 << 8 # Enable wrapping around from max to min and from min to max (only supported by DragXXX() functions for now.
625
710
  ImGuiSliderFlags_InvalidMask_ = 1879048207 # 0x7000000F # [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed.
626
711
 
627
712
  # ImGuiSortDirection
713
+ # A sorting direction
628
714
  ImGuiSortDirection_None = 0 # 0
629
- ImGuiSortDirection_Ascending = 1 # 1
630
- ImGuiSortDirection_Descending = 2 # 2
715
+ ImGuiSortDirection_Ascending = 1 # 1 # Ascending = 0->9, A->Z etc.
716
+ ImGuiSortDirection_Descending = 2 # 2 # Descending = 9->0, Z->A etc.
631
717
 
632
718
  # ImGuiStyleVar_
633
719
  # Enumeration for PushStyleVar() / PopStyleVar() to temporarily modify the ImGuiStyle structure.
@@ -663,14 +749,15 @@ ImGuiStyleVar_GrabRounding = 21 # 21 # float GrabRounding
663
749
  ImGuiStyleVar_TabRounding = 22 # 22 # float TabRounding
664
750
  ImGuiStyleVar_TabBorderSize = 23 # 23 # float TabBorderSize
665
751
  ImGuiStyleVar_TabBarBorderSize = 24 # 24 # float TabBarBorderSize
666
- ImGuiStyleVar_TableAngledHeadersAngle = 25 # 25 # float TableAngledHeadersAngle
667
- ImGuiStyleVar_TableAngledHeadersTextAlign = 26 # 26
668
- ImGuiStyleVar_ButtonTextAlign = 27 # 27 # ImVec2 ButtonTextAlign
669
- ImGuiStyleVar_SelectableTextAlign = 28 # 28 # ImVec2 SelectableTextAlign
670
- ImGuiStyleVar_SeparatorTextBorderSize = 29 # 29 # float SeparatorTextBorderSize
671
- ImGuiStyleVar_SeparatorTextAlign = 30 # 30 # ImVec2 SeparatorTextAlign
672
- ImGuiStyleVar_SeparatorTextPadding = 31 # 31 # ImVec2 SeparatorTextPadding
673
- ImGuiStyleVar_COUNT = 32 # 32
752
+ ImGuiStyleVar_TabBarOverlineSize = 25 # 25 # float TabBarOverlineSize
753
+ ImGuiStyleVar_TableAngledHeadersAngle = 26 # 26 # float TableAngledHeadersAngle
754
+ ImGuiStyleVar_TableAngledHeadersTextAlign = 27 # 27 # ImVec2 TableAngledHeadersTextAlign
755
+ ImGuiStyleVar_ButtonTextAlign = 28 # 28 # ImVec2 ButtonTextAlign
756
+ ImGuiStyleVar_SelectableTextAlign = 29 # 29 # ImVec2 SelectableTextAlign
757
+ ImGuiStyleVar_SeparatorTextBorderSize = 30 # 30 # float SeparatorTextBorderSize
758
+ ImGuiStyleVar_SeparatorTextAlign = 31 # 31 # ImVec2 SeparatorTextAlign
759
+ ImGuiStyleVar_SeparatorTextPadding = 32 # 32 # ImVec2 SeparatorTextPadding
760
+ ImGuiStyleVar_COUNT = 33 # 33
674
761
 
675
762
  # ImGuiTabBarFlags_
676
763
  # Flags for ImGui::BeginTabBar()
@@ -681,7 +768,7 @@ ImGuiTabBarFlags_TabListPopupButton = 4 # 1 << 2 # Disable buttons to
681
768
  ImGuiTabBarFlags_NoCloseWithMiddleMouseButton = 8 # 1 << 3 # Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You may handle this behavior manually on user's side with if (IsItemHovered() && IsMouseClicked(2)) *p_open = false.
682
769
  ImGuiTabBarFlags_NoTabListScrollingButtons = 16 # 1 << 4 # Disable scrolling buttons (apply when fitting policy is ImGuiTabBarFlags_FittingPolicyScroll)
683
770
  ImGuiTabBarFlags_NoTooltip = 32 # 1 << 5 # Disable tooltips when hovering a tab
684
- ImGuiTabBarFlags_DrawSelectedOverline = 64 # 1 << 6
771
+ ImGuiTabBarFlags_DrawSelectedOverline = 64 # 1 << 6 # Draw selected overline markers over selected tab
685
772
  ImGuiTabBarFlags_FittingPolicyResizeDown = 128 # 1 << 7 # Resize tabs when they don't fit
686
773
  ImGuiTabBarFlags_FittingPolicyScroll = 256 # 1 << 8 # Add scroll buttons when tabs don't fit
687
774
  ImGuiTabBarFlags_FittingPolicyMask_ = 384 # ImGuiTabBarFlags_FittingPolicyResizeDown | ImGuiTabBarFlags_FittingPolicyScroll
@@ -825,10 +912,10 @@ ImGuiTreeNodeFlags_OpenOnDoubleClick = 64 # 1 << 6 # Need double-click to
825
912
  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.
826
913
  ImGuiTreeNodeFlags_Leaf = 256 # 1 << 8 # No collapsing, no arrow (use as a convenience for leaf nodes).
827
914
  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!
828
- 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().
829
- 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.
830
- ImGuiTreeNodeFlags_SpanFullWidth = 4096 # 1 << 12 # Extend hit box to the left-most and right-most edges (bypass the indented area).
831
- ImGuiTreeNodeFlags_SpanTextWidth = 8192 # 1 << 13
915
+ 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() before the node.
916
+ 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 without using AllowOverlap mode.
917
+ ImGuiTreeNodeFlags_SpanFullWidth = 4096 # 1 << 12 # Extend hit box to the left-most and right-most edges (cover the indent area).
918
+ ImGuiTreeNodeFlags_SpanTextWidth = 8192 # 1 << 13 # Narrow hit box + narrow hovering highlight, will only cover the label text.
832
919
  ImGuiTreeNodeFlags_SpanAllColumns = 16384 # 1 << 14 # Frame will span all columns of its container table (text will still fit in current column)
833
920
  ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 32768 # 1 << 15 # (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop)
834
921
  ImGuiTreeNodeFlags_CollapsingHeader = 26 # ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog
@@ -1515,6 +1602,81 @@ class ImGuiViewport < FFI::Struct
1515
1602
 
1516
1603
  end
1517
1604
 
1605
+ # Helper: Key->Value storage
1606
+ # Typically you don't have to worry about this since a storage is held within each Window.
1607
+ # We use it to e.g. store collapse state for a tree (Int 0/1)
1608
+ # This is optimized for efficient lookup (dichotomy into a contiguous buffer) and rare insertion (typically tied to user interactions aka max once a frame)
1609
+ # You can use it as custom user storage for temporary values. Declare your own storage if, for example:
1610
+ # - 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).
1611
+ # - You want to store custom debug data easily without adding or editing structures in your code (probably not efficient, but convenient)
1612
+ # Types are NOT stored, so it is up to you to make sure your Key don't collide with different types.
1613
+ class ImGuiStorage < FFI::Struct
1614
+ layout(
1615
+ :Data, ImVector.by_value
1616
+ )
1617
+
1618
+ def BuildSortByKey()
1619
+ ImGui::ImGuiStorage_BuildSortByKey(self)
1620
+ end
1621
+
1622
+ def Clear()
1623
+ ImGui::ImGuiStorage_Clear(self)
1624
+ end
1625
+
1626
+ def GetBool(key, default_val = false)
1627
+ ImGui::ImGuiStorage_GetBool(self, key, default_val)
1628
+ end
1629
+
1630
+ def GetBoolRef(key, default_val = false)
1631
+ ImGui::ImGuiStorage_GetBoolRef(self, key, default_val)
1632
+ end
1633
+
1634
+ def GetFloat(key, default_val = 0.0)
1635
+ ImGui::ImGuiStorage_GetFloat(self, key, default_val)
1636
+ end
1637
+
1638
+ def GetFloatRef(key, default_val = 0.0)
1639
+ ImGui::ImGuiStorage_GetFloatRef(self, key, default_val)
1640
+ end
1641
+
1642
+ def GetInt(key, default_val = 0)
1643
+ ImGui::ImGuiStorage_GetInt(self, key, default_val)
1644
+ end
1645
+
1646
+ def GetIntRef(key, default_val = 0)
1647
+ ImGui::ImGuiStorage_GetIntRef(self, key, default_val)
1648
+ end
1649
+
1650
+ def GetVoidPtr(key)
1651
+ ImGui::ImGuiStorage_GetVoidPtr(self, key)
1652
+ end
1653
+
1654
+ def GetVoidPtrRef(key, default_val = nil)
1655
+ ImGui::ImGuiStorage_GetVoidPtrRef(self, key, default_val)
1656
+ end
1657
+
1658
+ def SetAllInt(val)
1659
+ ImGui::ImGuiStorage_SetAllInt(self, val)
1660
+ end
1661
+
1662
+ def SetBool(key, val)
1663
+ ImGui::ImGuiStorage_SetBool(self, key, val)
1664
+ end
1665
+
1666
+ def SetFloat(key, val)
1667
+ ImGui::ImGuiStorage_SetFloat(self, key, val)
1668
+ end
1669
+
1670
+ def SetInt(key, val)
1671
+ ImGui::ImGuiStorage_SetInt(self, key, val)
1672
+ end
1673
+
1674
+ def SetVoidPtr(key, val)
1675
+ ImGui::ImGuiStorage_SetVoidPtr(self, key, val)
1676
+ end
1677
+
1678
+ end
1679
+
1518
1680
  # Helper: ImColor() implicitly converts colors to either ImU32 (packed 4x1 byte) or ImVec4 (4x1 float)
1519
1681
  # Prefer using IM_COL32() macros if you want a guaranteed compile-time ImU32 for usage with ImDrawList API.
1520
1682
  # **Avoid storing ImColor! Store either u32 of ImVec4. This is not a full-featured color class. MAY OBSOLETE.
@@ -1811,6 +1973,7 @@ class ImGuiIO < FFI::Struct
1811
1973
  :DisplayFramebufferScale, ImVec2.by_value,
1812
1974
  :MouseDrawCursor, :bool,
1813
1975
  :ConfigMacOSXBehaviors, :bool,
1976
+ :ConfigNavSwapGamepadButtons, :bool,
1814
1977
  :ConfigInputTrickleEventQueue, :bool,
1815
1978
  :ConfigInputTextCursorBlink, :bool,
1816
1979
  :ConfigInputTextEnterKeepActive, :bool,
@@ -2044,6 +2207,7 @@ class ImGuiListClipper < FFI::Struct
2044
2207
  :ItemsCount, :int,
2045
2208
  :ItemsHeight, :float,
2046
2209
  :StartPosY, :float,
2210
+ :StartSeekOffsetY, :double,
2047
2211
  :TempData, :pointer
2048
2212
  )
2049
2213
 
@@ -2067,6 +2231,10 @@ class ImGuiListClipper < FFI::Struct
2067
2231
  ImGui::ImGuiListClipper_IncludeItemsByIndex(self, item_begin, item_end)
2068
2232
  end
2069
2233
 
2234
+ def SeekCursorForItem(item_index)
2235
+ ImGui::ImGuiListClipper_SeekCursorForItem(self, item_index)
2236
+ end
2237
+
2070
2238
  def Step()
2071
2239
  ImGui::ImGuiListClipper_Step(self)
2072
2240
  end
@@ -2077,6 +2245,22 @@ class ImGuiListClipper < FFI::Struct
2077
2245
 
2078
2246
  end
2079
2247
 
2248
+ # Main IO structure returned by BeginMultiSelect()/EndMultiSelect().
2249
+ # This mainly contains a list of selection requests.
2250
+ # - Use 'Demo->Tools->Debug Log->Selection' to see requests as they happen.
2251
+ # - Some fields are only useful if your list is dynamic and allows deletion (getting post-deletion focus/state right is shown in the demo)
2252
+ # - Below: who reads/writes each fields? 'r'=read, 'w'=write, 'ms'=multi-select code, 'app'=application/user code.
2253
+ class ImGuiMultiSelectIO < FFI::Struct
2254
+ layout(
2255
+ :Requests, ImVector.by_value,
2256
+ :RangeSrcItem, :int64,
2257
+ :NavIdItem, :int64,
2258
+ :NavIdSelected, :bool,
2259
+ :RangeSrcReset, :bool,
2260
+ :ItemsCount, :int
2261
+ )
2262
+ end
2263
+
2080
2264
  # Data payload for Drag and Drop operations: AcceptDragDropPayload(), GetDragDropPayload()
2081
2265
  class ImGuiPayload < FFI::Struct
2082
2266
  layout(
@@ -2116,7 +2300,7 @@ class ImGuiPayload < FFI::Struct
2116
2300
 
2117
2301
  end
2118
2302
 
2119
- # (Optional) Support for IME (Input Method Editor) via the io.SetPlatformImeDataFn() function.
2303
+ # (Optional) Support for IME (Input Method Editor) via the io.PlatformSetImeDataFn() function.
2120
2304
  class ImGuiPlatformImeData < FFI::Struct
2121
2305
  layout(
2122
2306
  :WantVisible, :bool,
@@ -2134,90 +2318,112 @@ class ImGuiPlatformImeData < FFI::Struct
2134
2318
 
2135
2319
  end
2136
2320
 
2137
- # Resizing callback data to apply custom constraint. As enabled by SetNextWindowSizeConstraints(). Callback is called during the next Begin().
2138
- # NB: For basic min/max size constraint on each axis you don't need to use the callback! The SetNextWindowSizeConstraints() parameters are enough.
2139
- class ImGuiSizeCallbackData < FFI::Struct
2321
+ # Optional helper to store multi-selection state + apply multi-selection requests.
2322
+ # - Used by our demos and provided as a convenience to easily implement basic multi-selection.
2323
+ # - Iterate selection with 'void* it = NULL; ImGuiID id; while (selection.GetNextSelectedItem(&it, &id)) { ... }'
2324
+ # Or you can check 'if (Contains(id)) { ... }' for each possible object if their number is not too high to iterate.
2325
+ # - USING THIS IS NOT MANDATORY. This is only a helper and not a required API.
2326
+ # To store a multi-selection, in your application you could:
2327
+ # - Use this helper as a convenience. We use our simple key->value ImGuiStorage as a std::set<ImGuiID> replacement.
2328
+ # - Use your own external storage: e.g. std::set<MyObjectId>, std::vector<MyObjectId>, interval trees, intrusively stored selection etc.
2329
+ # In ImGuiSelectionBasicStorage we:
2330
+ # - always use indices in the multi-selection API (passed to SetNextItemSelectionUserData(), retrieved in ImGuiMultiSelectIO)
2331
+ # - use the AdapterIndexToStorageId() indirection layer to abstract how persistent selection data is derived from an index.
2332
+ # - use decently optimized logic to allow queries and insertion of very large selection sets.
2333
+ # - do not preserve selection order.
2334
+ # Many combinations are possible depending on how you prefer to store your items and how you prefer to store your selection.
2335
+ # Large applications are likely to eventually want to get rid of this indirection layer and do their own thing.
2336
+ # See https://github.com/ocornut/imgui/wiki/Multi-Select for details and pseudo-code using this helper.
2337
+ class ImGuiSelectionBasicStorage < FFI::Struct
2140
2338
  layout(
2339
+ :Size, :int,
2340
+ :PreserveOrder, :bool,
2141
2341
  :UserData, :pointer,
2142
- :Pos, ImVec2.by_value,
2143
- :CurrentSize, ImVec2.by_value,
2144
- :DesiredSize, ImVec2.by_value
2342
+ :AdapterIndexToStorageId, :pointer,
2343
+ :_SelectionOrder, :int,
2344
+ :_Storage, ImGuiStorage.by_value
2145
2345
  )
2146
- end
2147
2346
 
2148
- # Helper: Key->Value storage
2149
- # Typically you don't have to worry about this since a storage is held within each Window.
2150
- # We use it to e.g. store collapse state for a tree (Int 0/1)
2151
- # This is optimized for efficient lookup (dichotomy into a contiguous buffer) and rare insertion (typically tied to user interactions aka max once a frame)
2152
- # You can use it as custom user storage for temporary values. Declare your own storage if, for example:
2153
- # - 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).
2154
- # - You want to store custom debug data easily without adding or editing structures in your code (probably not efficient, but convenient)
2155
- # Types are NOT stored, so it is up to you to make sure your Key don't collide with different types.
2156
- class ImGuiStorage < FFI::Struct
2157
- layout(
2158
- :Data, ImVector.by_value
2159
- )
2160
-
2161
- def BuildSortByKey()
2162
- ImGui::ImGuiStorage_BuildSortByKey(self)
2347
+ def ApplyRequests(ms_io)
2348
+ ImGui::ImGuiSelectionBasicStorage_ApplyRequests(self, ms_io)
2163
2349
  end
2164
2350
 
2165
2351
  def Clear()
2166
- ImGui::ImGuiStorage_Clear(self)
2352
+ ImGui::ImGuiSelectionBasicStorage_Clear(self)
2167
2353
  end
2168
2354
 
2169
- def GetBool(key, default_val = false)
2170
- ImGui::ImGuiStorage_GetBool(self, key, default_val)
2355
+ def Contains(id)
2356
+ ImGui::ImGuiSelectionBasicStorage_Contains(self, id)
2171
2357
  end
2172
2358
 
2173
- def GetBoolRef(key, default_val = false)
2174
- ImGui::ImGuiStorage_GetBoolRef(self, key, default_val)
2359
+ def GetNextSelectedItem(opaque_it, out_id)
2360
+ ImGui::ImGuiSelectionBasicStorage_GetNextSelectedItem(self, opaque_it, out_id)
2175
2361
  end
2176
2362
 
2177
- def GetFloat(key, default_val = 0.0)
2178
- ImGui::ImGuiStorage_GetFloat(self, key, default_val)
2363
+ def GetStorageIdFromIndex(idx)
2364
+ ImGui::ImGuiSelectionBasicStorage_GetStorageIdFromIndex(self, idx)
2179
2365
  end
2180
2366
 
2181
- def GetFloatRef(key, default_val = 0.0)
2182
- ImGui::ImGuiStorage_GetFloatRef(self, key, default_val)
2367
+ def self.create()
2368
+ return ImGuiSelectionBasicStorage.new(ImGui::ImGuiSelectionBasicStorage_ImGuiSelectionBasicStorage())
2183
2369
  end
2184
2370
 
2185
- def GetInt(key, default_val = 0)
2186
- ImGui::ImGuiStorage_GetInt(self, key, default_val)
2371
+ def SetItemSelected(id, selected)
2372
+ ImGui::ImGuiSelectionBasicStorage_SetItemSelected(self, id, selected)
2187
2373
  end
2188
2374
 
2189
- def GetIntRef(key, default_val = 0)
2190
- ImGui::ImGuiStorage_GetIntRef(self, key, default_val)
2375
+ def Swap(r)
2376
+ ImGui::ImGuiSelectionBasicStorage_Swap(self, r)
2191
2377
  end
2192
2378
 
2193
- def GetVoidPtr(key)
2194
- ImGui::ImGuiStorage_GetVoidPtr(self, key)
2379
+ def destroy()
2380
+ ImGui::ImGuiSelectionBasicStorage_destroy(self)
2195
2381
  end
2196
2382
 
2197
- def GetVoidPtrRef(key, default_val = nil)
2198
- ImGui::ImGuiStorage_GetVoidPtrRef(self, key, default_val)
2199
- end
2383
+ end
2200
2384
 
2201
- def SetAllInt(val)
2202
- ImGui::ImGuiStorage_SetAllInt(self, val)
2203
- end
2385
+ # Optional helper to apply multi-selection requests to existing randomly accessible storage.
2386
+ # Convenient if you want to quickly wire multi-select API on e.g. an array of bool or items storing their own selection state.
2387
+ class ImGuiSelectionExternalStorage < FFI::Struct
2388
+ layout(
2389
+ :UserData, :pointer,
2390
+ :AdapterSetItemSelected, :pointer
2391
+ )
2204
2392
 
2205
- def SetBool(key, val)
2206
- ImGui::ImGuiStorage_SetBool(self, key, val)
2393
+ def ApplyRequests(ms_io)
2394
+ ImGui::ImGuiSelectionExternalStorage_ApplyRequests(self, ms_io)
2207
2395
  end
2208
2396
 
2209
- def SetFloat(key, val)
2210
- ImGui::ImGuiStorage_SetFloat(self, key, val)
2397
+ def self.create()
2398
+ return ImGuiSelectionExternalStorage.new(ImGui::ImGuiSelectionExternalStorage_ImGuiSelectionExternalStorage())
2211
2399
  end
2212
2400
 
2213
- def SetInt(key, val)
2214
- ImGui::ImGuiStorage_SetInt(self, key, val)
2401
+ def destroy()
2402
+ ImGui::ImGuiSelectionExternalStorage_destroy(self)
2215
2403
  end
2216
2404
 
2217
- def SetVoidPtr(key, val)
2218
- ImGui::ImGuiStorage_SetVoidPtr(self, key, val)
2219
- end
2405
+ end
2220
2406
 
2407
+ # Selection request item
2408
+ class ImGuiSelectionRequest < FFI::Struct
2409
+ layout(
2410
+ :Type, :ImGuiSelectionRequestType,
2411
+ :Selected, :bool,
2412
+ :RangeDirection, :char,
2413
+ :RangeFirstItem, :int64,
2414
+ :RangeLastItem, :int64
2415
+ )
2416
+ end
2417
+
2418
+ # Resizing callback data to apply custom constraint. As enabled by SetNextWindowSizeConstraints(). Callback is called during the next Begin().
2419
+ # NB: For basic min/max size constraint on each axis you don't need to use the callback! The SetNextWindowSizeConstraints() parameters are enough.
2420
+ class ImGuiSizeCallbackData < FFI::Struct
2421
+ layout(
2422
+ :UserData, :pointer,
2423
+ :Pos, ImVec2.by_value,
2424
+ :CurrentSize, ImVec2.by_value,
2425
+ :DesiredSize, ImVec2.by_value
2426
+ )
2221
2427
  end
2222
2428
 
2223
2429
  class ImGuiStyle < FFI::Struct
@@ -2252,6 +2458,7 @@ class ImGuiStyle < FFI::Struct
2252
2458
  :TabBorderSize, :float,
2253
2459
  :TabMinWidthForCloseButton, :float,
2254
2460
  :TabBarBorderSize, :float,
2461
+ :TabBarOverlineSize, :float,
2255
2462
  :TableAngledHeadersAngle, :float,
2256
2463
  :TableAngledHeadersTextAlign, ImVec2.by_value,
2257
2464
  :ColorButtonPosition, :int,
@@ -2449,6 +2656,7 @@ class ImGuiTextRange < FFI::Struct
2449
2656
 
2450
2657
  end
2451
2658
 
2659
+ # [Internal] Key+Value for ImGuiStorage
2452
2660
  class ImGuiStoragePair < FFI::Struct
2453
2661
  layout(
2454
2662
  :key, :uint,
@@ -2699,6 +2907,7 @@ module ImGui
2699
2907
  [:ImGuiListClipper_ImGuiListClipper, [], :pointer],
2700
2908
  [:ImGuiListClipper_IncludeItemByIndex, [:pointer, :int], :void],
2701
2909
  [:ImGuiListClipper_IncludeItemsByIndex, [:pointer, :int, :int], :void],
2910
+ [:ImGuiListClipper_SeekCursorForItem, [:pointer, :int], :void],
2702
2911
  [:ImGuiListClipper_Step, [:pointer], :bool],
2703
2912
  [:ImGuiListClipper_destroy, [:pointer], :void],
2704
2913
  [:ImGuiOnceUponAFrame_ImGuiOnceUponAFrame, [], :pointer],
@@ -2711,6 +2920,18 @@ module ImGui
2711
2920
  [:ImGuiPayload_destroy, [:pointer], :void],
2712
2921
  [:ImGuiPlatformImeData_ImGuiPlatformImeData, [], :pointer],
2713
2922
  [:ImGuiPlatformImeData_destroy, [:pointer], :void],
2923
+ [:ImGuiSelectionBasicStorage_ApplyRequests, [:pointer, :pointer], :void],
2924
+ [:ImGuiSelectionBasicStorage_Clear, [:pointer], :void],
2925
+ [:ImGuiSelectionBasicStorage_Contains, [:pointer, :uint], :bool],
2926
+ [:ImGuiSelectionBasicStorage_GetNextSelectedItem, [:pointer, :pointer, :pointer], :bool],
2927
+ [:ImGuiSelectionBasicStorage_GetStorageIdFromIndex, [:pointer, :int], :uint],
2928
+ [:ImGuiSelectionBasicStorage_ImGuiSelectionBasicStorage, [], :pointer],
2929
+ [:ImGuiSelectionBasicStorage_SetItemSelected, [:pointer, :uint, :bool], :void],
2930
+ [:ImGuiSelectionBasicStorage_Swap, [:pointer, :pointer], :void],
2931
+ [:ImGuiSelectionBasicStorage_destroy, [:pointer], :void],
2932
+ [:ImGuiSelectionExternalStorage_ApplyRequests, [:pointer, :pointer], :void],
2933
+ [:ImGuiSelectionExternalStorage_ImGuiSelectionExternalStorage, [], :pointer],
2934
+ [:ImGuiSelectionExternalStorage_destroy, [:pointer], :void],
2714
2935
  [:ImGuiStoragePair_ImGuiStoragePair_Int, [:uint, :int], :pointer],
2715
2936
  [:ImGuiStoragePair_ImGuiStoragePair_Float, [:uint, :float], :pointer],
2716
2937
  [:ImGuiStoragePair_ImGuiStoragePair_Ptr, [:uint, :pointer], :pointer],
@@ -2780,6 +3001,7 @@ module ImGui
2780
3001
  [:igBeginMainMenuBar, [], :bool],
2781
3002
  [:igBeginMenu, [:pointer, :bool], :bool],
2782
3003
  [:igBeginMenuBar, [], :bool],
3004
+ [:igBeginMultiSelect, [:int, :int, :int], :pointer],
2783
3005
  [:igBeginPopup, [:pointer, :int], :bool],
2784
3006
  [:igBeginPopupContextItem, [:pointer, :int], :bool],
2785
3007
  [:igBeginPopupContextVoid, [:pointer, :int], :bool],
@@ -2845,6 +3067,7 @@ module ImGui
2845
3067
  [:igEndMainMenuBar, [], :void],
2846
3068
  [:igEndMenu, [], :void],
2847
3069
  [:igEndMenuBar, [], :void],
3070
+ [:igEndMultiSelect, [], :pointer],
2848
3071
  [:igEndPopup, [], :void],
2849
3072
  [:igEndTabBar, [], :void],
2850
3073
  [:igEndTabItem, [], :void],
@@ -2861,7 +3084,6 @@ module ImGui
2861
3084
  [:igGetColumnWidth, [:int], :float],
2862
3085
  [:igGetColumnsCount, [], :int],
2863
3086
  [:igGetContentRegionAvail, [:pointer], :void],
2864
- [:igGetContentRegionMax, [:pointer], :void],
2865
3087
  [:igGetCurrentContext, [], :pointer],
2866
3088
  [:igGetCursorPos, [:pointer], :void],
2867
3089
  [:igGetCursorPosX, [], :float],
@@ -2881,6 +3103,7 @@ module ImGui
2881
3103
  [:igGetID_Str, [:pointer], :uint],
2882
3104
  [:igGetID_StrStr, [:pointer, :pointer], :uint],
2883
3105
  [:igGetID_Ptr, [:pointer], :uint],
3106
+ [:igGetID_Int, [:int], :uint],
2884
3107
  [:igGetIO, [], :pointer],
2885
3108
  [:igGetItemID, [], :uint],
2886
3109
  [:igGetItemRectMax, [:pointer], :void],
@@ -2907,8 +3130,6 @@ module ImGui
2907
3130
  [:igGetTime, [], :double],
2908
3131
  [:igGetTreeNodeToLabelSpacing, [], :float],
2909
3132
  [:igGetVersion, [], :pointer],
2910
- [:igGetWindowContentRegionMax, [:pointer], :void],
2911
- [:igGetWindowContentRegionMin, [:pointer], :void],
2912
3133
  [:igGetWindowDrawList, [], :pointer],
2913
3134
  [:igGetWindowHeight, [], :float],
2914
3135
  [:igGetWindowPos, [:pointer], :void],
@@ -2945,6 +3166,7 @@ module ImGui
2945
3166
  [:igIsItemFocused, [], :bool],
2946
3167
  [:igIsItemHovered, [:int], :bool],
2947
3168
  [:igIsItemToggledOpen, [], :bool],
3169
+ [:igIsItemToggledSelection, [], :bool],
2948
3170
  [:igIsItemVisible, [], :bool],
2949
3171
  [:igIsKeyChordPressed, [:int], :bool],
2950
3172
  [:igIsKeyDown, [:int], :bool],
@@ -2989,29 +3211,27 @@ module ImGui
2989
3211
  [:igPlotHistogram_FnFloatPtr, [:pointer, :pointer, :pointer, :int, :int, :pointer, :float, :float, ImVec2.by_value], :void],
2990
3212
  [:igPlotLines_FloatPtr, [:pointer, :pointer, :int, :int, :pointer, :float, :float, ImVec2.by_value, :int], :void],
2991
3213
  [:igPlotLines_FnFloatPtr, [:pointer, :pointer, :pointer, :int, :int, :pointer, :float, :float, ImVec2.by_value], :void],
2992
- [:igPopButtonRepeat, [], :void],
2993
3214
  [:igPopClipRect, [], :void],
2994
3215
  [:igPopFont, [], :void],
2995
3216
  [:igPopID, [], :void],
3217
+ [:igPopItemFlag, [], :void],
2996
3218
  [:igPopItemWidth, [], :void],
2997
3219
  [:igPopStyleColor, [:int], :void],
2998
3220
  [:igPopStyleVar, [:int], :void],
2999
- [:igPopTabStop, [], :void],
3000
3221
  [:igPopTextWrapPos, [], :void],
3001
3222
  [:igProgressBar, [:float, ImVec2.by_value, :pointer], :void],
3002
- [:igPushButtonRepeat, [:bool], :void],
3003
3223
  [:igPushClipRect, [ImVec2.by_value, ImVec2.by_value, :bool], :void],
3004
3224
  [:igPushFont, [:pointer], :void],
3005
3225
  [:igPushID_Str, [:pointer], :void],
3006
3226
  [:igPushID_StrStr, [:pointer, :pointer], :void],
3007
3227
  [:igPushID_Ptr, [:pointer], :void],
3008
3228
  [:igPushID_Int, [:int], :void],
3229
+ [:igPushItemFlag, [:int, :bool], :void],
3009
3230
  [:igPushItemWidth, [:float], :void],
3010
3231
  [:igPushStyleColor_U32, [:int, :uint], :void],
3011
3232
  [:igPushStyleColor_Vec4, [:int, ImVec4.by_value], :void],
3012
3233
  [:igPushStyleVar_Float, [:int, :float], :void],
3013
3234
  [:igPushStyleVar_Vec2, [:int, ImVec2.by_value], :void],
3014
- [:igPushTabStop, [:bool], :void],
3015
3235
  [:igPushTextWrapPos, [:float], :void],
3016
3236
  [:igRadioButton_Bool, [:pointer, :bool], :bool],
3017
3237
  [:igRadioButton_IntPtr, [:pointer, :pointer, :int], :bool],
@@ -3036,6 +3256,7 @@ module ImGui
3036
3256
  [:igSetCursorScreenPos, [ImVec2.by_value], :void],
3037
3257
  [:igSetDragDropPayload, [:pointer, :pointer, :size_t, :int], :bool],
3038
3258
  [:igSetItemDefaultFocus, [], :void],
3259
+ [:igSetItemKeyOwner, [:int], :void],
3039
3260
  [:igSetItemTooltip, [:pointer, :varargs], :void],
3040
3261
  [:igSetKeyboardFocusHere, [:int], :void],
3041
3262
  [:igSetMouseCursor, [:int], :void],
@@ -3043,7 +3264,9 @@ module ImGui
3043
3264
  [:igSetNextFrameWantCaptureMouse, [:bool], :void],
3044
3265
  [:igSetNextItemAllowOverlap, [], :void],
3045
3266
  [:igSetNextItemOpen, [:bool, :int], :void],
3267
+ [:igSetNextItemSelectionUserData, [:int64], :void],
3046
3268
  [:igSetNextItemShortcut, [:int, :int], :void],
3269
+ [:igSetNextItemStorageID, [:uint], :void],
3047
3270
  [:igSetNextItemWidth, [:float], :void],
3048
3271
  [:igSetNextWindowBgAlpha, [:float], :void],
3049
3272
  [:igSetNextWindowCollapsed, [:bool, :int], :void],
@@ -3218,6 +3441,7 @@ module ImGui
3218
3441
  # Disabling [BETA API]
3219
3442
  # - Disable all user interactions and dim items visuals (applying style.DisabledAlpha over current colors)
3220
3443
  # - Those can be nested but it cannot be used to enable an already disabled section (a single BeginDisabled(true) in the stack is enough to keep everything disabled)
3444
+ # - Tooltips windows by exception are opted out of disabling.
3221
3445
  # - BeginDisabled(false) essentially does nothing useful but is provided to facilitate use of boolean expressions. If you can avoid calling BeginDisabled(False)/EndDisabled() best to avoid it.
3222
3446
  def self.BeginDisabled(disabled = true)
3223
3447
  igBeginDisabled(disabled)
@@ -3290,6 +3514,20 @@ module ImGui
3290
3514
  igBeginMenuBar()
3291
3515
  end
3292
3516
 
3517
+ # arg: flags(ImGuiMultiSelectFlags), selection_size(int), items_count(int)
3518
+ # ret: pointer
3519
+ #
3520
+ # Multi-selection system for Selectable(), Checkbox(), TreeNode() functions [BETA]
3521
+ # - This enables standard multi-selection/range-selection idioms (CTRL+Mouse/Keyboard, SHIFT+Mouse/Keyboard, etc.) in a way that also allow a clipper to be used.
3522
+ # - ImGuiSelectionUserData is often used to store your item index within the current view (but may store something else).
3523
+ # - Read comments near ImGuiMultiSelectIO for instructions/details and see 'Demo->Widgets->Selection State & Multi-Select' for demo.
3524
+ # - TreeNode() is technically supported but... using this correctly is more complicated. You need some sort of linear/random access to your tree,
3525
+ # which is suited to advanced trees setups already implementing filters and clipper. We will work simplifying the current demo.
3526
+ # - 'selection_size' and 'items_count' parameters are optional and used by a few features. If they are costly for you to compute, you may avoid them.
3527
+ def self.BeginMultiSelect(flags, selection_size = -1, items_count = -1) # Implied selection_size = -1, items_count = -1
3528
+ igBeginMultiSelect(flags, selection_size, items_count)
3529
+ end
3530
+
3293
3531
  # arg: str_id(const char*), flags(ImGuiWindowFlags)
3294
3532
  # ret: bool
3295
3533
  #
@@ -3384,7 +3622,8 @@ module ImGui
3384
3622
  #
3385
3623
  # Tooltips
3386
3624
  # - Tooltips are windows following the mouse. They do not take focus away.
3387
- # - A tooltip window can contain items of any types. SetTooltip() is a shortcut for the 'if (BeginTooltip()) { Text(...); EndTooltip(); }' idiom.
3625
+ # - A tooltip window can contain items of any types.
3626
+ # - SetTooltip() is more or less a shortcut for the 'if (BeginTooltip()) { Text(...); EndTooltip(); }' idiom (with a subtlety that it discard any previously submitted tooltip)
3388
3627
  def self.BeginTooltip() # begin/append a tooltip window.
3389
3628
  igBeginTooltip()
3390
3629
  end
@@ -3574,7 +3813,7 @@ module ImGui
3574
3813
 
3575
3814
  # arg: fmt(const char*), ...(...)
3576
3815
  # ret: void
3577
- def self.DebugLog(fmt, *varargs)
3816
+ def self.DebugLog(fmt, *varargs) # Call via IMGUI_DEBUG_LOG() for maximum stripping in caller code!
3578
3817
  igDebugLog(fmt, *varargs)
3579
3818
  end
3580
3819
 
@@ -3749,6 +3988,11 @@ module ImGui
3749
3988
  igEndMenuBar()
3750
3989
  end
3751
3990
 
3991
+ # ret: pointer
3992
+ def self.EndMultiSelect()
3993
+ igEndMultiSelect()
3994
+ end
3995
+
3752
3996
  # ret: void
3753
3997
  def self.EndPopup() # only call EndPopup() if BeginPopupXXX() returns true!
3754
3998
  igEndPopup()
@@ -3836,30 +4080,19 @@ module ImGui
3836
4080
  end
3837
4081
 
3838
4082
  # ret: void
3839
- #
3840
- # Content region
3841
- # - Retrieve available space from a given point. GetContentRegionAvail() is frequently useful.
3842
- # - Those functions are bound to be redesigned (they are confusing, incomplete and the Min/Max return values are in local window coordinates which increases confusion)
3843
- def self.GetContentRegionAvail() # == GetContentRegionMax() - GetCursorPos()
4083
+ def self.GetContentRegionAvail() # available space from current position. THIS IS YOUR BEST FRIEND.
3844
4084
  pOut = ImVec2.new
3845
4085
  igGetContentRegionAvail(pOut)
3846
4086
  return pOut
3847
4087
  end
3848
4088
 
3849
- # ret: void
3850
- def self.GetContentRegionMax() # current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates
3851
- pOut = ImVec2.new
3852
- igGetContentRegionMax(pOut)
3853
- return pOut
3854
- end
3855
-
3856
4089
  # ret: pointer
3857
4090
  def self.GetCurrentContext()
3858
4091
  igGetCurrentContext()
3859
4092
  end
3860
4093
 
3861
4094
  # ret: void
3862
- def self.GetCursorPos() # [window-local] cursor position in window coordinates (relative to window position)
4095
+ def self.GetCursorPos() # [window-local] cursor position in window-local coordinates. This is not your best friend.
3863
4096
  pOut = ImVec2.new
3864
4097
  igGetCursorPos(pOut)
3865
4098
  return pOut
@@ -3881,18 +4114,20 @@ module ImGui
3881
4114
  # - By "cursor" we mean the current output position.
3882
4115
  # - The typical widget behavior is to output themselves at the current cursor position, then move the cursor one line down.
3883
4116
  # - You can call SameLine() between widgets to undo the last carriage return and output at the right of the preceding widget.
4117
+ # - YOU CAN DO 99% OF WHAT YOU NEED WITH ONLY GetCursorScreenPos() and GetContentRegionAvail().
3884
4118
  # - Attention! We currently have inconsistencies between window-local and absolute positions we will aim to fix with future API:
3885
4119
  # - Absolute coordinate: GetCursorScreenPos(), SetCursorScreenPos(), all ImDrawList:: functions. -> this is the preferred way forward.
3886
- # - Window-local coordinates: SameLine(), GetCursorPos(), SetCursorPos(), GetCursorStartPos(), GetContentRegionMax(), GetWindowContentRegion*(), PushTextWrapPos()
3887
- # - GetCursorScreenPos() = GetCursorPos() + GetWindowPos(). GetWindowPos() is almost only ever useful to convert from window-local to absolute coordinates.
3888
- def self.GetCursorScreenPos() # cursor position in absolute coordinates (prefer using this, also more useful to work with ImDrawList API).
4120
+ # - Window-local coordinates: SameLine(offset), GetCursorPos(), SetCursorPos(), GetCursorStartPos(), PushTextWrapPos()
4121
+ # - Window-local coordinates: GetContentRegionMax(), GetWindowContentRegionMin(), GetWindowContentRegionMax() --> all obsoleted. YOU DON'T NEED THEM.
4122
+ # - GetCursorScreenPos() = GetCursorPos() + GetWindowPos(). GetWindowPos() is almost only ever useful to convert from window-local to absolute coordinates. Try not to use it.
4123
+ def self.GetCursorScreenPos() # cursor position, absolute coordinates. THIS IS YOUR BEST FRIEND (prefer using this rather than GetCursorPos(), also more useful to work with ImDrawList API).
3889
4124
  pOut = ImVec2.new
3890
4125
  igGetCursorScreenPos(pOut)
3891
4126
  return pOut
3892
4127
  end
3893
4128
 
3894
4129
  # ret: void
3895
- def self.GetCursorStartPos() # [window-local] initial cursor position, in window coordinates
4130
+ def self.GetCursorStartPos() # [window-local] initial cursor position, in window-local coordinates. Call GetCursorScreenPos() after Begin() to get the absolute coordinates version.
3896
4131
  pOut = ImVec2.new
3897
4132
  igGetCursorStartPos(pOut)
3898
4133
  return pOut
@@ -3971,6 +4206,12 @@ module ImGui
3971
4206
  igGetID_Ptr(ptr_id)
3972
4207
  end
3973
4208
 
4209
+ # arg: int_id(int)
4210
+ # ret: uint
4211
+ def self.GetID_Int(int_id)
4212
+ igGetID_Int(int_id)
4213
+ end
4214
+
3974
4215
  # ret: pointer
3975
4216
  #
3976
4217
  # Main
@@ -4039,7 +4280,7 @@ module ImGui
4039
4280
 
4040
4281
  # arg: button(ImGuiMouseButton), lock_threshold(float)
4041
4282
  # ret: void
4042
- def self.GetMouseDragDelta(button = 0, lock_threshold = -1.0) # return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold)
4283
+ def self.GetMouseDragDelta(button = 0, lock_threshold = -1.0) # return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (uses io.MouseDraggingThreshold if lock_threshold < 0.0f)
4043
4284
  pOut = ImVec2.new
4044
4285
  igGetMouseDragDelta(pOut, button, lock_threshold)
4045
4286
  return pOut
@@ -4130,46 +4371,32 @@ module ImGui
4130
4371
  igGetVersion()
4131
4372
  end
4132
4373
 
4133
- # ret: void
4134
- def self.GetWindowContentRegionMax() # content boundaries max for the full window (roughly (0,0)+Size-Scroll) where Size can be overridden with SetNextWindowContentSize(), in window coordinates
4135
- pOut = ImVec2.new
4136
- igGetWindowContentRegionMax(pOut)
4137
- return pOut
4138
- end
4139
-
4140
- # ret: void
4141
- def self.GetWindowContentRegionMin() # content boundaries min for the full window (roughly (0,0)-Scroll), in window coordinates
4142
- pOut = ImVec2.new
4143
- igGetWindowContentRegionMin(pOut)
4144
- return pOut
4145
- end
4146
-
4147
4374
  # ret: pointer
4148
4375
  def self.GetWindowDrawList() # get draw list associated to the current window, to append your own drawing primitives
4149
4376
  igGetWindowDrawList()
4150
4377
  end
4151
4378
 
4152
4379
  # ret: float
4153
- def self.GetWindowHeight() # get current window height (shortcut for GetWindowSize().y)
4380
+ def self.GetWindowHeight() # get current window height (IT IS UNLIKELY YOU EVER NEED TO USE THIS). Shortcut for GetWindowSize().y.
4154
4381
  igGetWindowHeight()
4155
4382
  end
4156
4383
 
4157
4384
  # ret: void
4158
- def self.GetWindowPos() # get current window position in screen space (note: it is unlikely you need to use this. Consider using current layout pos instead, GetCursorScreenPos())
4385
+ def self.GetWindowPos() # get current window position in screen space (IT IS UNLIKELY YOU EVER NEED TO USE THIS. Consider always using GetCursorScreenPos() and GetContentRegionAvail() instead)
4159
4386
  pOut = ImVec2.new
4160
4387
  igGetWindowPos(pOut)
4161
4388
  return pOut
4162
4389
  end
4163
4390
 
4164
4391
  # ret: void
4165
- def self.GetWindowSize() # get current window size (note: it is unlikely you need to use this. Consider using GetCursorScreenPos() and e.g. GetContentRegionAvail() instead)
4392
+ def self.GetWindowSize() # get current window size (IT IS UNLIKELY YOU EVER NEED TO USE THIS. Consider always using GetCursorScreenPos() and GetContentRegionAvail() instead)
4166
4393
  pOut = ImVec2.new
4167
4394
  igGetWindowSize(pOut)
4168
4395
  return pOut
4169
4396
  end
4170
4397
 
4171
4398
  # ret: float
4172
- def self.GetWindowWidth() # get current window width (shortcut for GetWindowSize().x)
4399
+ def self.GetWindowWidth() # get current window width (IT IS UNLIKELY YOU EVER NEED TO USE THIS). Shortcut for GetWindowSize().x.
4173
4400
  igGetWindowWidth()
4174
4401
  end
4175
4402
 
@@ -4361,6 +4588,11 @@ module ImGui
4361
4588
  igIsItemToggledOpen()
4362
4589
  end
4363
4590
 
4591
+ # ret: bool
4592
+ def self.IsItemToggledSelection() # Was the last item selection state toggled? Useful if you need the per-item information _before_ reaching EndMultiSelect(). We only returns toggle _event_ in order to handle clipping correctly.
4593
+ igIsItemToggledSelection()
4594
+ end
4595
+
4364
4596
  # ret: bool
4365
4597
  def self.IsItemVisible() # is the last item visible? (items may be out of sight because of clipping/scrolling)
4366
4598
  igIsItemVisible()
@@ -4421,7 +4653,7 @@ module ImGui
4421
4653
 
4422
4654
  # arg: button(ImGuiMouseButton), lock_threshold(float)
4423
4655
  # ret: bool
4424
- def self.IsMouseDragging(button, lock_threshold = -1.0) # is mouse dragging? (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold)
4656
+ def self.IsMouseDragging(button, lock_threshold = -1.0) # is mouse dragging? (uses io.MouseDraggingThreshold if lock_threshold < 0.0f)
4425
4657
  igIsMouseDragging(button, lock_threshold)
4426
4658
  end
4427
4659
 
@@ -4644,11 +4876,6 @@ module ImGui
4644
4876
  igPlotLines_FnFloatPtr(label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size)
4645
4877
  end
4646
4878
 
4647
- # ret: void
4648
- def self.PopButtonRepeat()
4649
- igPopButtonRepeat()
4650
- end
4651
-
4652
4879
  # ret: void
4653
4880
  def self.PopClipRect()
4654
4881
  igPopClipRect()
@@ -4664,6 +4891,11 @@ module ImGui
4664
4891
  igPopID()
4665
4892
  end
4666
4893
 
4894
+ # ret: void
4895
+ def self.PopItemFlag()
4896
+ igPopItemFlag()
4897
+ end
4898
+
4667
4899
  # ret: void
4668
4900
  def self.PopItemWidth()
4669
4901
  igPopItemWidth()
@@ -4681,11 +4913,6 @@ module ImGui
4681
4913
  igPopStyleVar(count)
4682
4914
  end
4683
4915
 
4684
- # ret: void
4685
- def self.PopTabStop()
4686
- igPopTabStop()
4687
- end
4688
-
4689
4916
  # ret: void
4690
4917
  def self.PopTextWrapPos()
4691
4918
  igPopTextWrapPos()
@@ -4697,12 +4924,6 @@ module ImGui
4697
4924
  igProgressBar(fraction, size_arg, overlay)
4698
4925
  end
4699
4926
 
4700
- # arg: repeat(bool)
4701
- # ret: void
4702
- def self.PushButtonRepeat(repeat) # in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame.
4703
- igPushButtonRepeat(repeat)
4704
- end
4705
-
4706
4927
  # arg: clip_rect_min(ImVec2), clip_rect_max(ImVec2), intersect_with_current_clip_rect(bool)
4707
4928
  # ret: void
4708
4929
  #
@@ -4744,6 +4965,12 @@ module ImGui
4744
4965
  igPushID_Int(int_id)
4745
4966
  end
4746
4967
 
4968
+ # arg: option(ImGuiItemFlags), enabled(bool)
4969
+ # ret: void
4970
+ def self.PushItemFlag(option, enabled) # modify specified shared item flag, e.g. PushItemFlag(ImGuiItemFlags_NoTabStop, true)
4971
+ igPushItemFlag(option, enabled)
4972
+ end
4973
+
4747
4974
  # arg: item_width(float)
4748
4975
  # ret: void
4749
4976
  #
@@ -4776,12 +5003,6 @@ module ImGui
4776
5003
  igPushStyleVar_Vec2(idx, val)
4777
5004
  end
4778
5005
 
4779
- # arg: tab_stop(bool)
4780
- # ret: void
4781
- def self.PushTabStop(tab_stop) # == tab stop enable. Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets
4782
- igPushTabStop(tab_stop)
4783
- end
4784
-
4785
5006
  # arg: wrap_local_pos_x(float)
4786
5007
  # ret: void
4787
5008
  def self.PushTextWrapPos(wrap_local_pos_x = 0.0) # push word-wrapping position for Text*() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrap_pos_x' position in window local space
@@ -4915,7 +5136,7 @@ module ImGui
4915
5136
 
4916
5137
  # arg: pos(ImVec2)
4917
5138
  # ret: void
4918
- def self.SetCursorScreenPos(pos) # cursor position in absolute coordinates
5139
+ def self.SetCursorScreenPos(pos) # cursor position, absolute coordinates. THIS IS YOUR BEST FRIEND.
4919
5140
  igSetCursorScreenPos(pos)
4920
5141
  end
4921
5142
 
@@ -4933,9 +5154,22 @@ module ImGui
4933
5154
  igSetItemDefaultFocus()
4934
5155
  end
4935
5156
 
5157
+ # arg: key(ImGuiKey)
5158
+ # ret: void
5159
+ #
5160
+ # Inputs Utilities: Key/Input Ownership [BETA]
5161
+ # - One common use case would be to allow your items to disable standard inputs behaviors such
5162
+ # as Tab or Alt key handling, Mouse Wheel scrolling, etc.
5163
+ # e.g. Button(...); SetItemKeyOwner(ImGuiKey_MouseWheelY); to make hovering/activating a button disable wheel for scrolling.
5164
+ # - Reminder ImGuiKey enum include access to mouse buttons and gamepad, so key ownership can apply to them.
5165
+ # - Many related features are still in imgui_internal.h. For instance, most IsKeyXXX()/IsMouseXXX() functions have an owner-id-aware version.
5166
+ def self.SetItemKeyOwner(key) # Set key owner to last item ID if it is hovered or active. Equivalent to 'if (IsItemHovered() || IsItemActive()) { SetKeyOwner(key, GetItemID());'.
5167
+ igSetItemKeyOwner(key)
5168
+ end
5169
+
4936
5170
  # arg: fmt(const char*), ...(...)
4937
5171
  # ret: void
4938
- def self.SetItemTooltip(fmt, *varargs) # set a text-only tooltip if preceeding item was hovered. override any previous call to SetTooltip().
5172
+ def self.SetItemTooltip(fmt, *varargs) # set a text-only tooltip if preceding item was hovered. override any previous call to SetTooltip().
4939
5173
  igSetItemTooltip(fmt, *varargs)
4940
5174
  end
4941
5175
 
@@ -4976,12 +5210,24 @@ module ImGui
4976
5210
  igSetNextItemOpen(is_open, cond)
4977
5211
  end
4978
5212
 
5213
+ # arg: selection_user_data(ImGuiSelectionUserData)
5214
+ # ret: void
5215
+ def self.SetNextItemSelectionUserData(selection_user_data)
5216
+ igSetNextItemSelectionUserData(selection_user_data)
5217
+ end
5218
+
4979
5219
  # arg: key_chord(ImGuiKeyChord), flags(ImGuiInputFlags)
4980
5220
  # ret: void
4981
5221
  def self.SetNextItemShortcut(key_chord, flags = 0)
4982
5222
  igSetNextItemShortcut(key_chord, flags)
4983
5223
  end
4984
5224
 
5225
+ # arg: storage_id(ImGuiID)
5226
+ # ret: void
5227
+ def self.SetNextItemStorageID(storage_id) # set id to use for open/close storage (default to same as item id).
5228
+ igSetNextItemStorageID(storage_id)
5229
+ end
5230
+
4985
5231
  # arg: item_width(float)
4986
5232
  # ret: void
4987
5233
  def self.SetNextItemWidth(item_width) # set width of the _next_ common large "item+label" widget. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -FLT_MIN always align width to the right side)
@@ -5147,6 +5393,22 @@ module ImGui
5147
5393
 
5148
5394
  # arg: key_chord(ImGuiKeyChord), flags(ImGuiInputFlags)
5149
5395
  # ret: bool
5396
+ #
5397
+ # Inputs Utilities: Shortcut Testing & Routing [BETA]
5398
+ # - ImGuiKeyChord = a ImGuiKey + optional ImGuiMod_Alt/ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Super.
5399
+ # ImGuiKey_C // Accepted by functions taking ImGuiKey or ImGuiKeyChord arguments)
5400
+ # ImGuiMod_Ctrl | ImGuiKey_C // Accepted by functions taking ImGuiKeyChord arguments)
5401
+ # only ImGuiMod_XXX values are legal to combine with an ImGuiKey. You CANNOT combine two ImGuiKey values.
5402
+ # - The general idea is that several callers may register interest in a shortcut, and only one owner gets it.
5403
+ # Parent -> call Shortcut(Ctrl+S) // When Parent is focused, Parent gets the shortcut.
5404
+ # Child1 -> call Shortcut(Ctrl+S) // When Child1 is focused, Child1 gets the shortcut (Child1 overrides Parent shortcuts)
5405
+ # Child2 -> no call // When Child2 is focused, Parent gets the shortcut.
5406
+ # The whole system is order independent, so if Child1 makes its calls before Parent, results will be identical.
5407
+ # This is an important property as it facilitate working with foreign code or larger codebase.
5408
+ # - To understand the difference:
5409
+ # - IsKeyChordPressed() compares mods and call IsKeyPressed() -> function has no side-effect.
5410
+ # - Shortcut() submits a route, routes are resolved, if it currently can be routed it calls IsKeyChordPressed() -> function has (desirable) side-effects as it can prevents another call from getting the route.
5411
+ # - Visualize registered routes in 'Metrics/Debugger->Inputs'.
5150
5412
  def self.Shortcut(key_chord, flags = 0)
5151
5413
  igShortcut(key_chord, flags)
5152
5414
  end
@@ -5344,7 +5606,7 @@ module ImGui
5344
5606
  end
5345
5607
 
5346
5608
  # ret: int
5347
- def self.TableGetHoveredColumn()
5609
+ def self.TableGetHoveredColumn() # return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered. Can also use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead.
5348
5610
  igTableGetHoveredColumn()
5349
5611
  end
5350
5612
 
@@ -5446,13 +5708,13 @@ module ImGui
5446
5708
 
5447
5709
  # arg: label(const char*)
5448
5710
  # ret: bool
5449
- def self.TextLink(label)
5711
+ def self.TextLink(label) # hyperlink text button, return true when clicked
5450
5712
  igTextLink(label)
5451
5713
  end
5452
5714
 
5453
5715
  # arg: label(const char*), url(const char*)
5454
5716
  # ret: void
5455
- def self.TextLinkOpenURL(label, url = nil)
5717
+ def self.TextLinkOpenURL(label, url = nil) # Implied url = NULL
5456
5718
  igTextLinkOpenURL(label, url)
5457
5719
  end
5458
5720
 
@@ -5658,6 +5920,9 @@ module ImGui
5658
5920
  # arg: 0:ptr_id(const void*)
5659
5921
  # ret: uint
5660
5922
  return igGetID_Ptr(arg[0]) if arg.length == 1 && (arg[0].kind_of?(FFI::Pointer))
5923
+ # arg: 0:int_id(int)
5924
+ # ret: uint
5925
+ return igGetID_Int(arg[0]) if arg.length == 1 && (arg[0].kind_of?(Integer))
5661
5926
  $stderr.puts("[Warning] GetID : No matching functions found (#{arg})")
5662
5927
  end
5663
5928
 
Binary file
data/lib/imgui.x86_64.so CHANGED
Binary file
Binary file
Binary file
data/lib/imnodes.dll CHANGED
Binary file
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.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaiorabbit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-14 00:00:00.000000000 Z
11
+ date: 2024-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi