diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e12a8d..a4a63c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: version: - - '1.4' + - '1.5' os: - ubuntu-latest - macOS-latest @@ -43,7 +43,7 @@ jobs: - run: sudo apt-get install xvfb && Xvfb :99 & - uses: julia-actions/setup-julia@v1 with: - version: '1.4' + version: '1.5' - run: | julia --project=docs -e ' using Pkg diff --git a/.travis.yml b/.travis.yml index c18b9e7..29a51eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ os: - osx - windows julia: - - 1.3 + - 1.4 - nightly matrix: allow_failures: diff --git a/Project.toml b/Project.toml index 103a17e..631f9d2 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "CImGui" uuid = "5d785b6c-b76f-510e-a07c-3070796c7e87" authors = ["Gnimuc "] -version = "1.77.1" +version = "1.78.0" [deps] CImGui_jll = "7dd61d3b-0da5-5c94-bbf9-a0296c6e3925" @@ -11,7 +11,7 @@ Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" ModernGL = "66fc600b-dfda-50eb-8b99-91cfa97b1301" [compat] -CImGui_jll = "~1.77.0" +CImGui_jll = "~1.78.0" CSyntax = "0.4.0" GLFW = "3.2.0,3.3.0,3.4.0" ModernGL = "1.1.0" diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..d23dac6 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,5 @@ +comment: false +coverage: + status: + project: off + patch: off \ No newline at end of file diff --git a/examples/demo_widgets.jl b/examples/demo_widgets.jl index 056ac3d..1cdafb5 100644 --- a/examples/demo_widgets.jl +++ b/examples/demo_widgets.jl @@ -118,7 +118,7 @@ function ShowDemoWindowWidgets() ShowHelpMarker("CTRL+click to input value.") @c CImGui.SliderFloat("slider float", &f1, 0.0, 1.0, "ratio = %.3f") - @c CImGui.SliderFloat("slider float (curve)", &f2, -10.0, 10.0, "%.4f", 2.0) + @c CImGui.SliderFloat("slider float (log)", &f2, -10.0, 10.0, "%.4f", CImGui.ImGuiSliderFlags_Logarithmic) @c CImGui.SliderAngle("slider angle", &angle) end diff --git a/gen/libcimgui_api.jl b/gen/libcimgui_api.jl index 6d49c98..7cabc32 100644 --- a/gen/libcimgui_api.jl +++ b/gen/libcimgui_api.jl @@ -518,30 +518,6 @@ function igTextUnformatted(text, text_end) ccall((:igTextUnformatted, libcimgui), Cvoid, (Cstring, Cstring), text, text_end) end -function igText(text) - ccall((:igText, libcimgui), Cvoid, (Cstring,), text) -end - -function igTextColored(col, text) - ccall((:igTextColored, libcimgui), Cvoid, (ImVec4, Cstring), col, text) -end - -function igTextDisabled(text) - ccall((:igTextDisabled, libcimgui), Cvoid, (Cstring,), text) -end - -function igTextWrapped(text) - ccall((:igTextWrapped, libcimgui), Cvoid, (Cstring,), text) -end - -function igLabelText(label, text) - ccall((:igLabelText, libcimgui), Cvoid, (Cstring, Cstring), label, text) -end - -function igBulletText(text) - ccall((:igBulletText, libcimgui), Cvoid, (Cstring,), text) -end - function igButton(label, size) ccall((:igButton, libcimgui), Bool, (Cstring, ImVec2), label, size) end @@ -550,8 +526,8 @@ function igSmallButton(label) ccall((:igSmallButton, libcimgui), Bool, (Cstring,), label) end -function igInvisibleButton(str_id, size) - ccall((:igInvisibleButton, libcimgui), Bool, (Cstring, ImVec2), str_id, size) +function igInvisibleButton(str_id, size, flags) + ccall((:igInvisibleButton, libcimgui), Bool, (Cstring, ImVec2, ImGuiButtonFlags), str_id, size, flags) end function igArrowButton(str_id, dir) @@ -606,112 +582,112 @@ function igComboStr(label, current_item, items_separated_by_zeros, popup_max_hei ccall((:igComboStr, libcimgui), Bool, (Cstring, Ptr{Cint}, Ptr{UInt8}, Cint), label, current_item, items_separated_by_zeros, popup_max_height_in_items) end -function igComboFnPtr(label, current_item, items_getter, data, items_count, popup_max_height_in_items) - ccall((:igComboFnPtr, libcimgui), Bool, (Cstring, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cvoid}, Cint, Cint), label, current_item, items_getter, data, items_count, popup_max_height_in_items) +function igComboFnBoolPtr(label, current_item, items_getter, data, items_count, popup_max_height_in_items) + ccall((:igComboFnBoolPtr, libcimgui), Bool, (Cstring, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cvoid}, Cint, Cint), label, current_item, items_getter, data, items_count, popup_max_height_in_items) end -function igDragFloat(label, v, v_speed, v_min, v_max, format, power) - ccall((:igDragFloat, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cfloat, Cstring, Cfloat), label, v, v_speed, v_min, v_max, format, power) +function igDragFloat(label, v, v_speed, v_min, v_max, format, flags) + ccall((:igDragFloat, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cfloat, Cstring, ImGuiSliderFlags), label, v, v_speed, v_min, v_max, format, flags) end -function igDragFloat2(label, v, v_speed, v_min, v_max, format, power) - ccall((:igDragFloat2, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cfloat, Cstring, Cfloat), label, v, v_speed, v_min, v_max, format, power) +function igDragFloat2(label, v, v_speed, v_min, v_max, format, flags) + ccall((:igDragFloat2, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cfloat, Cstring, ImGuiSliderFlags), label, v, v_speed, v_min, v_max, format, flags) end -function igDragFloat3(label, v, v_speed, v_min, v_max, format, power) - ccall((:igDragFloat3, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cfloat, Cstring, Cfloat), label, v, v_speed, v_min, v_max, format, power) +function igDragFloat3(label, v, v_speed, v_min, v_max, format, flags) + ccall((:igDragFloat3, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cfloat, Cstring, ImGuiSliderFlags), label, v, v_speed, v_min, v_max, format, flags) end -function igDragFloat4(label, v, v_speed, v_min, v_max, format, power) - ccall((:igDragFloat4, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cfloat, Cstring, Cfloat), label, v, v_speed, v_min, v_max, format, power) +function igDragFloat4(label, v, v_speed, v_min, v_max, format, flags) + ccall((:igDragFloat4, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cfloat, Cstring, ImGuiSliderFlags), label, v, v_speed, v_min, v_max, format, flags) end -function igDragFloatRange2(label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max, power) - ccall((:igDragFloatRange2, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Ptr{Cfloat}, Cfloat, Cfloat, Cfloat, Cstring, Cstring, Cfloat), label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max, power) +function igDragFloatRange2(label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max, flags) + ccall((:igDragFloatRange2, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Ptr{Cfloat}, Cfloat, Cfloat, Cfloat, Cstring, Cstring, ImGuiSliderFlags), label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max, flags) end -function igDragInt(label, v, v_speed, v_min, v_max, format) - ccall((:igDragInt, libcimgui), Bool, (Cstring, Ptr{Cint}, Cfloat, Cint, Cint, Cstring), label, v, v_speed, v_min, v_max, format) +function igDragInt(label, v, v_speed, v_min, v_max, format, flags) + ccall((:igDragInt, libcimgui), Bool, (Cstring, Ptr{Cint}, Cfloat, Cint, Cint, Cstring, ImGuiSliderFlags), label, v, v_speed, v_min, v_max, format, flags) end -function igDragInt2(label, v, v_speed, v_min, v_max, format) - ccall((:igDragInt2, libcimgui), Bool, (Cstring, Ptr{Cint}, Cfloat, Cint, Cint, Cstring), label, v, v_speed, v_min, v_max, format) +function igDragInt2(label, v, v_speed, v_min, v_max, format, flags) + ccall((:igDragInt2, libcimgui), Bool, (Cstring, Ptr{Cint}, Cfloat, Cint, Cint, Cstring, ImGuiSliderFlags), label, v, v_speed, v_min, v_max, format, flags) end -function igDragInt3(label, v, v_speed, v_min, v_max, format) - ccall((:igDragInt3, libcimgui), Bool, (Cstring, Ptr{Cint}, Cfloat, Cint, Cint, Cstring), label, v, v_speed, v_min, v_max, format) +function igDragInt3(label, v, v_speed, v_min, v_max, format, flags) + ccall((:igDragInt3, libcimgui), Bool, (Cstring, Ptr{Cint}, Cfloat, Cint, Cint, Cstring, ImGuiSliderFlags), label, v, v_speed, v_min, v_max, format, flags) end -function igDragInt4(label, v, v_speed, v_min, v_max, format) - ccall((:igDragInt4, libcimgui), Bool, (Cstring, Ptr{Cint}, Cfloat, Cint, Cint, Cstring), label, v, v_speed, v_min, v_max, format) +function igDragInt4(label, v, v_speed, v_min, v_max, format, flags) + ccall((:igDragInt4, libcimgui), Bool, (Cstring, Ptr{Cint}, Cfloat, Cint, Cint, Cstring, ImGuiSliderFlags), label, v, v_speed, v_min, v_max, format, flags) end -function igDragIntRange2(label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max) - ccall((:igDragIntRange2, libcimgui), Bool, (Cstring, Ptr{Cint}, Ptr{Cint}, Cfloat, Cint, Cint, Cstring, Cstring), label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max) +function igDragIntRange2(label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max, flags) + ccall((:igDragIntRange2, libcimgui), Bool, (Cstring, Ptr{Cint}, Ptr{Cint}, Cfloat, Cint, Cint, Cstring, Cstring, ImGuiSliderFlags), label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max, flags) end -function igDragScalar(label, data_type, p_data, v_speed, p_min, p_max, format, power) - ccall((:igDragScalar, libcimgui), Bool, (Cstring, ImGuiDataType, Ptr{Cvoid}, Cfloat, Ptr{Cvoid}, Ptr{Cvoid}, Cstring, Cfloat), label, data_type, p_data, v_speed, p_min, p_max, format, power) +function igDragScalar(label, data_type, p_data, v_speed, p_min, p_max, format, flags) + ccall((:igDragScalar, libcimgui), Bool, (Cstring, ImGuiDataType, Ptr{Cvoid}, Cfloat, Ptr{Cvoid}, Ptr{Cvoid}, Cstring, ImGuiSliderFlags), label, data_type, p_data, v_speed, p_min, p_max, format, flags) end -function igDragScalarN(label, data_type, p_data, components, v_speed, p_min, p_max, format, power) - ccall((:igDragScalarN, libcimgui), Bool, (Cstring, ImGuiDataType, Ptr{Cvoid}, Cint, Cfloat, Ptr{Cvoid}, Ptr{Cvoid}, Cstring, Cfloat), label, data_type, p_data, components, v_speed, p_min, p_max, format, power) +function igDragScalarN(label, data_type, p_data, components, v_speed, p_min, p_max, format, flags) + ccall((:igDragScalarN, libcimgui), Bool, (Cstring, ImGuiDataType, Ptr{Cvoid}, Cint, Cfloat, Ptr{Cvoid}, Ptr{Cvoid}, Cstring, ImGuiSliderFlags), label, data_type, p_data, components, v_speed, p_min, p_max, format, flags) end -function igSliderFloat(label, v, v_min, v_max, format, power) - ccall((:igSliderFloat, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cstring, Cfloat), label, v, v_min, v_max, format, power) +function igSliderFloat(label, v, v_min, v_max, format, flags) + ccall((:igSliderFloat, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cstring, ImGuiSliderFlags), label, v, v_min, v_max, format, flags) end -function igSliderFloat2(label, v, v_min, v_max, format, power) - ccall((:igSliderFloat2, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cstring, Cfloat), label, v, v_min, v_max, format, power) +function igSliderFloat2(label, v, v_min, v_max, format, flags) + ccall((:igSliderFloat2, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cstring, ImGuiSliderFlags), label, v, v_min, v_max, format, flags) end -function igSliderFloat3(label, v, v_min, v_max, format, power) - ccall((:igSliderFloat3, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cstring, Cfloat), label, v, v_min, v_max, format, power) +function igSliderFloat3(label, v, v_min, v_max, format, flags) + ccall((:igSliderFloat3, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cstring, ImGuiSliderFlags), label, v, v_min, v_max, format, flags) end -function igSliderFloat4(label, v, v_min, v_max, format, power) - ccall((:igSliderFloat4, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cstring, Cfloat), label, v, v_min, v_max, format, power) +function igSliderFloat4(label, v, v_min, v_max, format, flags) + ccall((:igSliderFloat4, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cstring, ImGuiSliderFlags), label, v, v_min, v_max, format, flags) end -function igSliderAngle(label, v_rad, v_degrees_min, v_degrees_max, format) - ccall((:igSliderAngle, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cstring), label, v_rad, v_degrees_min, v_degrees_max, format) +function igSliderAngle(label, v_rad, v_degrees_min, v_degrees_max, format, flags) + ccall((:igSliderAngle, libcimgui), Bool, (Cstring, Ptr{Cfloat}, Cfloat, Cfloat, Cstring, ImGuiSliderFlags), label, v_rad, v_degrees_min, v_degrees_max, format, flags) end -function igSliderInt(label, v, v_min, v_max, format) - ccall((:igSliderInt, libcimgui), Bool, (Cstring, Ptr{Cint}, Cint, Cint, Cstring), label, v, v_min, v_max, format) +function igSliderInt(label, v, v_min, v_max, format, flags) + ccall((:igSliderInt, libcimgui), Bool, (Cstring, Ptr{Cint}, Cint, Cint, Cstring, ImGuiSliderFlags), label, v, v_min, v_max, format, flags) end -function igSliderInt2(label, v, v_min, v_max, format) - ccall((:igSliderInt2, libcimgui), Bool, (Cstring, Ptr{Cint}, Cint, Cint, Cstring), label, v, v_min, v_max, format) +function igSliderInt2(label, v, v_min, v_max, format, flags) + ccall((:igSliderInt2, libcimgui), Bool, (Cstring, Ptr{Cint}, Cint, Cint, Cstring, ImGuiSliderFlags), label, v, v_min, v_max, format, flags) end -function igSliderInt3(label, v, v_min, v_max, format) - ccall((:igSliderInt3, libcimgui), Bool, (Cstring, Ptr{Cint}, Cint, Cint, Cstring), label, v, v_min, v_max, format) +function igSliderInt3(label, v, v_min, v_max, format, flags) + ccall((:igSliderInt3, libcimgui), Bool, (Cstring, Ptr{Cint}, Cint, Cint, Cstring, ImGuiSliderFlags), label, v, v_min, v_max, format, flags) end -function igSliderInt4(label, v, v_min, v_max, format) - ccall((:igSliderInt4, libcimgui), Bool, (Cstring, Ptr{Cint}, Cint, Cint, Cstring), label, v, v_min, v_max, format) +function igSliderInt4(label, v, v_min, v_max, format, flags) + ccall((:igSliderInt4, libcimgui), Bool, (Cstring, Ptr{Cint}, Cint, Cint, Cstring, ImGuiSliderFlags), label, v, v_min, v_max, format, flags) end -function igSliderScalar(label, data_type, p_data, p_min, p_max, format, power) - ccall((:igSliderScalar, libcimgui), Bool, (Cstring, ImGuiDataType, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Cstring, Cfloat), label, data_type, p_data, p_min, p_max, format, power) +function igSliderScalar(label, data_type, p_data, p_min, p_max, format, flags) + ccall((:igSliderScalar, libcimgui), Bool, (Cstring, ImGuiDataType, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Cstring, ImGuiSliderFlags), label, data_type, p_data, p_min, p_max, format, flags) end -function igSliderScalarN(label, data_type, p_data, components, p_min, p_max, format, power) - ccall((:igSliderScalarN, libcimgui), Bool, (Cstring, ImGuiDataType, Ptr{Cvoid}, Cint, Ptr{Cvoid}, Ptr{Cvoid}, Cstring, Cfloat), label, data_type, p_data, components, p_min, p_max, format, power) +function igSliderScalarN(label, data_type, p_data, components, p_min, p_max, format, flags) + ccall((:igSliderScalarN, libcimgui), Bool, (Cstring, ImGuiDataType, Ptr{Cvoid}, Cint, Ptr{Cvoid}, Ptr{Cvoid}, Cstring, ImGuiSliderFlags), label, data_type, p_data, components, p_min, p_max, format, flags) end -function igVSliderFloat(label, size, v, v_min, v_max, format, power) - ccall((:igVSliderFloat, libcimgui), Bool, (Cstring, ImVec2, Ptr{Cfloat}, Cfloat, Cfloat, Cstring, Cfloat), label, size, v, v_min, v_max, format, power) +function igVSliderFloat(label, size, v, v_min, v_max, format, flags) + ccall((:igVSliderFloat, libcimgui), Bool, (Cstring, ImVec2, Ptr{Cfloat}, Cfloat, Cfloat, Cstring, ImGuiSliderFlags), label, size, v, v_min, v_max, format, flags) end -function igVSliderInt(label, size, v, v_min, v_max, format) - ccall((:igVSliderInt, libcimgui), Bool, (Cstring, ImVec2, Ptr{Cint}, Cint, Cint, Cstring), label, size, v, v_min, v_max, format) +function igVSliderInt(label, size, v, v_min, v_max, format, flags) + ccall((:igVSliderInt, libcimgui), Bool, (Cstring, ImVec2, Ptr{Cint}, Cint, Cint, Cstring, ImGuiSliderFlags), label, size, v, v_min, v_max, format, flags) end -function igVSliderScalar(label, size, data_type, p_data, p_min, p_max, format, power) - ccall((:igVSliderScalar, libcimgui), Bool, (Cstring, ImVec2, ImGuiDataType, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Cstring, Cfloat), label, size, data_type, p_data, p_min, p_max, format, power) +function igVSliderScalar(label, size, data_type, p_data, p_min, p_max, format, flags) + ccall((:igVSliderScalar, libcimgui), Bool, (Cstring, ImVec2, ImGuiDataType, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Cstring, ImGuiSliderFlags), label, size, data_type, p_data, p_min, p_max, format, flags) end function igInputText(label, buf, buf_size, flags, callback, user_data) @@ -798,26 +774,10 @@ function igTreeNodeStr(label) ccall((:igTreeNodeStr, libcimgui), Bool, (Cstring,), label) end -function igTreeNodeStrStr(str_id, text) - ccall((:igTreeNodeStrStr, libcimgui), Bool, (Cstring, Cstring), str_id, text) -end - -function igTreeNodePtr(ptr_id, text) - ccall((:igTreeNodePtr, libcimgui), Bool, (Ptr{Cvoid}, Cstring), ptr_id, text) -end - function igTreeNodeExStr(label, flags) ccall((:igTreeNodeExStr, libcimgui), Bool, (Cstring, ImGuiTreeNodeFlags), label, flags) end -function igTreeNodeExStrStr(str_id, flags, text) - ccall((:igTreeNodeExStrStr, libcimgui), Bool, (Cstring, ImGuiTreeNodeFlags, Cstring), str_id, flags, text) -end - -function igTreeNodeExPtr(ptr_id, flags, text) - ccall((:igTreeNodeExPtr, libcimgui), Bool, (Ptr{Cvoid}, ImGuiTreeNodeFlags, Cstring), ptr_id, flags, text) -end - function igTreePushStr(str_id) ccall((:igTreePushStr, libcimgui), Cvoid, (Cstring,), str_id) end @@ -946,14 +906,6 @@ function igEndTooltip() ccall((:igEndTooltip, libcimgui), Cvoid, ()) end -function igSetTooltip(text) - ccall((:igSetTooltip, libcimgui), Cvoid, (Cstring,), text) -end - -function igOpenPopup(str_id) - ccall((:igOpenPopup, libcimgui), Cvoid, (Cstring,), str_id) -end - function igBeginPopup(str_id, flags) ccall((:igBeginPopup, libcimgui), Bool, (Cstring, ImGuiWindowFlags), str_id, flags) end @@ -1066,10 +1018,6 @@ function igLogButtons() ccall((:igLogButtons, libcimgui), Cvoid, ()) end -function igLogText(text) - ccall((:igLogText, libcimgui), Cvoid, (Cstring,), text) -end - function igBeginDragDropSource(flags) ccall((:igBeginDragDropSource, libcimgui), Bool, (ImGuiDragDropFlags,), flags) end @@ -1222,10 +1170,6 @@ function igGetStateStorage() ccall((:igGetStateStorage, libcimgui), Ptr{ImGuiStorage}, ()) end -function igCalcTextSize(text, text_end, hide_text_after_double_hash, wrap_width) - ccall((:igCalcTextSize, libcimgui), ImVec2, (Cstring, Cstring, Bool, Cfloat), text, text_end, hide_text_after_double_hash, wrap_width) -end - function igCalcListClipping(items_count, items_height, out_items_display_start, out_items_display_end) ccall((:igCalcListClipping, libcimgui), Cvoid, (Cint, Cfloat, Ptr{Cint}, Ptr{Cint}), items_count, items_height, out_items_display_start, out_items_display_end) end @@ -2206,8 +2150,8 @@ function ImFont_GrowIndex(self, new_size) ccall((:ImFont_GrowIndex, libcimgui), Cvoid, (Ptr{ImFont}, Cint), self, new_size) end -function ImFont_AddGlyph(self, c, x0, y0, x1, y1, u0, v0, u1, v1, advance_x) - ccall((:ImFont_AddGlyph, libcimgui), Cvoid, (Ptr{ImFont}, ImWchar, Cfloat, Cfloat, Cfloat, Cfloat, Cfloat, Cfloat, Cfloat, Cfloat, Cfloat), self, c, x0, y0, x1, y1, u0, v0, u1, v1, advance_x) +function ImFont_AddGlyph(self, src_cfg, c, x0, y0, x1, y1, u0, v0, u1, v1, advance_x) + ccall((:ImFont_AddGlyph, libcimgui), Cvoid, (Ptr{ImFont}, Ptr{ImFontConfig}, ImWchar, Cfloat, Cfloat, Cfloat, Cfloat, Cfloat, Cfloat, Cfloat, Cfloat, Cfloat), self, src_cfg, c, x0, y0, x1, y1, u0, v0, u1, v1, advance_x) end function ImFont_AddRemapChar(self, dst, src, overwrite_dst) @@ -2374,6 +2318,30 @@ function igImPowdouble(x, y) ccall((:igImPowdouble, libcimgui), Cdouble, (Cdouble, Cdouble), x, y) end +function igImLogFloat(x) + ccall((:igImLogFloat, libcimgui), Cfloat, (Cfloat,), x) +end + +function igImLogdouble(x) + ccall((:igImLogdouble, libcimgui), Cdouble, (Cdouble,), x) +end + +function igImAbsFloat(x) + ccall((:igImAbsFloat, libcimgui), Cfloat, (Cfloat,), x) +end + +function igImAbsdouble(x) + ccall((:igImAbsdouble, libcimgui), Cdouble, (Cdouble,), x) +end + +function igImSignFloat(x) + ccall((:igImSignFloat, libcimgui), Cfloat, (Cfloat,), x) +end + +function igImSigndouble(x) + ccall((:igImSigndouble, libcimgui), Cdouble, (Cdouble,), x) +end + function igImMin(pOut, lhs, rhs) ccall((:igImMin, libcimgui), Cvoid, (Ptr{ImVec2}, ImVec2, ImVec2), pOut, lhs, rhs) end @@ -2934,20 +2902,20 @@ function ImGuiWindow_MenuBarRect(pOut, self) ccall((:ImGuiWindow_MenuBarRect, libcimgui), Cvoid, (Ptr{ImRect}, Ptr{ImGuiWindow}), pOut, self) end -function ImGuiItemHoveredDataBackup_ImGuiItemHoveredDataBackup() - ccall((:ImGuiItemHoveredDataBackup_ImGuiItemHoveredDataBackup, libcimgui), Ptr{ImGuiItemHoveredDataBackup}, ()) +function ImGuiLastItemDataBackup_ImGuiLastItemDataBackup() + ccall((:ImGuiLastItemDataBackup_ImGuiLastItemDataBackup, libcimgui), Ptr{ImGuiLastItemDataBackup}, ()) end -function ImGuiItemHoveredDataBackup_destroy(self) - ccall((:ImGuiItemHoveredDataBackup_destroy, libcimgui), Cvoid, (Ptr{ImGuiItemHoveredDataBackup},), self) +function ImGuiLastItemDataBackup_destroy(self) + ccall((:ImGuiLastItemDataBackup_destroy, libcimgui), Cvoid, (Ptr{ImGuiLastItemDataBackup},), self) end -function ImGuiItemHoveredDataBackup_Backup(self) - ccall((:ImGuiItemHoveredDataBackup_Backup, libcimgui), Cvoid, (Ptr{ImGuiItemHoveredDataBackup},), self) +function ImGuiLastItemDataBackup_Backup(self) + ccall((:ImGuiLastItemDataBackup_Backup, libcimgui), Cvoid, (Ptr{ImGuiLastItemDataBackup},), self) end -function ImGuiItemHoveredDataBackup_Restore(self) - ccall((:ImGuiItemHoveredDataBackup_Restore, libcimgui), Cvoid, (Ptr{ImGuiItemHoveredDataBackup},), self) +function ImGuiLastItemDataBackup_Restore(self) + ccall((:ImGuiLastItemDataBackup_Restore, libcimgui), Cvoid, (Ptr{ImGuiLastItemDataBackup},), self) end function ImGuiTabItem_ImGuiTabItem() @@ -3022,6 +2990,10 @@ function igSetWindowCollapsedWindowPtr(window, collapsed, cond) ccall((:igSetWindowCollapsedWindowPtr, libcimgui), Cvoid, (Ptr{ImGuiWindow}, Bool, ImGuiCond), window, collapsed, cond) end +function igSetWindowHitTestHole(window, pos, size) + ccall((:igSetWindowHitTestHole, libcimgui), Cvoid, (Ptr{ImGuiWindow}, ImVec2, ImVec2), window, pos, size) +end + function igFocusWindow(window) ccall((:igFocusWindow, libcimgui), Cvoid, (Ptr{ImGuiWindow},), window) end @@ -3198,6 +3170,10 @@ function igIsClippedEx(bb, id, clip_even_when_logged) ccall((:igIsClippedEx, libcimgui), Bool, (ImRect, ImGuiID, Bool), bb, id, clip_even_when_logged) end +function igSetLastItemData(window, item_id, status_flags, item_rect) + ccall((:igSetLastItemData, libcimgui), Cvoid, (Ptr{ImGuiWindow}, ImGuiID, ImGuiItemStatusFlags, ImRect), window, item_id, status_flags, item_rect) +end + function igFocusableItemRegister(window, id) ccall((:igFocusableItemRegister, libcimgui), Bool, (Ptr{ImGuiWindow}, ImGuiID), window, id) end @@ -3530,6 +3506,10 @@ function igRenderRectFilledRangeH(draw_list, rect, col, x_start_norm, x_end_norm ccall((:igRenderRectFilledRangeH, libcimgui), Cvoid, (Ptr{ImDrawList}, ImRect, ImU32, Cfloat, Cfloat, Cfloat), draw_list, rect, col, x_start_norm, x_end_norm, rounding) end +function igRenderRectFilledWithHole(draw_list, outer, inner, col, rounding) + ccall((:igRenderRectFilledWithHole, libcimgui), Cvoid, (Ptr{ImDrawList}, ImRect, ImRect, ImU32, Cfloat), draw_list, outer, inner, col, rounding) +end + function igTextEx(text, text_end, flags) ccall((:igTextEx, libcimgui), Cvoid, (Cstring, Cstring, ImGuiTextFlags), text, text_end, flags) end @@ -3582,12 +3562,12 @@ function igButtonBehavior(bb, id, out_hovered, out_held, flags) ccall((:igButtonBehavior, libcimgui), Bool, (ImRect, ImGuiID, Ptr{Bool}, Ptr{Bool}, ImGuiButtonFlags), bb, id, out_hovered, out_held, flags) end -function igDragBehavior(id, data_type, p_v, v_speed, p_min, p_max, format, power, flags) - ccall((:igDragBehavior, libcimgui), Bool, (ImGuiID, ImGuiDataType, Ptr{Cvoid}, Cfloat, Ptr{Cvoid}, Ptr{Cvoid}, Cstring, Cfloat, ImGuiDragFlags), id, data_type, p_v, v_speed, p_min, p_max, format, power, flags) +function igDragBehavior(id, data_type, p_v, v_speed, p_min, p_max, format, flags) + ccall((:igDragBehavior, libcimgui), Bool, (ImGuiID, ImGuiDataType, Ptr{Cvoid}, Cfloat, Ptr{Cvoid}, Ptr{Cvoid}, Cstring, ImGuiSliderFlags), id, data_type, p_v, v_speed, p_min, p_max, format, flags) end -function igSliderBehavior(bb, id, data_type, p_v, p_min, p_max, format, power, flags, out_grab_bb) - ccall((:igSliderBehavior, libcimgui), Bool, (ImRect, ImGuiID, ImGuiDataType, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Cstring, Cfloat, ImGuiSliderFlags, Ptr{ImRect}), bb, id, data_type, p_v, p_min, p_max, format, power, flags, out_grab_bb) +function igSliderBehavior(bb, id, data_type, p_v, p_min, p_max, format, flags, out_grab_bb) + ccall((:igSliderBehavior, libcimgui), Bool, (ImRect, ImGuiID, ImGuiDataType, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}, Cstring, ImGuiSliderFlags, Ptr{ImRect}), bb, id, data_type, p_v, p_min, p_max, format, flags, out_grab_bb) end function igSplitterBehavior(bb, id, axis, size1, size2, min_size1, min_size2, hover_extend, hover_visibility_delay) @@ -3706,6 +3686,10 @@ function igImFontAtlasBuildFinish(atlas) ccall((:igImFontAtlasBuildFinish, libcimgui), Cvoid, (Ptr{ImFontAtlas},), atlas) end +function igImFontAtlasBuildRender1bppRectFromString(atlas, atlas_x, atlas_y, w, h, in_str, in_marker_char, in_marker_pixel_value) + ccall((:igImFontAtlasBuildRender1bppRectFromString, libcimgui), Cvoid, (Ptr{ImFontAtlas}, Cint, Cint, Cint, Cint, Cstring, UInt8, Cuchar), atlas, atlas_x, atlas_y, w, h, in_str, in_marker_char, in_marker_pixel_value) +end + function igImFontAtlasBuildMultiplyCalcLookupTable(out_table, in_multiply_factor) ccall((:igImFontAtlasBuildMultiplyCalcLookupTable, libcimgui), Cvoid, (Ptr{Cuchar}, Cfloat), out_table, in_multiply_factor) end diff --git a/gen/libcimgui_common.jl b/gen/libcimgui_common.jl index 49513f6..76779af 100644 --- a/gen/libcimgui_common.jl +++ b/gen/libcimgui_common.jl @@ -4,6 +4,7 @@ # Skipping MacroDefinition: API __attribute__ ( ( __visibility__ ( "default" ) ) ) const ImGuiLayoutType = Cint const ImGuiItemFlags = Cint + const ImGuiID = UInt32 struct ImGuiStoragePair @@ -83,19 +84,19 @@ end const ImFontAtlasFlags = Cint const ImTextureID = Ptr{Cvoid} -struct ImVector_ImFontPtr{ImFont_} +struct ImVector_ImFontPtr Size::Cint Capacity::Cint - Data::Ptr{Ptr{ImFont_}} + Data::Ptr{Ptr{Cvoid}} # Ptr{Ptr{ImFont}} end -struct ImVector_ImFontAtlasCustomRect{_ImFontAtlasCustomRect} +struct ImVector_ImFontAtlasCustomRect Size::Cint Capacity::Cint - Data::Ptr{_ImFontAtlasCustomRect} + Data::Ptr{Cvoid} # Ptr{ImFontAtlasCustomRect} end -struct ImFontConfig{ImFont_} +struct ImFontConfig FontData::Ptr{Cvoid} FontDataSize::Cint FontDataOwnedByAtlas::Bool @@ -114,7 +115,7 @@ struct ImFontConfig{ImFont_} RasterizerMultiply::Cfloat EllipsisChar::ImWchar Name::NTuple{40, UInt8} - DstFont::Ptr{ImFont_} + DstFont::Ptr{Cvoid} # Ptr{ImFont} end struct ImVector_ImFontConfig @@ -123,6 +124,13 @@ struct ImVector_ImFontConfig Data::Ptr{ImFontConfig} end +struct ImVec4 + x::Cfloat + y::Cfloat + z::Cfloat + w::Cfloat +end + struct ImFontAtlas Locked::Bool Flags::ImFontAtlasFlags @@ -138,7 +146,9 @@ struct ImFontAtlas Fonts::ImVector_ImFontPtr CustomRects::ImVector_ImFontAtlasCustomRect ConfigData::ImVector_ImFontConfig - CustomRectIds::NTuple{1, Cint} + TexUvLines::NTuple{64, ImVec4} + PackIdMouseCursors::Cint + PackIdLines::Cint end struct ImFont @@ -173,13 +183,6 @@ struct ImFontAtlasCustomRect Font::Ptr{ImFont} end -struct ImVec4 - x::Cfloat - y::Cfloat - z::Cfloat - w::Cfloat -end - struct ImGuiWindowSettings ID::ImGuiID Pos::ImVec2ih @@ -305,7 +308,7 @@ struct ImGuiColumns HostCursorMaxPosX::Cfloat HostInitialClipRect::ImRect HostBackupClipRect::ImRect - HostWorkRect::ImRect + HostBackupParentWorkRect::ImRect Columns::ImVector_ImGuiColumnData Splitter::ImDrawListSplitter end @@ -340,6 +343,7 @@ struct ImDrawListSharedData InitialFlags::ImDrawListFlags ArcFastVtx::NTuple{12, ImVec2} CircleSegmentCounts::NTuple{64, ImU8} + TexUvLines::Ptr{ImVec4} end struct ImVector_ImVec4 @@ -377,7 +381,8 @@ struct ImDrawList _Splitter::ImDrawListSplitter end - +const ImGuiLayoutType = Cint +const ImGuiItemFlags = Cint struct ImVector_ImGuiItemFlags Size::Cint @@ -385,12 +390,6 @@ struct ImVector_ImGuiItemFlags Data::Ptr{ImGuiItemFlags} end -struct ImVector_ImGuiWindowPtr - Size::Cint - Capacity::Cint - Data::Ptr{Ptr{Cvoid}} # Ptr{Ptr{ImGuiWindow}} -end - struct ImGuiGroupData BackupCursorPos::ImVec2 BackupCursorMaxPos::ImVec2 @@ -409,6 +408,12 @@ struct ImVector_ImGuiGroupData Data::Ptr{ImGuiGroupData} end +struct ImVector_ImGuiWindowPtr + Size::Cint + Capacity::Cint + Data::Ptr{Ptr{Cvoid}} # Ptr{Ptr{ImGuiWindow}} +end + struct ImGuiWindowTempData CursorPos::ImVec2 CursorPosPrevLine::ImVec2 @@ -509,8 +514,11 @@ struct ImGuiWindow InnerRect::ImRect InnerClipRect::ImRect WorkRect::ImRect + ParentWorkRect::ImRect ClipRect::ImRect ContentRegionRect::ImRect + HitTestHoleSize::ImVec2ih + HitTestHoleOffset::ImVec2ih LastFrameActive::Cint LastTimeActive::Cfloat ItemWidthDefault::Cfloat @@ -532,17 +540,22 @@ struct ImGuiWindow MemoryDrawListVtxCapacity::Cint end + + + const ImGuiTabItemFlags = Cint +const ImS16 = Int16 struct ImGuiTabItem ID::ImGuiID Flags::ImGuiTabItemFlags LastFrameVisible::Cint LastFrameSelected::Cint - NameOffset::Cint Offset::Cfloat Width::Cfloat ContentWidth::Cfloat + NameOffset::ImS16 + WantClose::Bool end struct ImVector_ImGuiTabItem @@ -659,7 +672,7 @@ struct ImGuiNavMoveResult RectRel::ImRect end -struct ImGuiItemHoveredDataBackup +struct ImGuiLastItemDataBackup LastItemId::ImGuiID LastItemStatusFlags::ImGuiItemStatusFlags LastItemRect::ImRect @@ -789,6 +802,7 @@ struct ImGuiStyle ScrollbarRounding::Cfloat GrabMinSize::Cfloat GrabRounding::Cfloat + LogSliderDeadzone::Cfloat TabRounding::Cfloat TabBorderSize::Cfloat TabMinWidthForUnselectedCloseButton::Cfloat @@ -799,6 +813,7 @@ struct ImGuiStyle DisplaySafeAreaPadding::ImVec2 MouseCursorScale::Cfloat AntiAliasedLines::Bool + AntiAliasedLinesUseTex::Bool AntiAliasedFill::Bool CurveTessellationTol::Cfloat CircleSegmentMaxError::Cfloat @@ -1082,13 +1097,15 @@ struct ImGuiContext CurrentWindow::Ptr{ImGuiWindow} HoveredWindow::Ptr{ImGuiWindow} HoveredRootWindow::Ptr{ImGuiWindow} + HoveredWindowUnderMovingWindow::Ptr{ImGuiWindow} MovingWindow::Ptr{ImGuiWindow} WheelingWindow::Ptr{ImGuiWindow} WheelingWindowRefMousePos::ImVec2 WheelingWindowTimer::Cfloat HoveredId::ImGuiID - HoveredIdAllowOverlap::Bool HoveredIdPreviousFrame::ImGuiID + HoveredIdAllowOverlap::Bool + HoveredIdDisabled::Bool HoveredIdTimer::Cfloat HoveredIdNotActiveTimer::Cfloat ActiveId::ImGuiID @@ -1096,6 +1113,7 @@ struct ImGuiContext ActiveIdTimer::Cfloat ActiveIdIsJustActivated::Bool ActiveIdAllowOverlap::Bool + ActiveIdNoClearOnFocusLoss::Bool ActiveIdHasBeenPressedBefore::Bool ActiveIdHasBeenEditedBefore::Bool ActiveIdHasBeenEditedThisFrame::Bool @@ -1207,6 +1225,8 @@ struct ImGuiContext ColorEditLastSat::Cfloat ColorEditLastColor::NTuple{3, Cfloat} ColorPickerRef::ImVec4 + SliderCurrentAccum::Cfloat + SliderCurrentAccumDirty::Bool DragCurrentAccumDirty::Bool DragCurrentAccum::Cfloat DragSpeedDefaultRatio::Cfloat @@ -1253,23 +1273,21 @@ const ImGuiDataType = Cint const ImGuiNavInput = Cint const ImGuiMouseButton = Cint const ImDrawCornerFlags = Cint +const ImGuiButtonFlags = Cint const ImGuiComboFlags = Cint const ImGuiFocusedFlags = Cint const ImGuiHoveredFlags = Cint const ImGuiPopupFlags = Cint const ImGuiSelectableFlags = Cint +const ImGuiSliderFlags = Cint const ImGuiTreeNodeFlags = Cint const ImWchar32 = UInt32 -const ImS16 = Int16 const ImU16 = UInt16 const ImS32 = Cint const ImS64 = Int64 -const ImGuiButtonFlags = Cint -const ImGuiDragFlags = Cint const ImGuiNavHighlightFlags = Cint const ImGuiNavDirSourceFlags = Cint const ImGuiSeparatorFlags = Cint -const ImGuiSliderFlags = Cint const ImGuiTextFlags = Cint const ImGuiTooltipFlags = Cint @@ -1640,6 +1658,15 @@ end ImGuiStyleVar_COUNT = 23 end +@cenum ImGuiButtonFlags_::UInt32 begin + ImGuiButtonFlags_None = 0 + ImGuiButtonFlags_MouseButtonLeft = 1 + ImGuiButtonFlags_MouseButtonRight = 2 + ImGuiButtonFlags_MouseButtonMiddle = 4 + ImGuiButtonFlags_MouseButtonMask_ = 7 + ImGuiButtonFlags_MouseButtonDefault_ = 1 +end + @cenum ImGuiColorEditFlags_::UInt32 begin ImGuiColorEditFlags_None = 0 ImGuiColorEditFlags_NoAlpha = 2 @@ -1672,6 +1699,15 @@ end ImGuiColorEditFlags__InputMask = 402653184 end +@cenum ImGuiSliderFlags_::UInt32 begin + ImGuiSliderFlags_None = 0 + ImGuiSliderFlags_ClampOnInput = 16 + ImGuiSliderFlags_Logarithmic = 32 + ImGuiSliderFlags_NoRoundToFormat = 64 + ImGuiSliderFlags_NoInput = 128 + ImGuiSliderFlags_InvalidMask_ = 1879048207 +end + @cenum ImGuiMouseButton_::UInt32 begin ImGuiMouseButton_Left = 0 ImGuiMouseButton_Right = 1 @@ -1717,14 +1753,16 @@ end @cenum ImDrawListFlags_::UInt32 begin ImDrawListFlags_None = 0 ImDrawListFlags_AntiAliasedLines = 1 - ImDrawListFlags_AntiAliasedFill = 2 - ImDrawListFlags_AllowVtxOffset = 4 + ImDrawListFlags_AntiAliasedLinesUseTex = 2 + ImDrawListFlags_AntiAliasedFill = 4 + ImDrawListFlags_AllowVtxOffset = 8 end @cenum ImFontAtlasFlags_::UInt32 begin ImFontAtlasFlags_None = 0 ImFontAtlasFlags_NoPowerOfTwoHeight = 1 ImFontAtlasFlags_NoMouseCursors = 2 + ImFontAtlasFlags_NoBakedLines = 4 end @cenum ImGuiItemFlags_::UInt32 begin @@ -1736,6 +1774,7 @@ end ImGuiItemFlags_NoNavDefaultFocus = 16 ImGuiItemFlags_SelectableDontClosePopup = 32 ImGuiItemFlags_MixedValue = 64 + ImGuiItemFlags_ReadOnly = 128 ImGuiItemFlags_Default_ = 0 end @@ -1750,42 +1789,30 @@ end ImGuiItemStatusFlags_Deactivated = 64 end -@cenum ImGuiButtonFlags_::UInt32 begin - ImGuiButtonFlags_None = 0 - ImGuiButtonFlags_Repeat = 1 - ImGuiButtonFlags_PressedOnClick = 2 - ImGuiButtonFlags_PressedOnClickRelease = 4 - ImGuiButtonFlags_PressedOnClickReleaseAnywhere = 8 - ImGuiButtonFlags_PressedOnRelease = 16 - ImGuiButtonFlags_PressedOnDoubleClick = 32 - ImGuiButtonFlags_PressedOnDragDropHold = 64 - ImGuiButtonFlags_FlattenChildren = 128 - ImGuiButtonFlags_AllowItemOverlap = 256 - ImGuiButtonFlags_DontClosePopups = 512 - ImGuiButtonFlags_Disabled = 1024 - ImGuiButtonFlags_AlignTextBaseLine = 2048 - ImGuiButtonFlags_NoKeyModifiers = 4096 - ImGuiButtonFlags_NoHoldingActiveId = 8192 - ImGuiButtonFlags_NoNavFocus = 16384 - ImGuiButtonFlags_NoHoveredOnFocus = 32768 - ImGuiButtonFlags_MouseButtonLeft = 65536 - ImGuiButtonFlags_MouseButtonRight = 131072 - ImGuiButtonFlags_MouseButtonMiddle = 262144 - ImGuiButtonFlags_MouseButtonMask_ = 458752 - ImGuiButtonFlags_MouseButtonShift_ = 16 - ImGuiButtonFlags_MouseButtonDefault_ = 65536 - ImGuiButtonFlags_PressedOnMask_ = 126 - ImGuiButtonFlags_PressedOnDefault_ = 4 -end - -@cenum ImGuiSliderFlags_::UInt32 begin - ImGuiSliderFlags_None = 0 - ImGuiSliderFlags_Vertical = 1 -end - -@cenum ImGuiDragFlags_::UInt32 begin - ImGuiDragFlags_None = 0 - ImGuiDragFlags_Vertical = 1 +@cenum ImGuiButtonFlagsPrivate_::UInt32 begin + ImGuiButtonFlags_PressedOnClick = 16 + ImGuiButtonFlags_PressedOnClickRelease = 32 + ImGuiButtonFlags_PressedOnClickReleaseAnywhere = 64 + ImGuiButtonFlags_PressedOnRelease = 128 + ImGuiButtonFlags_PressedOnDoubleClick = 256 + ImGuiButtonFlags_PressedOnDragDropHold = 512 + ImGuiButtonFlags_Repeat = 1024 + ImGuiButtonFlags_FlattenChildren = 2048 + ImGuiButtonFlags_AllowItemOverlap = 4096 + ImGuiButtonFlags_DontClosePopups = 8192 + ImGuiButtonFlags_Disabled = 16384 + ImGuiButtonFlags_AlignTextBaseLine = 32768 + ImGuiButtonFlags_NoKeyModifiers = 65536 + ImGuiButtonFlags_NoHoldingActiveId = 131072 + ImGuiButtonFlags_NoNavFocus = 262144 + ImGuiButtonFlags_NoHoveredOnFocus = 524288 + ImGuiButtonFlags_PressedOnMask_ = 1008 + ImGuiButtonFlags_PressedOnDefault_ = 32 +end + +@cenum ImGuiSliderFlagsPrivate_::UInt32 begin + ImGuiSliderFlags_Vertical = 1048576 + ImGuiSliderFlags_ReadOnly = 2097152 end @cenum ImGuiSelectableFlagsPrivate_::UInt32 begin @@ -1916,3 +1943,4 @@ end @cenum ImGuiTabItemFlagsPrivate_::UInt32 begin ImGuiTabItemFlags_NoCloseButton = 1048576 end + diff --git a/src/LibCImGui.jl b/src/LibCImGui.jl index 955b28d..c187a6d 100644 --- a/src/LibCImGui.jl +++ b/src/LibCImGui.jl @@ -13,6 +13,7 @@ export Ctm, Ctime_t, Cclock_t include(joinpath(@__DIR__, "..", "gen", "libcimgui_common.jl")) include(joinpath(@__DIR__, "..", "gen", "libcimgui_api.jl")) include(joinpath(@__DIR__, "..", "gen", "libhelper_api.jl")) +include(joinpath(@__DIR__, "libcimgui_patch.jl")) foreach(names(@__MODULE__, all=true)) do s if startswith(string(s), "ig") || startswith(string(s), "Im") diff --git a/src/libcimgui_patch.jl b/src/libcimgui_patch.jl new file mode 100644 index 0000000..aed6d02 --- /dev/null +++ b/src/libcimgui_patch.jl @@ -0,0 +1,52 @@ +# should be reimplement as macros by using Julia 1.5's @ccall macro +function igText(text) + ccall((:igText, libcimgui), Cvoid, (Cstring,), text) +end + +function igTextColored(col, text) + ccall((:igTextColored, libcimgui), Cvoid, (ImVec4, Cstring), col, text) +end + +function igTextDisabled(text) + ccall((:igTextDisabled, libcimgui), Cvoid, (Cstring,), text) +end + +function igTextWrapped(text) + ccall((:igTextWrapped, libcimgui), Cvoid, (Cstring,), text) +end + +function igLabelText(label, text) + ccall((:igLabelText, libcimgui), Cvoid, (Cstring, Cstring), label, text) +end + +function igBulletText(text) + ccall((:igBulletText, libcimgui), Cvoid, (Cstring,), text) +end + +function igTreeNodeStrStr(str_id, text) + ccall((:igTreeNodeStrStr, libcimgui), Bool, (Cstring, Cstring), str_id, text) +end + +function igTreeNodePtr(ptr_id, text) + ccall((:igTreeNodePtr, libcimgui), Bool, (Ptr{Cvoid}, Cstring), ptr_id, text) +end + +function igTreeNodeExStrStr(str_id, flags, text) + ccall((:igTreeNodeExStrStr, libcimgui), Bool, (Cstring, ImGuiTreeNodeFlags, Cstring), str_id, flags, text) +end + +function igTreeNodeExPtr(ptr_id, flags, text) + ccall((:igTreeNodeExPtr, libcimgui), Bool, (Ptr{Cvoid}, ImGuiTreeNodeFlags, Cstring), ptr_id, flags, text) +end + +function igSetTooltip(text) + ccall((:igSetTooltip, libcimgui), Cvoid, (Cstring,), text) +end + +function igOpenPopup(str_id) + ccall((:igOpenPopup, libcimgui), Cvoid, (Cstring,), str_id) +end + +function igLogText(text) + ccall((:igLogText, libcimgui), Cvoid, (Cstring,), text) +end diff --git a/src/wrapper.jl b/src/wrapper.jl index 2066b80..8aefa29 100644 --- a/src/wrapper.jl +++ b/src/wrapper.jl @@ -1096,12 +1096,12 @@ with `FramePadding=(0,0)` to easily embed within text. SmallButton(label) = igSmallButton(label) """ - InvisibleButton(str_id, size) -> Bool + InvisibleButton(str_id, size, flag = 0) -> Bool Return true when the value has been changed or when pressed/selected. -Create a button without the visuals, useful to build custom behaviors using the public api -along with [`IsItemActive`](@ref), [`IsItemHovered`](@ref), etc. +Flexible button behavior without the visuals, frequently useful to build custom behaviors using +the public api along with [`IsItemActive`](@ref), [`IsItemHovered`](@ref), etc. """ -InvisibleButton(str_id, size) = igInvisibleButton(str_id, size) +InvisibleButton(str_id, size, flag = 0) = igInvisibleButton(str_id, size, flag) """ ArrowButton(str_id, dir) -> Bool @@ -1193,79 +1193,86 @@ Combo(label, current_item, items_separated_by_zeros, popup_max_height_in_items=- """ Combo(label, current_item, items_getter::Union{Ptr,Base.CFunction}, data, items_count, popup_max_height_in_items=-1) -> Bool """ -Combo(label, current_item, items_getter::Union{Ptr,Base.CFunction}, data, items_count, popup_max_height_in_items=-1) = igComboFnPtr(label, current_item, items_getter, data, items_count, popup_max_height_in_items) +Combo(label, current_item, items_getter::Union{Ptr,Base.CFunction}, data, items_count, popup_max_height_in_items=-1) = igComboFnBoolPtr(label, current_item, items_getter, data, items_count, popup_max_height_in_items) ###################################### Widgets: Drags ###################################### """ - DragFloat(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", power=1.0) -> Bool + DragFloat(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", flag=0) -> Bool If `v_min` >= `v_max` we have no bound. """ -DragFloat(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", power=1.0) = igDragFloat(label, v, v_speed, v_min, v_max, format, power) +DragFloat(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", flag=0) = igDragFloat(label, v, v_speed, v_min, v_max, format, flag) +@deprecate DragFloat(label, v, v_speed, v_min, v_max, format, power::AbstractFloat) DragFloat(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", flag=0) """ - DragFloat2(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", power=1.0) -> Bool + DragFloat2(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", flag=0) -> Bool The expected number of elements to be accessible in `v` is 2. """ -DragFloat2(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", power=1.0) = igDragFloat2(label, v, v_speed, v_min, v_max, format, power) +DragFloat2(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", flag=0) = igDragFloat2(label, v, v_speed, v_min, v_max, format, flag) +@deprecate DragFloat2(label, v, v_speed, v_min, v_max, format, power::AbstractFloat) DragFloat2(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", flag=0) """ - DragFloat3(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", power=1.0) -> Bool + DragFloat3(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", flag=0) -> Bool The expected number of elements to be accessible in `v` is 3. """ -DragFloat3(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", power=1.0) = igDragFloat3(label, v, v_speed, v_min, v_max, format, power) +DragFloat3(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", flag=0) = igDragFloat3(label, v, v_speed, v_min, v_max, format, flag) +@deprecate DragFloat3(label, v, v_speed, v_min, v_max, format, power::AbstractFloat) DragFloat3(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", flag=0) """ - DragFloat4(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", power=1.0) -> Bool + DragFloat4(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", flag=0) -> Bool The expected number of elements to be accessible in `v` is 4. """ -DragFloat4(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", power=1.0) = igDragFloat4(label, v, v_speed, v_min, v_max, format, power) +DragFloat4(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", flag=0) = igDragFloat4(label, v, v_speed, v_min, v_max, format, flag) +@deprecate DragFloat4(label, v, v_speed, v_min, v_max, format, power::AbstractFloat) DragFloat4(label, v, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", flag=0) """ - DragFloatRange2(label, v_current_min, v_current_max, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", format_max=C_NULL, power=1.0) -> Bool + DragFloatRange2(label, v_current_min, v_current_max, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", format_max=C_NULL, flag=0) -> Bool """ -DragFloatRange2(label, v_current_min, v_current_max, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", format_max=C_NULL, power=1.0) = igDragFloatRange2(label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max, power) +DragFloatRange2(label, v_current_min, v_current_max, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", format_max=C_NULL, flag=0) = igDragFloatRange2(label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max, flag) +@deprecate DragFloatRange2(label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max, power::AbstractFloat) DragFloatRange2(label, v_current_min, v_current_max, v_speed=1.0, v_min=0.0, v_max=0.0, format="%.3f", format_max=C_NULL, flag=0) """ - DragInt(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d") + DragInt(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d", flag=0) """ -DragInt(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d") = igDragInt(label, v, v_speed, v_min, v_max, format) +DragInt(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d", flag=0) = igDragInt(label, v, v_speed, v_min, v_max, format, flag) """ - DragInt2(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d") + DragInt2(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d", flag=0) The expected number of elements to be accessible in `v` is 2. """ -DragInt2(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d") = igDragInt2(label, v, v_speed, v_min, v_max, format) +DragInt2(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d", flag=0) = igDragInt2(label, v, v_speed, v_min, v_max, format, flag) """ - DragInt3(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d") + DragInt3(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d", flag=0) The expected number of elements to be accessible in `v` is 3. """ -DragInt3(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d") = igDragInt3(label, v, v_speed, v_min, v_max, format) +DragInt3(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d", flag=0) = igDragInt3(label, v, v_speed, v_min, v_max, format, flag) """ - DragInt4(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d") + DragInt4(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d", flag=0) The expected number of elements to be accessible in `v` is 4. """ -DragInt4(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d") = igDragInt4(label, v, v_speed, v_min, v_max, format) +DragInt4(label, v, v_speed=1.0, v_min=0, v_max=0, format="%d", flag=0) = igDragInt4(label, v, v_speed, v_min, v_max, format, flag) """ - DragIntRange2(label, v_current_min, v_current_max, v_speed=1.0, v_min=0, v_max=0, format="%d", format_max=C_NULL) + DragIntRange2(label, v_current_min, v_current_max, v_speed=1.0, v_min=0, v_max=0, format="%d", format_max=C_NULL, flag=0) """ -DragIntRange2(label, v_current_min, v_current_max, v_speed=1.0, v_min=0, v_max=0, format="%d", format_max=C_NULL) = igDragIntRange2(label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max) +DragIntRange2(label, v_current_min, v_current_max, v_speed=1.0, v_min=0, v_max=0, format="%d", format_max=C_NULL, flag=0) = igDragIntRange2(label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max, flag) """ - DragScalar(label, data_type, v, v_speed, v_min=C_NULL, v_max=C_NULL, format=C_NULL, power=1.0) + DragScalar(label, data_type, v, v_speed, v_min=C_NULL, v_max=C_NULL, format=C_NULL, flags=0) """ -DragScalar(label, data_type, v, v_speed, v_min=C_NULL, v_max=C_NULL, format=C_NULL, power=1.0) = igDragScalar(label, data_type, v, v_speed, v_min, v_max, format, power) +DragScalar(label, data_type, v, v_speed, v_min=C_NULL, v_max=C_NULL, format=C_NULL, flags=0) = igDragScalar(label, data_type, v, v_speed, v_min, v_max, format, flag) +@deprecate DragScalar(label, data_type, v, v_speed, v_min, v_max, format, power::AbstractFloat) DragScalar(label, data_type, v, v_speed, v_min=C_NULL, v_max=C_NULL, format=C_NULL, flags=0) """ - DragScalarN(label, data_type, v, components, v_speed, v_min=C_NULL, v_max=C_NULL, format=C_NULL, power=1.0) + DragScalarN(label, data_type, v, components, v_speed, v_min=C_NULL, v_max=C_NULL, format=C_NULL, flag=0) """ -DragScalarN(label, data_type, v, components, v_speed, v_min=C_NULL, v_max=C_NULL, format=C_NULL, power=1.0) = igDragScalarN(label, data_type, v, components, v_speed, v_min, v_max, format, power) +DragScalarN(label, data_type, v, components, v_speed, v_min=C_NULL, v_max=C_NULL, format=C_NULL, flag=0) = igDragScalarN(label, data_type, v, components, v_speed, v_min, v_max, format, flag) +@deprecate DragScalarN(label, data_type, v, components, v_speed, v_min, v_max, format, power::AbstractFloat) DragScalarN(label, data_type, v, components, v_speed, v_min=C_NULL, v_max=C_NULL, format=C_NULL, flag=0) ##################################### Widgets: Sliders ##################################### """ - SliderFloat(label, v, v_min, v_max, format="%.3f", power=1.0) -> Bool + SliderFloat(label, v, v_min, v_max, format="%.3f", flag=0) -> Bool Create a slider widget. !!! tip @@ -1276,80 +1283,87 @@ Create a slider widget. * "%.3f" -> 1.234 * "%5.2f secs" -> 01.23 secs * "Biscuit: %.0f" -> Biscuit: 1 -- `power`: use `power != 1.0` for power curve sliders """ -SliderFloat(label, v, v_min, v_max, format="%.3f", power=1.0) = igSliderFloat(label, v, v_min, v_max, format, power) +SliderFloat(label, v, v_min, v_max, format="%.3f", flag=0) = igSliderFloat(label, v, v_min, v_max, format, flag) +@deprecate SliderFloat(label, v, v_min, v_max, format, power::AbstractFloat) SliderFloat(label, v, v_min, v_max, format, 0) """ - SliderFloat2(label, v, v_min, v_max, format="%.3f", power=1.0) -> Bool + SliderFloat2(label, v, v_min, v_max, format="%.3f", flag=0) -> Bool The expected number of elements to be accessible in `v` is 2. """ -SliderFloat2(label, v, v_min, v_max, format="%.3f", power=1.0) = igSliderFloat2(label, v, v_min, v_max, format, power) +SliderFloat2(label, v, v_min, v_max, format="%.3f", flag=0) = igSliderFloat2(label, v, v_min, v_max, format, flag) +@deprecate SliderFloat2(label, v, v_min, v_max, format, power::AbstractFloat) SliderFloat2(label, v, v_min, v_max, format, 0) """ - SliderFloat3(label, v, v_min, v_max, format="%.3f", power=1.0) -> Bool + SliderFloat3(label, v, v_min, v_max, format="%.3f", flag=0) -> Bool The expected number of elements to be accessible in `v` is 3. """ -SliderFloat3(label, v, v_min, v_max, format="%.3f", power=1.0) = igSliderFloat3(label, v, v_min, v_max, format, power) +SliderFloat3(label, v, v_min, v_max, format="%.3f", flag=0) = igSliderFloat3(label, v, v_min, v_max, format, flag) +@deprecate SliderFloat3(label, v, v_min, v_max, format, power::AbstractFloat) SliderFloat3(label, v, v_min, v_max, format, 0) """ - SliderFloat4(label, v, v_min, v_max, format="%.3f", power=1.0) -> Bool + SliderFloat4(label, v, v_min, v_max, format="%.3f", flag=0) -> Bool The expected number of elements to be accessible in `v` is 4. """ -SliderFloat4(label, v, v_min, v_max, format="%.3f", power=1.0) = igSliderFloat4(label, v, v_min, v_max, format, power) +SliderFloat4(label, v, v_min, v_max, format="%.3f", flag=0) = igSliderFloat4(label, v, v_min, v_max, format, flag) +@deprecate SliderFloat4(label, v, v_min, v_max, format, power::AbstractFloat) SliderFloat4(label, v, v_min, v_max, format, 0) """ - SliderAngle(label, v_rad, v_degrees_min=-360.0, v_degrees_max=360.0, format="%.0f deg") -> Bool + SliderAngle(label, v_rad, v_degrees_min=-360.0, v_degrees_max=360.0, format="%.0f deg", flags=0) -> Bool """ -SliderAngle(label, v_rad, v_degrees_min=-360.0, v_degrees_max=360.0, format="%.0f deg") = igSliderAngle(label, v_rad, v_degrees_min, v_degrees_max, format) +SliderAngle(label, v_rad, v_degrees_min=-360.0, v_degrees_max=360.0, format="%.0f deg", flags=0) = igSliderAngle(label, v_rad, v_degrees_min, v_degrees_max, format, flags) """ - SliderInt(label, v, v_min, v_max, format="%d") -> Bool + SliderInt(label, v, v_min, v_max, format="%d", flags=0) -> Bool """ -SliderInt(label, v, v_min, v_max, format="%d") = igSliderInt(label, v, v_min, v_max, format) +SliderInt(label, v, v_min, v_max, format="%d", flags=0) = igSliderInt(label, v, v_min, v_max, format, flags) """ - SliderInt2(label, v, v_min, v_max, format="%d") -> Bool + SliderInt2(label, v, v_min, v_max, format="%d", flags=0) -> Bool The expected number of elements to be accessible in `v` is 2. """ -SliderInt2(label, v, v_min, v_max, format="%d") = igSliderInt2(label, v, v_min, v_max, format) +SliderInt2(label, v, v_min, v_max, format="%d", flags=0) = igSliderInt2(label, v, v_min, v_max, format, flags) """ - SliderInt3(label, v, v_min, v_max, format="%d") -> Bool + SliderInt3(label, v, v_min, v_max, format="%d", flags=0) -> Bool The expected number of elements to be accessible in `v` is 3. """ -SliderInt3(label, v, v_min, v_max, format="%d") = igSliderInt3(label, v, v_min, v_max, format) +SliderInt3(label, v, v_min, v_max, format="%d", flags=0) = igSliderInt3(label, v, v_min, v_max, format, flags) """ - SliderInt4(label, v, v_min, v_max, format="%d") -> Bool + SliderInt4(label, v, v_min, v_max, format="%d", flags=0) -> Bool The expected number of elements to be accessible in `v` is 4. """ -SliderInt4(label, v, v_min, v_max, format="%d") = igSliderInt4(label, v, v_min, v_max, format) +SliderInt4(label, v, v_min, v_max, format="%d", flags=0) = igSliderInt4(label, v, v_min, v_max, format, flags) """ - SliderScalar(label, data_type, v, v_min, v_max, format=C_NULL, power=1.0) -> Bool + SliderScalar(label, data_type, v, v_min, v_max, format=C_NULL, flag=0) -> Bool """ -SliderScalar(label, data_type, v, v_min, v_max, format=C_NULL, power=1.0) = igSliderScalar(label, data_type, v, v_min, v_max, format, power) +SliderScalar(label, data_type, v, v_min, v_max, format=C_NULL, flag=0) = igSliderScalar(label, data_type, v, v_min, v_max, format, flag) +@deprecate SliderScalar(label, data_type, v, v_min, v_max, format, power::AbstractFloat) SliderScalar(label, data_type, v, v_min, v_max, format, 0) """ - SliderScalarN(label, data_type, v, components, v_min, v_max, format=C_NULL, power=1.0) -> Bool + SliderScalarN(label, data_type, v, components, v_min, v_max, format=C_NULL, flag=0) -> Bool """ -SliderScalarN(label, data_type, v, components, v_min, v_max, format=C_NULL, power=1.0) = igSliderScalarN(label, data_type, v, components, v_min, v_max, format, power) +SliderScalarN(label, data_type, v, components, v_min, v_max, format=C_NULL, flag=0) = igSliderScalarN(label, data_type, v, components, v_min, v_max, format, flag) +@deprecate SliderScalarN(label, data_type, v, components, v_min, v_max, format, power::AbstractFloat) SliderScalarN(label, data_type, v, components, v_min, v_max, format, 0) """ - VSliderFloat(label, size, v, v_min, v_max, format="%.3f", power=1.0) -> Bool + VSliderFloat(label, size, v, v_min, v_max, format="%.3f", flag=0) -> Bool """ -VSliderFloat(label, size, v, v_min, v_max, format="%.3f", power=1.0) = igVSliderFloat(label, size, v, v_min, v_max, format, power) +VSliderFloat(label, size, v, v_min, v_max, format="%.3f", flag=0) = igVSliderFloat(label, size, v, v_min, v_max, format, flag) +@deprecate VSliderFloat(label, size, v, v_min, v_max, format, power::AbstractFloat) VSliderFloat(label, size, v, v_min, v_max, format, 0) """ - VSliderInt(label, size, v, v_min, v_max, format="%d") -> Bool + VSliderInt(label, size, v, v_min, v_max, format="%d", flag=0) -> Bool """ -VSliderInt(label, size, v, v_min, v_max, format="%d") = igVSliderInt(label, size, v, v_min, v_max, format) +VSliderInt(label, size, v, v_min, v_max, format="%d", flag=0) = igVSliderInt(label, size, v, v_min, v_max, format, flag) """ - VSliderScalar(label, size, data_type, v, v_min, v_max, format=C_NULL, power=1.0) -> Bool + VSliderScalar(label, size, data_type, v, v_min, v_max, format=C_NULL, flag=0) -> Bool """ -VSliderScalar(label, size, data_type, v, v_min, v_max, format=C_NULL, power=1.0) = igVSliderScalar(label, size, data_type, v, v_min, v_max, format, power) +VSliderScalar(label, size, data_type, v, v_min, v_max, format=C_NULL, flag=0) = igVSliderScalar(label, size, data_type, v, v_min, v_max, format, flag) +@deprecate VSliderScalar(label, size, data_type, v, v_min, v_max, format, power::AbstractFloat) VSliderScalar(label, size, data_type, v, v_min, v_max, format, 0) ############################### Widgets: Input with Keyboard ############################### """