Skip to content

Commit 23e2331

Browse files
committed
Update for v1.92.5
1 parent 4cb0086 commit 23e2331

20 files changed

+16225
-14716
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "CImGui"
22
uuid = "5d785b6c-b76f-510e-a07c-3070796c7e87"
33
authors = ["Yupei Qi <qiyupei@gmail.com>"]
4-
version = "6.2.1"
4+
version = "7.0.0"
55

66
[deps]
77
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
@@ -23,7 +23,7 @@ MakieIntegration = ["GLFW", "ModernGL", "GLMakie"]
2323

2424
[compat]
2525
CEnum = "0.4, 0.5"
26-
CImGuiPack_jll = "0.10.0"
26+
CImGuiPack_jll = "0.11.0"
2727
CSyntax = "0.4"
2828
DocStringExtensions = "0.9.3"
2929
GLFW = "3"

docs/src/_changelog.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ CurrentModule = CImGui
66
This documents notable changes in CImGui.jl. The format is based on [Keep a
77
Changelog](https://keepachangelog.com).
88

9-
## Unreleased
9+
## [v7.0.0] - 2026-01-05
10+
11+
### Changed
12+
- **Breaking**: We updated to [Dear ImGui
13+
1.92.5](https://github.com/ocornut/imgui/releases/tag/v1.92.5) ([#189]). All
14+
the changes from 1.92.2 - 1.92.5 apply to this release.
1015

1116
### Fixed
1217
- Fixed a typo in `destroy_image_texture()` ([#185]).

examples/demo_layout.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ function ShowDemoWindowLayout()
244244
if (tab_bar_flags & CImGui.ImGuiTabBarFlags_FittingPolicyMask_) == 0
245245
tab_bar_flags |= CImGui.ImGuiTabBarFlags_FittingPolicyDefault_
246246
end
247-
result = @c CImGui.CheckboxFlags("ImGuiTabBarFlags_FittingPolicyResizeDown", &tab_bar_flags, CImGui.ImGuiTabBarFlags_FittingPolicyResizeDown)
247+
result = @c CImGui.CheckboxFlags("ImGuiTabBarFlags_FittingPolicyShrink", &tab_bar_flags, CImGui.ImGuiTabBarFlags_FittingPolicyShrink)
248248
if result != 0
249249
tab_bar_flags &= ~(CImGui.ImGuiTabBarFlags_FittingPolicyMask_ CImGui.ImGuiTabBarFlags_FittingPolicyResizeDown)
250250
end

gen/generator.jl

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import JSON3
22
using Clang.Generators
33
using Clang.JLLEnvs
44
using CImGuiPack_jll
5-
import JuliaFormatter: format_file, format_text
6-
import MacroTools: @capture, splitdef, prettify
5+
using JuliaFormatter: format_file, format_text
6+
using MacroTools: @capture, splitdef, prettify, postwalk
77

88

99
"""
@@ -319,15 +319,8 @@ function wrap_function!(methods, func_name, func_def, overloads; with_arg_types=
319319
arg_types_strs = [func_metadata[:argsT][i][:type] for i in eachindex(arg_names)]
320320

321321
args = copy(arg_names)
322-
is_pOut = false
323322

324323
for i in eachindex(args)
325-
# pOut arguments are part of cimgui and are a pointer to a return value,
326-
# to be filled in by the cimgui function.
327-
if arg_names[i] == :pOut
328-
is_pOut = true
329-
end
330-
331324
arg_type_str = arg_types_strs[i]
332325

333326
# If this is the `self` argument and this function belongs to a struct,
@@ -384,35 +377,11 @@ function wrap_function!(methods, func_name, func_def, overloads; with_arg_types=
384377
arg_names[i] = :(length($(arg_names[i - 1])))
385378
end
386379

387-
func_expr = if is_pOut
388-
ccall_info = split_ccall(func_def[:body])
389-
local pOut_type
390-
if !@capture(ccall_info.argtypes[1], Ptr{pOut_type_})
391-
@warn "Skipping '$func_name', couldn't get type of the `pOut` argument"
392-
return
393-
end
394-
395-
popfirst!(args)
396-
popfirst!(arg_names)
397-
398-
# Special-case HSV() because it should return an ImVec4 instead of an ImColor
399-
return_expr = if func_name === :ImColor_HSV
400-
:(pOut[].Value)
401-
else
402-
:(pOut[])
403-
end
404-
405-
quote
406-
function $new_identifier($(args...))
407-
pOut = Ref{$pOut_type}()
408-
$func_name(pOut, $(arg_names...))
409-
return $return_expr
410-
end
411-
end
380+
# Special-case HSV() because it should return an ImVec4 instead of an ImColor
381+
func_expr = if func_name === :ImColor_HSV
382+
:($new_identifier($(args...)) = $func_name($(arg_names...)).Value)
412383
else
413-
quote
414-
$new_identifier($(args...)) = $func_name($(arg_names...))
415-
end
384+
:($new_identifier($(args...)) = $func_name($(arg_names...)))
416385
end
417386

418387
docstring = create_docstring(func_name, func_metadata)
@@ -511,6 +480,31 @@ function get_wrappers(dag::ExprDAG)
511480
return methods
512481
end
513482

483+
function rewrite!(dag)
484+
# In newer versions of the cimgui bindings non-POD-types-that-look-like-POD-types-but-actually-aren't
485+
# are renamed to have a '_c' underscore. In the generated Julia bindings we
486+
# rename these back to their old names for the sake of convenience.
487+
# See: https://github.com/cimgui/cimgui/issues/309
488+
new2old_names = Dict{Symbol, Symbol}()
489+
for file in (:cimgui_structs_and_enums, :cimplot_structs_and_enums, :cimnodes_structs_and_enums)
490+
structs_and_enums = JSON3.read(getproperty(CImGuiPack_jll, file))
491+
nonpod_used = structs_and_enums[:nonPOD_used]
492+
merge!(new2old_names, Dict([Symbol(x, "_c") => x for x in keys(nonpod_used)]))
493+
end
494+
495+
for node in dag.nodes
496+
for i in eachindex(node.exprs)
497+
node.exprs[i] = postwalk(node.exprs[i]) do x
498+
if x isa Symbol && x in keys(new2old_names)
499+
new2old_names[x]
500+
else
501+
x
502+
end
503+
end
504+
end
505+
end
506+
end
507+
514508
function generate()
515509
cd(@__DIR__) do
516510
include_dir = joinpath(CImGuiPack_jll.artifact_dir, "include")
@@ -541,7 +535,9 @@ function generate()
541535
"-includestdbool.h")
542536

543537
ctx = create_context([cimgui_h, cimplot_h, cimnodes_h, cimgui_impl_h], args, options)
544-
build!(ctx)
538+
build!(ctx, BUILDSTAGE_NO_PRINTING)
539+
rewrite!(ctx.dag)
540+
build!(ctx, BUILDSTAGE_PRINTING_ONLY)
545541
end
546542

547543
println()

gen/generator.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ field_access_method_list = [
2121
"ImFontConfig",
2222
"ImGuiPlatformIO",
2323
"ImGuiViewport",
24-
"ImVec2",
25-
"ImVec4",
24+
"ImVec2_c",
25+
"ImVec4_c",
2626
"ImGuiPlatformMonitor",
2727
"ImGuiStyle",
2828
"ImGuiListClipper",

0 commit comments

Comments
 (0)