Skip to content

Commit a176cb9

Browse files
committed
fixup! Automatically dereference struct fields
1 parent 1a22b6c commit a176cb9

17 files changed

+68
-68
lines changed

examples/demo_window.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,14 @@ global function ShowJuliaDemoWindow(p_open::Ref{Bool})
148148
if CImGui.CollapsingHeader("Configuration")
149149
io = CImGui.GetIO()
150150
if CImGui.TreeNode("Configuration##2")
151-
CImGui.CheckboxFlags("io.ConfigFlags: NavEnableKeyboard", io.ConfigFlags, CImGui.ImGuiConfigFlags_NavEnableKeyboard)
152-
CImGui.CheckboxFlags("io.ConfigFlags: NavEnableGamepad", io.ConfigFlags, CImGui.ImGuiConfigFlags_NavEnableGamepad)
151+
CImGui.CheckboxFlags("io.ConfigFlags: NavEnableKeyboard", @ptr(io.ConfigFlags), CImGui.ImGuiConfigFlags_NavEnableKeyboard)
152+
CImGui.CheckboxFlags("io.ConfigFlags: NavEnableGamepad", @ptr(io.ConfigFlags), CImGui.ImGuiConfigFlags_NavEnableGamepad)
153153
CImGui.SameLine()
154154
CImGui.HelpMarker("Required back-end to feed in gamepad inputs in io.NavInputs[] and set io.BackendFlags |= ImGuiBackendFlags_HasGamepad.\n\nRead instructions in imgui.cpp for details.");
155-
CImGui.CheckboxFlags("io.ConfigFlags: NavEnableSetMousePos", io.ConfigFlags, CImGui.ImGuiConfigFlags_NavEnableSetMousePos)
155+
CImGui.CheckboxFlags("io.ConfigFlags: NavEnableSetMousePos", @ptr(io.ConfigFlags), CImGui.ImGuiConfigFlags_NavEnableSetMousePos)
156156
CImGui.SameLine()
157157
CImGui.HelpMarker("Instruct navigation to move the mouse cursor. See comment for ImGuiConfigFlags_NavEnableSetMousePos.")
158-
CImGui.CheckboxFlags("io.ConfigFlags: NoMouse", io.ConfigFlags, CImGui.ImGuiConfigFlags_NoMouse)
158+
CImGui.CheckboxFlags("io.ConfigFlags: NoMouse", @ptr(io.ConfigFlags), CImGui.ImGuiConfigFlags_NoMouse)
159159
if io.ConfigFlags & CImGui.ImGuiConfigFlags_NoMouse != 0 # create a way to restore this flag otherwise we could be stuck completely!
160160
if mod(CImGui.GetTime(), 0.4) < 0.2
161161
CImGui.SameLine()
@@ -165,17 +165,17 @@ global function ShowJuliaDemoWindow(p_open::Ref{Bool})
165165
io.ConfigFlags = io.ConfigFlags & ~Cuint(CImGui.ImGuiConfigFlags_NoMouse)
166166
end
167167
end
168-
CImGui.CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", io.ConfigFlags, CImGui.ImGuiConfigFlags_NoMouseCursorChange)
168+
CImGui.CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", @ptr(io.ConfigFlags), CImGui.ImGuiConfigFlags_NoMouseCursorChange)
169169
CImGui.SameLine()
170170
CImGui.HelpMarker("Instruct back-end to not alter mouse cursor shape and visibility.")
171-
CImGui.Checkbox("io.ConfigInputTextCursorBlink", io.ConfigInputTextCursorBlink)
171+
CImGui.Checkbox("io.ConfigInputTextCursorBlink", @ptr(io.ConfigInputTextCursorBlink))
172172
CImGui.SameLine()
173173
CImGui.HelpMarker("Set to false to disable blinking cursor, for users who consider it distracting")
174-
CImGui.Checkbox("io.ConfigWindowsResizeFromEdges", io.ConfigWindowsResizeFromEdges)
174+
CImGui.Checkbox("io.ConfigWindowsResizeFromEdges", @ptr(io.ConfigWindowsResizeFromEdges))
175175
CImGui.SameLine()
176176
CImGui.HelpMarker("Enable resizing of windows from their edges and from the lower-left corner.\nThis requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback.")
177-
CImGui.Checkbox("io.ConfigWindowsMoveFromTitleBarOnly", io.ConfigWindowsMoveFromTitleBarOnly)
178-
CImGui.Checkbox("io.MouseDrawCursor", io.MouseDrawCursor)
177+
CImGui.Checkbox("io.ConfigWindowsMoveFromTitleBarOnly", @ptr(io.ConfigWindowsMoveFromTitleBarOnly))
178+
CImGui.Checkbox("io.MouseDrawCursor", @ptr(io.MouseDrawCursor))
179179
CImGui.SameLine()
180180
CImGui.HelpMarker("Instruct Dear ImGui to render a mouse cursor for you. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something).")
181181
CImGui.TreePop()

examples/makie_demo.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ function makie_demo(; engine=nothing, spawn=1)
3232

3333
ctx = ig.CreateContext()
3434
io = ig.GetIO()
35-
io.ConfigFlags = unsafe_load(io.ConfigFlags) | ig.lib.ImGuiConfigFlags_DockingEnable
36-
io.ConfigFlags = unsafe_load(io.ConfigFlags) | ig.lib.ImGuiConfigFlags_ViewportsEnable
35+
io.ConfigFlags = io.ConfigFlags | ig.lib.ImGuiConfigFlags_DockingEnable
36+
io.ConfigFlags = io.ConfigFlags | ig.lib.ImGuiConfigFlags_ViewportsEnable
3737

3838
auto_resize_x = true
3939
auto_resize_y = false

lib/aarch64-apple-darwin20.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ function setbitfieldproperty!(bitfield_info, value)
3535
end
3636

3737
macro ptr(expr)
38-
if !isa(expr, Expr) || expr.head != :.
39-
error("Expression is not a property access")
38+
if !Meta.isexpr(expr, :.)
39+
error("Expression is not a property access, cannot use @ptr on it.")
4040
end
41-
41+
4242
quote
4343
local penultimate_obj = $(esc(expr.args[1]))
44-
(@__MODULE__).getptr(penultimate_obj, $(esc(expr.args[2])))
44+
getptr(penultimate_obj, $(esc(expr.args[2])))
4545
end
4646
end
4747

lib/aarch64-linux-gnu.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ function setbitfieldproperty!(bitfield_info, value)
3535
end
3636

3737
macro ptr(expr)
38-
if !isa(expr, Expr) || expr.head != :.
39-
error("Expression is not a property access")
38+
if !Meta.isexpr(expr, :.)
39+
error("Expression is not a property access, cannot use @ptr on it.")
4040
end
41-
41+
4242
quote
4343
local penultimate_obj = $(esc(expr.args[1]))
44-
(@__MODULE__).getptr(penultimate_obj, $(esc(expr.args[2])))
44+
getptr(penultimate_obj, $(esc(expr.args[2])))
4545
end
4646
end
4747

lib/aarch64-linux-musl.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ function setbitfieldproperty!(bitfield_info, value)
3535
end
3636

3737
macro ptr(expr)
38-
if !isa(expr, Expr) || expr.head != :.
39-
error("Expression is not a property access")
38+
if !Meta.isexpr(expr, :.)
39+
error("Expression is not a property access, cannot use @ptr on it.")
4040
end
41-
41+
4242
quote
4343
local penultimate_obj = $(esc(expr.args[1]))
44-
(@__MODULE__).getptr(penultimate_obj, $(esc(expr.args[2])))
44+
getptr(penultimate_obj, $(esc(expr.args[2])))
4545
end
4646
end
4747

lib/armv7l-linux-gnueabihf.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ function setbitfieldproperty!(bitfield_info, value)
3535
end
3636

3737
macro ptr(expr)
38-
if !isa(expr, Expr) || expr.head != :.
39-
error("Expression is not a property access")
38+
if !Meta.isexpr(expr, :.)
39+
error("Expression is not a property access, cannot use @ptr on it.")
4040
end
41-
41+
4242
quote
4343
local penultimate_obj = $(esc(expr.args[1]))
44-
(@__MODULE__).getptr(penultimate_obj, $(esc(expr.args[2])))
44+
getptr(penultimate_obj, $(esc(expr.args[2])))
4545
end
4646
end
4747

lib/armv7l-linux-musleabihf.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ function setbitfieldproperty!(bitfield_info, value)
3535
end
3636

3737
macro ptr(expr)
38-
if !isa(expr, Expr) || expr.head != :.
39-
error("Expression is not a property access")
38+
if !Meta.isexpr(expr, :.)
39+
error("Expression is not a property access, cannot use @ptr on it.")
4040
end
41-
41+
4242
quote
4343
local penultimate_obj = $(esc(expr.args[1]))
44-
(@__MODULE__).getptr(penultimate_obj, $(esc(expr.args[2])))
44+
getptr(penultimate_obj, $(esc(expr.args[2])))
4545
end
4646
end
4747

lib/i686-linux-gnu.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ function setbitfieldproperty!(bitfield_info, value)
3535
end
3636

3737
macro ptr(expr)
38-
if !isa(expr, Expr) || expr.head != :.
39-
error("Expression is not a property access")
38+
if !Meta.isexpr(expr, :.)
39+
error("Expression is not a property access, cannot use @ptr on it.")
4040
end
41-
41+
4242
quote
4343
local penultimate_obj = $(esc(expr.args[1]))
44-
(@__MODULE__).getptr(penultimate_obj, $(esc(expr.args[2])))
44+
getptr(penultimate_obj, $(esc(expr.args[2])))
4545
end
4646
end
4747

lib/i686-linux-musl.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ function setbitfieldproperty!(bitfield_info, value)
3535
end
3636

3737
macro ptr(expr)
38-
if !isa(expr, Expr) || expr.head != :.
39-
error("Expression is not a property access")
38+
if !Meta.isexpr(expr, :.)
39+
error("Expression is not a property access, cannot use @ptr on it.")
4040
end
41-
41+
4242
quote
4343
local penultimate_obj = $(esc(expr.args[1]))
44-
(@__MODULE__).getptr(penultimate_obj, $(esc(expr.args[2])))
44+
getptr(penultimate_obj, $(esc(expr.args[2])))
4545
end
4646
end
4747

lib/i686-w64-mingw32.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ function setbitfieldproperty!(bitfield_info, value)
3535
end
3636

3737
macro ptr(expr)
38-
if !isa(expr, Expr) || expr.head != :.
39-
error("Expression is not a property access")
38+
if !Meta.isexpr(expr, :.)
39+
error("Expression is not a property access, cannot use @ptr on it.")
4040
end
41-
41+
4242
quote
4343
local penultimate_obj = $(esc(expr.args[1]))
44-
(@__MODULE__).getptr(penultimate_obj, $(esc(expr.args[2])))
44+
getptr(penultimate_obj, $(esc(expr.args[2])))
4545
end
4646
end
4747

0 commit comments

Comments
 (0)