e32a77264f85 — Leonard Ritter tip a month ago
* updated imgui/cimgui to latest revision (docking branch)
3 files changed, 53 insertions(+), 36 deletions(-)

M externals/build_cimgui.py
M externals/build_imgui.py
M tukan/imgui/init.sc
M externals/build_cimgui.py +3 -1
@@ 11,7 11,9 @@ class Builder(BuilderBase):
     # 1.69
     #GIT_REVISION = "4be0522d9f1513e9f14dd3510c396325007f58ad"
     # 1.75+ docking branch
-    GIT_REVISION = "1d32b3804d834da4d05f02d6d81e2f6b4b94138e"
+    #GIT_REVISION = "1d32b3804d834da4d05f02d6d81e2f6b4b94138e"
+    # jun 30, 2020, master
+    GIT_REVISION = "c1f0030b20488a940f0813f413d84313652bb0b2"
 
     def run_any_build(self):
         self.copy2(os.path.join(self.TARGETDIR, '..', 'imgui', 'imgui.h'),

          
M externals/build_imgui.py +3 -1
@@ 11,7 11,9 @@ class Builder(BuilderBase):
     # 1.69
     #GIT_REVISION = "ebe79bbed00a13fd4455f04131b63d49c28ebd5d"
     # 1.75+ docking branch
-    GIT_REVISION = "103c5edaaa832ccded2523ea328dc4398ba7b456"
+    #GIT_REVISION = "103c5edaaa832ccded2523ea328dc4398ba7b456"
+    # 1.77+ docking branch
+    GIT_REVISION = "4f5aac319e3561284833db90f35d218de8b282c1"
 
     def run_any_build(self):
         self.copy2(os.path.join(self.TARGETDIR, 'imgui.h'),

          
M tukan/imgui/init.sc +47 -34
@@ 17,11 17,16 @@ inline vec2-getter (f ...)
     #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-getter igGetWindowSize
+    vec2-getter2 igGetWindowSize
 
 fn GetWindowPos ()
-    vec2-getter igGetWindowPos
+    vec2-getter2 igGetWindowPos
 
 inline SetNextWindowPos (pos cond pivot)
     igSetNextWindowPos

          
@@ 62,9 67,9 @@ inline BeginChild (id size border extra_
             static-if (none? extra_flags) 0
             else extra_flags
     static-if ((typeof id) == string)
-        dispatch igBeginChild (id as rawstring)
+        dispatch igBeginChildStr (id as rawstring)
     elseif ((typeof id) == rawstring)
-        dispatch igBeginChild id
+        dispatch igBeginChildStr id
     else
         dispatch igBeginChildID id
 

          
@@ 104,7 109,7 @@ inline Selectable (text selected flags s
         static-if (&? selected)
             igSelectableBoolPtr
         else
-            igSelectable
+            igSelectableBool
         imply text rawstring
         static-if (none? selected) false
         elseif (&? selected) &selected

          
@@ 127,13 132,13 @@ inline RadioButton (name checked index)
 inline CollapsingHeader (text args...)
     let sz = (va-countof args...)
     static-if (sz == 0)
-        igCollapsingHeader text 0
+        igCollapsingHeaderTreeNodeFlags text 0
     elseif (sz == 1)
         let arg = (va@ 0 args...)
         static-if (&? arg)
             igCollapsingHeaderBoolPtr text args...
         else
-            igCollapsingHeader text args...
+            igCollapsingHeaderTreeNodeFlags text args...
     else
         igCollapsingHeaderBoolPtr text args...
 

          
@@ 184,7 189,7 @@ 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...
-        igPlotLinesFnPtr text values_getter data values_count
+        igPlotLinesFnFloatPtr text values_getter data values_count
             static-if (none? values_offset) 0
             else values_offset
             static-if (none? overlay_text) null

          
@@ 197,7 202,7 @@ inline PlotLines (text values args...)
             else graph_size
     else
         let values_count values_offset overlay_text scale_min scale_max graph_size stride = args...
-        igPlotLines text values values_count
+        igPlotLinesFloatPtr text values values_count
             static-if (none? values_offset) 0
             else values_offset
             static-if (none? overlay_text) null

          
@@ 228,7 233,7 @@ fn PushID (id args...)
         else
             igPushIDInt id
     else
-        igPushIDRange id args...
+        igPushIDStrStr id args...
 
 fn GetID (id args...)
     let sz = (va-countof args...)

          
@@ 241,7 246,7 @@ fn GetID (id args...)
             igGetIDPtr
                 inttoptr id (pointer i8)
     else
-        igGetIDRange id args...
+        igGetIDStrStr id args...
 
 inline make-with (begincmd endcmd)
     typedef With :: (storageof Nothing)

          
@@ 328,22 333,22 @@ inline IsMouseHoveringRect (r_min r_max 
         else clip
 
 fn GetItemRectMin ()
-    vec2-getter igGetItemRectMin
+    vec2-getter2 igGetItemRectMin
 
 fn GetItemRectMax ()
-    vec2-getter igGetItemRectMax
+    vec2-getter2 igGetItemRectMax
 
 fn GetItemRect ()
     let mn mx =
-        igGetItemRectMin;
-        igGetItemRectMax;
-    _ (vec2 mn.x mn.y) (vec2 mx.x mx.y)
+        GetItemRectMin;
+        GetItemRectMax;
+    _ mn mx
 
 fn GetItemRectSize ()
-    vec2-getter igGetItemRectSize
+    vec2-getter2 igGetItemRectSize
 
 fn GetMousePos ()
-    vec2-getter igGetMousePos
+    vec2-getter2 igGetMousePos
 
 inline PushStyleVar (idx val)
     static-if ((typeof val) == vec2)

          
@@ 357,9 362,12 @@ inline PopStyleVar (count)
         static-if (none? count) 1
         else count
 
-fn PushStyleColor (idx val)
-    igPushStyleColor idx
+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

          
@@ 367,10 375,10 @@ inline PopStyleColor (count)
         else count
 
 fn GetCursorPos ()
-    vec2-getter igGetCursorPos
+    vec2-getter2 igGetCursorPos
 
 fn GetCursorScreenPos ()
-    vec2-getter igGetCursorScreenPos
+    vec2-getter2 igGetCursorScreenPos
 
 fn SetCursorPos (local_pos)
     igSetCursorPos

          
@@ 383,8 391,10 @@ inline GetColorU32 (idx alpha_mul)
         igGetColorU32Vec4 (ImVec4 col.r col.g col.b col.a)
     elseif (T == ImVec4)
         igGetColorU32Vec4 idx
+    elseif (T == u32)
+        igGetColorU32U32 idx
     else
-        igGetColorU32 idx
+        igGetColorU32Col idx
             static-if (none? alpha_mul) 1
             else alpha_mul
 

          
@@ 399,9 409,13 @@ typedef+ ImMemoryEditor
 
 typedef+ (mutable pointer ImGuiViewport)
     fn GetWorkPos (self)
-        ImVec2->vec2 (ImGuiViewport_GetWorkPos self)
+        local out : ImVec2
+        ImGuiViewport_GetWorkPos &out self
+        ImVec2->vec2 out
     fn GetWorkSize (self)
-        ImVec2->vec2 (ImGuiViewport_GetWorkSize self)
+        local out : ImVec2
+        ImGuiViewport_GetWorkSize &out self
+        ImVec2->vec2 out
 
 typedef+ ImVec2
     inline __rimply (other-cls cls)

          
@@ 436,7 450,7 @@ typedef+ (mutable pointer ImDrawList)
             else rounding_corners
 
     inline AddText (self pos col text_begin text_end)
-        ImDrawList_AddText self
+        ImDrawList_AddTextVec2 self
             ImVec2 pos.x pos.y
             col
             text_begin

          
@@ 490,19 504,18 @@ fn ColorConvertRGBtoHSV (r g b)
 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
-    let GetWindowPos
-    let SetNextWindowPos
-    let SetNextWindowSize
-    let GetWindowContentRegionMin
-    let GetWindowContentRegionMax
-    let GetContentRegionAvail = igGetContentRegionAvail
+    let GetWindowSize GetWindowPos SetNextWindowPos SetNextWindowSize \
+        GetWindowContentRegionMin GetWindowContentRegionMax \
+        GetContentRegionAvail
     let GetFontSize = igGetFontSize
 
     let Render = igRender

          
@@ 604,7 617,7 @@ do
     inline... IsMouseDragging (button, lock_threshold = -1.0)
         igIsMouseDragging button lock_threshold
     inline... GetMouseDragDelta (button : integer = 0, lock_threshold = -1.0)
-        ImVec2->vec2 (igGetMouseDragDelta button lock_threshold)
+        vec2-getter2 igGetMouseDragDelta button lock_threshold
     inline... ResetMouseDragDelta (button : integer = 0,)
         igResetMouseDragDelta button
     fn GetMouseClickedPos ()