rev: e32a77264f85054e8319dff5214de6a709ba3384 tukan/tukan/imgui/init.sc -rw-r--r-- 20.9 KiB View raw Log this file
e32a77264f85 — Leonard Ritter * updated imgui/cimgui to latest revision (docking branch) a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
using import glm

let lib = (import .cimgui)
using lib

inline ImVec2->vec2 (v)
    vec2 v.x v.y

inline vec2->ImVec2 (v)
    ImVec2 (unpack v)

inline vec2-getter (f ...)
    let v = (f ...)
    #local size : ImVec2
    #f &size
    #vec2 size.x size.y
    vec2 v.x v.y

inline vec2-getter2 (f ...)
    local out : ImVec2
    f &out ...
    ImVec2->vec2 out

fn GetWindowSize ()
    vec2-getter2 igGetWindowSize

fn GetWindowPos ()
    vec2-getter2 igGetWindowPos

inline SetNextWindowPos (pos cond pivot)
    igSetNextWindowPos
        ImVec2 pos.x pos.y
        static-if (none? cond) 0
        else cond
        static-if (none? pivot) (ImVec2 0 0)
        else pivot

inline SetNextWindowSize (size cond)
    igSetNextWindowSize
        ImVec2 size.x size.y
        static-if (none? cond) 0
        else (cond as integer)

fn GetWindowContentRegionMin ()
    vec2-getter igGetWindowContentRegionMin

fn GetWindowContentRegionMax ()
    vec2-getter igGetWindowContentRegionMax

inline Begin (name p_opened flags)
    igBegin name
        static-if (none? p_opened) null
        else &p_opened
        static-if (none? flags) 0
        else flags

inline BeginChild (id size border extra_flags)
    inline dispatch (f id)
        f id
            static-if (none? size)
                ImVec2 0 0
            else
                ImVec2 size.x size.y
            static-if (none? border) false
            else border
            static-if (none? extra_flags) 0
            else extra_flags
    static-if ((typeof id) == string)
        dispatch igBeginChildStr (id as rawstring)
    elseif ((typeof id) == rawstring)
        dispatch igBeginChildStr id
    else
        dispatch igBeginChildID id

inline... Columns
case (count = 1, id = null, border = true)
    igColumns count id border

inline Button (text size)
    igButton text
        static-if (none? size)
            ImVec2 0 0
        else
            ImVec2 size.x size.y

inline ImageFN (user_texture_id size uv0 uv1 tint_col border_col)
    igImage user_texture_id
        ImVec2 size.x size.y
        static-if (none? uv0)
            ImVec2 0 0
        else
            ImVec2 uv0.x uv0.y
        static-if (none? uv1)
            ImVec2 1 1
        else
            ImVec2 uv1.x uv1.y
        static-if (none? tint_col)
            ImVec4 255 255 255 255
        else
            ImVec4 tint_col.x tint_col.y tint_col.z tint_col.w
        static-if (none? border_col)
            ImVec4 255 255 255 128
        else
            ImVec4 border_col.x border_col.y border_col.z border_col.w

inline Selectable (text selected flags size)
    call
        static-if (&? selected)
            igSelectableBoolPtr
        else
            igSelectableBool
        imply text rawstring
        static-if (none? selected) false
        elseif (&? selected) &selected
        else selected

        static-if (none? flags) 0
        else flags

        static-if (none? size)
            ImVec2 0 0
        else
            ImVec2 size.x size.y

inline Checkbox (name checked)
    igCheckbox name &checked

inline RadioButton (name checked index)
    igRadioButtonIntPtr name &checked index

inline CollapsingHeader (text args...)
    let sz = (va-countof args...)
    static-if (sz == 0)
        igCollapsingHeaderTreeNodeFlags text 0
    elseif (sz == 1)
        let arg = (va@ 0 args...)
        static-if (&? arg)
            igCollapsingHeaderBoolPtr text args...
        else
            igCollapsingHeaderTreeNodeFlags text args...
    else
        igCollapsingHeaderBoolPtr text args...

inline InputText (text buf buf_size flags callback userdata)
    igInputText text buf buf_size
        static-if (none? flags) 0
        else flags
        static-if (none? callback) null
        else callback
        static-if (none? userdata) null
        else userdata

inline InputInt (text v step step_fast extra_flags)
    igInputInt text &v
        static-if (none? step) 1
        else step
        static-if (none? step_fast) 100
        else step_fast
        static-if (none? extra_flags) 0
        else extra_flags

inline InputFloat (text v step step_fast format extra_flags)
    igInputFloat text &v
        static-if (none? step) 0
        else step
        static-if (none? step_fast) 0
        else step_fast
        static-if (none? format) "%.3f"
        else format
        static-if (none? extra_flags) 0
        else extra_flags

inline DragFloat (text v v_speed v_min v_max display_format power)
    igDragFloat text &v
        static-if (none? v_speed) 1
        else v_speed
        static-if (none? v_min) 0
        else v_min
        static-if (none? v_max) 0
        else v_max
        static-if (none? display_format) "%.3f"
        else display_format
        static-if (none? power) 1
        else power

define FLT_MAX 1e+37

inline PlotLines (text values args...)
    static-if ((typeof values) < Closure)
        let values_getter data values_count values_offset overlay_text scale_min scale_max graph_size = values args...
        igPlotLinesFnFloatPtr text values_getter data values_count
            static-if (none? values_offset) 0
            else values_offset
            static-if (none? overlay_text) null
            else overlay_text
            static-if (none? scale_min) FLT_MAX
            else scale_min
            static-if (none? scale_max) FLT_MAX
            else scale_max
            static-if (none? graph_size) (ImVec2 0 0)
            else graph_size
    else
        let values_count values_offset overlay_text scale_min scale_max graph_size stride = args...
        igPlotLinesFloatPtr text values values_count
            static-if (none? values_offset) 0
            else values_offset
            static-if (none? overlay_text) null
            else overlay_text
            static-if (none? scale_min) FLT_MAX
            else scale_min
            static-if (none? scale_max) FLT_MAX
            else scale_max
            static-if (none? graph_size) (ImVec2 0 0)
            else graph_size
            static-if (none? stride) (sizeof f32)
            else stride

fn Dummy (size)
    local imsize = (ImVec2 size.x size.y)
    igDummy &imsize

inline... SameLine (pos_x = 0, spacing_w = -1)
    igSameLine pos_x spacing_w

fn PushID (id args...)
    let sz = (va-countof args...)
    static-if (sz == 0)
        static-if (imply? id rawstring)
            igPushIDStr id
        elseif ((typeof id) < pointer)
            igPushIDPtr id
        else
            igPushIDInt id
    else
        igPushIDStrStr id args...

fn GetID (id args...)
    let sz = (va-countof args...)
    static-if (sz == 0)
        static-if (imply? id rawstring)
            igGetIDStr id
        elseif ((typeof id) < pointer)
            igGetIDPtr id
        else
            igGetIDPtr
                inttoptr id (pointer i8)
    else
        igGetIDStrStr id args...

inline make-with (begincmd endcmd)
    typedef With :: (storageof Nothing)
        inline __typecall (cls args...)
            _
                begincmd args...
                bitcast none this-type
        inline __drop (self)
            endcmd;
            ;

inline make-with-cond (begincmd endcmd)
    typedef WithCond :: bool
        inline __typecall (cls args...)
            bitcast (begincmd args...) this-type
        inline __tobool (self)
            dupe (storagecast (view self))
        fn __drop (self)
            if self
                endcmd;
            ;

inline BeginMenu (text enabled)
    igBeginMenu text
        static-if (none? enabled) true
        else enabled

inline MenuItem (text shortcut selected enabled)
    let ptr? = (&? selected)
    call
        static-if ptr? igMenuItemBoolPtr
        else igMenuItemBool
        text
        static-if (none? shortcut) null
        static-if (none? selected) false
        elseif ptr? &selected
        else selected
        static-if (none? enabled) true
        else enabled

inline BeginPopupContextItem (str_id mouse_button)
    igBeginPopupContextItem str_id
        static-if (none? mouse_button) 1
        else mouse_button

inline ShowDemoWindow (p_open)
    igShowDemoWindow
        static-if (none? p_open) null
        else &p_open

#inline BeginDock (text opened extra_flags)
    igBeginDock text
        static-if (none? opened) null
        else opened
        static-if (none? extra_flags) 0
        else extra_flags

inline CalcTextSize (text text_end hide_text_after_double_hash wrap_width)
    igCalcTextSize text
        static-if (none? text_end) null
        else text_end
        static-if (none? hide_text_after_double_hash) false
        else hide_text_after_double_hash
        static-if (none? wrap_width) -1
        else wrap_width

inline IsMouseClicked (button repeat)
    igIsMouseClicked button
        static-if (none? repeat) false
        else repeat

inline IsMouseDragging (button lock_threshold)
    igIsMouseDragging
        static-if (none? button) 0
        else button
        static-if (none? lock_threshold) -1
        else lock_threshold

inline IsMouseHoveringRect (r_min r_max clip)
    igIsMouseHoveringRect
        ImVec2 r_min.x r_min.y
        ImVec2 r_max.x r_max.y
        static-if (none? clip) true
        else clip

fn GetItemRectMin ()
    vec2-getter2 igGetItemRectMin

fn GetItemRectMax ()
    vec2-getter2 igGetItemRectMax

fn GetItemRect ()
    let mn mx =
        GetItemRectMin;
        GetItemRectMax;
    _ mn mx

fn GetItemRectSize ()
    vec2-getter2 igGetItemRectSize

fn GetMousePos ()
    vec2-getter2 igGetMousePos

inline PushStyleVar (idx val)
    static-if ((typeof val) == vec2)
        igPushStyleVarVec2 (idx as u32)
            ImVec2 val.x val.y
    else
        igPushStyleVarFloat (idx as u32) val

inline PopStyleVar (count)
    igPopStyleVar
        static-if (none? count) 1
        else count

fn... PushStyleColor
case (idx, val : ImVec4)
    igPushStyleColorVec4 idx
        ImVec4 val.x val.y val.z val.w
case (idx, val : u32)
    igPushStyleColorU32 idx val

inline PopStyleColor (count)
    igPopStyleColor
        static-if (none? count) 1
        else count

fn GetCursorPos ()
    vec2-getter2 igGetCursorPos

fn GetCursorScreenPos ()
    vec2-getter2 igGetCursorScreenPos

fn SetCursorPos (local_pos)
    igSetCursorPos
        ImVec2 local_pos.x local_pos.y

inline GetColorU32 (idx alpha_mul)
    T := (typeof idx)
    static-if (T == vec4)
        let col = idx
        igGetColorU32Vec4 (ImVec4 col.r col.g col.b col.a)
    elseif (T == ImVec4)
        igGetColorU32Vec4 idx
    elseif (T == u32)
        igGetColorU32U32 idx
    else
        igGetColorU32Col idx
            static-if (none? alpha_mul) 1
            else alpha_mul

typedef+ ImMemoryEditor
    inline __typecall (cls)
        let tmp = (alloca this-type)
        igMemoryEditor_Init tmp
        @ tmp

    inline... DrawWindow (self, title, mem_data, mem_size, base_display_addr = 0x0000:usize)
        igMemoryEditor_DrawWindow &self title mem_data mem_size base_display_addr

typedef+ (mutable pointer ImGuiViewport)
    fn GetWorkPos (self)
        local out : ImVec2
        ImGuiViewport_GetWorkPos &out self
        ImVec2->vec2 out
    fn GetWorkSize (self)
        local out : ImVec2
        ImGuiViewport_GetWorkSize &out self
        ImVec2->vec2 out

typedef+ ImVec2
    inline __rimply (other-cls cls)
        static-if (other-cls == vec2) vec2->ImVec2

typedef+ (mutable pointer ImGuiStorage)
    inline... GetFloat (self, key, default_val = 0.0)
        ImGuiStorage_GetFloat self key default_val
    let SetFloat = ImGuiStorage_SetFloat

typedef+ (mutable pointer ImDrawList)
    inline AddRect (self a b col rounding rounding_corners thickness)
        ImDrawList_AddRect self
            imply a vec2
            imply b vec2
            col
            static-if (none? rounding) 0
            else rounding
            static-if (none? rounding_corners) 0xf
            else rounding_corners
            static-if (none? thickness) 1
            else thickness

    inline AddRectFilled (self a b col rounding rounding_corners)
        ImDrawList_AddRectFilled self
            ImVec2 a.x a.y
            ImVec2 b.x b.y
            col
            static-if (none? rounding) 0
            else rounding
            static-if (none? rounding_corners) 0xf
            else rounding_corners

    inline AddText (self pos col text_begin text_end)
        ImDrawList_AddTextVec2 self
            ImVec2 pos.x pos.y
            col
            text_begin
            static-if (none? text_end) null
            else text_end

    let
        PathLineTo = ImDrawList_PathLineTo
        PathFillConvex = ImDrawList_PathFillConvex
    inline... PathStroke (self, col, closed, thickness = 1.0)
        ImDrawList_PathFillConvex self col closed thickness

    inline... AddTriangle (self, p1, p2, p3, col, thickness = 1.0)
        ImDrawList_AddTriangle self p1 p2 p3 col thickness
    let AddTriangleFilled = ImDrawList_AddTriangleFilled

    inline... AddCircle (self, center, radius, col, num_segments = 12, thickness = 1.0)
        ImDrawList_AddCircle self center radius col num_segments thickness

    inline... AddCircleFilled (self, center, radius, col, num_segments = 12)
        ImDrawList_AddCircleFilled self center radius col num_segments

    inline... PathArcTo (self, center, radius, a_min, a_max, num_segments = 10)
        ImDrawList_PathArcTo self center radius a_min a_max num_segments

    let PathArcToFast = ImDrawList_PathArcToFast

    inline ChannelsSplit (self count)
        ImDrawListSplitter_Split &self._Splitter self count

    inline ChannelsSetCurrent (self index)
        ImDrawListSplitter_SetCurrentChannel &self._Splitter self index

    inline ChannelsMerge (self)
        ImDrawListSplitter_Merge &self._Splitter self

fn ColorConvertHSVtoRGB (h s v)
    local r : f32
    local g : f32
    local b : f32
    igColorConvertHSVtoRGB h s v &r &g &b
    return (deref r) (deref g) (deref b)

fn ColorConvertRGBtoHSV (r g b)
    local h : f32
    local s : f32
    local v : f32
    igColorConvertRGBtoHSV r g b &h &s &v
    return (deref h) (deref s) (deref v)

inline... DockSpace (id, size = (nullof vec2), flags : integer = ImGuiDockNodeFlags_None, window_class = null)
    igDockSpace id (ImVec2 (unpack size)) flags window_class

fn GetContentRegionAvail (...)
    vec2-getter2 igGetContentRegionAvail ...

do
    using lib filter "^Im(.+)$"

    let GetIO = igGetIO
    let GetStyle = igGetStyle

    let GetWindowSize GetWindowPos SetNextWindowPos SetNextWindowSize \
        GetWindowContentRegionMin GetWindowContentRegionMax \
        GetContentRegionAvail
    let GetFontSize = igGetFontSize

    let Render = igRender

    let Begin
    let End = igEnd
    let BeginChild
    let EndChild = igEndChild

    let Columns
    let
        NextColumn = igNextColumn
        Separator = igSeparator

    let Text = igText
    let TextWrapped = igTextWrapped
    let Button
    let RadioButton
    let Image = ImageFN
    let Selectable
    let CollapsingHeader
    let InputText
    let InputInt
    let InputFloat
    let DragFloat
    let Checkbox
    let PlotLines
    #let ValuesGetterFunc
    let TreeNode = igTreeNodeStr
    let TreeNodeEx = igTreeNodeExStr
    let TreePop = igTreePop
    inline... InvisibleButton (str_id, size : vec2)
        igInvisibleButton str_id (vec2->ImVec2 size)

    let Dummy
    let SameLine
    let NewLine = igNewLine
    let Spacing = igSpacing
    let GetCursorPos
    let GetCursorScreenPos
    let SetCursorScreenPos = igSetCursorScreenPos
    let GetCursorPosX = igGetCursorPosX
    let GetCursorPosY = igGetCursorPosY
    let SetCursorPos
    let SetCursorPosX = igSetCursorPosX
    let SetCursorPosY = igSetCursorPosY
    let Indent = igIndent
    let Unindent = igUnindent

    let PushID
    let PopID = igPopID
    let GetID
    let GetStateStorage = igGetStateStorage

    let BeginMainMenuBar = igBeginMainMenuBar
    let BeginMenuBar = igBeginMenuBar
    let EndMenuBar = igEndMenuBar
    let BeginMenu
    let MenuItem
    let EndMenu = igEndMenu
    let EndMainMenuBar = igEndMainMenuBar

    let BeginPopupContextItem
    let EndPopup = igEndPopup

    let BeginTooltip = igBeginTooltip
    let EndTooltip = igEndTooltip

    let BeginGroup = igBeginGroup
    let EndGroup = igEndGroup

    inline... IsItemClicked (button = 0,)
        igIsItemClicked button
    inline... IsItemHovered (flags : integer = 0,)
        igIsItemHovered flags
    let
        IsItemActive = igIsItemActive
        IsItemVisible = igIsItemVisible
        IsItemActivated = igIsItemActivated
        IsItemDeactivated = igIsItemDeactivated
        IsAnyItemHovered = igIsAnyItemHovered
        IsAnyItemActive = igIsAnyItemActive
    let GetItemRectMin GetItemRectMax GetItemRect GetItemRectSize
    let CalcItemWidth = igCalcItemWidth

    let CalcTextSize

    let IsKeyDown = igIsKeyDown
    let IsKeyPressed = igIsKeyPressed
    let IsKeyReleased = igIsKeyReleased
    let IsMouseDown = igIsMouseDown
    let IsMouseClicked
    let IsMouseDoubleClicked = igIsMouseDoubleClicked
    let IsMouseReleased = igIsMouseReleased
    let IsWindowHovered = igIsWindowHovered
    let IsWindowFocused = igIsWindowFocused
    inline... IsMouseHoveringRect (r_min, r_max, clip = true)
        igIsMouseHoveringRect r_min r_max clip
    inline... IsMouseDragging (button, lock_threshold = -1.0)
        igIsMouseDragging button lock_threshold
    inline... GetMouseDragDelta (button : integer = 0, lock_threshold = -1.0)
        vec2-getter2 igGetMouseDragDelta button lock_threshold
    inline... ResetMouseDragDelta (button : integer = 0,)
        igResetMouseDragDelta button
    fn GetMouseClickedPos ()
        ImVec2->vec2 ((GetIO) . MouseClickedPos @ 0)
    let GetMousePos

    let PushFont = igPushFont
    let PopFont = igPopFont
    let GetFontSize = igGetFontSize
    let PushStyleVar
    let PopStyleVar
    let PushStyleColor
    let PopStyleColor
    let PushItemWidth = igPushItemWidth
    let PopItemWidth = igPopItemWidth
    let SetNextItemWidth = igSetNextItemWidth
    let GetColorU32

    let AlignTextToFramePadding = igAlignTextToFramePadding
    let GetTextLineHeight = igGetTextLineHeight
    let GetTextLineHeightWithSpacing = igGetTextLineHeightWithSpacing
    let GetFrameHeight = igGetFrameHeight
    let GetFrameHeightWithSpacing = igGetFrameHeightWithSpacing

    let ShowDemoWindow
    let ShowUserGuide = igShowUserGuide

    let ColorConvertHSVtoRGB
        ColorConvertRGBtoHSV

    let SetMouseCursor = igSetMouseCursor

    #let BeginWorkspace = igBeginWorkspace
    #let EndWorkspace = igEndWorkspace
    #let ShutdownDock = igShutdownDock
    #let BeginDock
    #let EndDock = igEndDock
    #let SetDockActive = igSetDockActive
    #let SetNextDock = igSetNextDock
    #let DockDebugWindow = igDockDebugWindow

    let GetWindowDrawList = igGetWindowDrawList
    let GetDrawData = igGetDrawData
    let CreateContext = igCreateContext
    let DestroyContext = igDestroyContext
    let NewFrame = igNewFrame
    let EndFrame = igEndFrame

    let GetMainViewport = igGetMainViewport
    let SetNextWindowViewport = igSetNextWindowViewport

    let DockSpace

    let UpdatePlatformWindows = igUpdatePlatformWindows

    inline... RenderPlatformWindowsDefault (platform = null, renderer = null)
        igRenderPlatformWindowsDefault platform renderer

    inline... BeginDragDropSource
    case (flags : integer = 0,)
        igBeginDragDropSource flags

    inline... SetDragDropPayload
    case (type, data, cond = 0)
        igSetDragDropPayload type &data (sizeof (typeof data)) cond
    case (type, data, sz, cond)
        igSetDragDropPayload type data sz cond

    inline... AcceptDragDropPayload
    case (type, flags = 0)
        igAcceptDragDropPayload type flags

    let
        EndDragDropSource = igEndDragDropSource
        BeginDragDropTarget = igBeginDragDropTarget
        EndDragDropTarget = igEndDragDropTarget
        GetDragDropPayload = igGetDragDropPayload

    inline BeginTooltipSimple ()
        if (IsItemHovered)
            BeginTooltip;
            true
        else false

    let
        WithDragDropSource =
            make-with-cond BeginDragDropSource EndDragDropSource
        WithDragDropTarget =
            make-with-cond BeginDragDropTarget EndDragDropTarget
        WithStyleVar =
            make-with PushStyleVar PopStyleVar
        WithChild =
            make-with BeginChild EndChild
        WithBegin =
            make-with Begin End
        WithGroup =
            make-with BeginGroup EndGroup
        #WithDock =
            make-with BeginDock EndDock
        WithID =
            make-with PushID PopID
        WithTreeNode =
            make-with-cond TreeNodeEx TreePop
        WithPopupContextItem =
            make-with-cond BeginPopupContextItem EndPopup
        WithMenu =
            make-with-cond BeginMenu EndMenu
        WithMenuBar =
            make-with-cond BeginMenuBar EndMenuBar
        WithItemWidth =
            make-with PushItemWidth PopItemWidth
        WithTooltip =
            make-with-cond BeginTooltipSimple EndTooltip
        imgui-with-inline = make-with
        imgui-with-conditional-inline = make-with-cond

    let
        StyleColorsDark = igStyleColorsDark
        StyleColorsClassic = igStyleColorsClassic
        StyleColorsLight = igStyleColorsLight

    let MemoryEditor = ImMemoryEditor

    locals;