Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge cimgui-pack and LibCImGui.jl #119

Merged
merged 33 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0ec0472
Add cimgui
Gnimuc May 21, 2021
59f50a2
Add cimplot
Gnimuc May 21, 2021
953b19c
Add cimnodes
Gnimuc May 21, 2021
4ac1694
Add CMakeLists.txt
Gnimuc May 21, 2021
156ecc2
Add minor bugfix
Gnimuc May 21, 2021
ecc9326
Update cimplot
Gnimuc May 23, 2021
c8c0dc7
Initial commit
Gnimuc May 24, 2021
b565f68
Separate the code out of `CImGui.jl`
Gnimuc May 24, 2021
8160a17
Add README and CI
Gnimuc May 24, 2021
75ef988
Generate field access methods for `ImGuiPlatformMonitor`
Gnimuc May 26, 2021
fdf0a3d
Bump version to `1.82.1`
Gnimuc May 26, 2021
9af63ee
Generate field access methods for `ImGuiStyle`
Gnimuc May 29, 2021
f760dbd
Update submodules for ImGUI 1.89.4
JamesWrigley Aug 7, 2023
df6dcd1
Add a readme
JamesWrigley Aug 13, 2023
065b572
Update generator files
JamesWrigley Aug 9, 2023
14b0ba6
Update bindings for ImGui v1.89.4
JamesWrigley Aug 9, 2023
0e2de0a
Add updating instructions to the readme
JamesWrigley Aug 13, 2023
af96d7d
Merge pull request #1 from JamesWrigley/v1.89.4-update
JamesWrigley Aug 13, 2023
dc79173
Merge pull request #3 from JamesWrigley/imgui-update
JamesWrigley Aug 20, 2023
364717f
Bump version number to 1.89.4
JamesWrigley Aug 20, 2023
457bc31
Merge pull request #4 from JuliaImGui/v1.89.4
JamesWrigley Aug 20, 2023
bfc80a4
Bump CImGuiPack_jll to 0.2.x
Gnimuc Aug 27, 2023
82e1f8e
Merge pull request #6 from JuliaImGui/Gnimuc-patch-1
JamesWrigley Sep 2, 2023
d746bcb
Release v1.89.5
JamesWrigley Sep 3, 2023
6ae4a8b
Merge pull request #7 from JuliaImGui/v1.89.5
JamesWrigley Sep 7, 2023
5530cdd
Add 0.5 to CEnum's compat
Gnimuc Dec 24, 2023
e4ebae2
Merge pull request #8 from JuliaImGui/gn-cenum-compat
Gnimuc Dec 24, 2023
119e28a
Move LibCImGui.jl files in preparation for merging repos
JamesWrigley Jun 9, 2024
b3e212f
Merge LibCImGui.jl
JamesWrigley Jun 9, 2024
7a2d0f8
Move cimgui-pack files in preparation for merging repos
JamesWrigley Jun 9, 2024
2d81259
Merge cimgui-pack
JamesWrigley Jun 9, 2024
79db5c7
Add all manifest files to .gitignore
JamesWrigley Jun 9, 2024
b46a8e5
Dev LibCImGui.jl in CI
JamesWrigley Jun 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ permissions:
repository-projects: read
security-events: read
statuses: read

jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
Expand All @@ -30,4 +31,3 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
ssh: ${{ secrets.DOCUMENTER_KEY }}
# ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }}
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: CI

on:
- push
- pull_request

jobs:
loading:
name: Loading only - Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
Expand Down Expand Up @@ -30,11 +32,14 @@ jobs:
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- run: |
julia --project=. -e 'using Pkg; Pkg.develop(PackageSpec(path="LibCImGui.jl"))'
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

tests:
name: Tests - Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
Expand All @@ -54,6 +59,8 @@ jobs:
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- run: |
julia --project=. -e 'using Pkg; Pkg.develop(PackageSpec(path="LibCImGui.jl"))'
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
with:
Expand All @@ -63,6 +70,7 @@ jobs:
- uses: julia-actions/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

docs:
name: Documentation
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
*.jl.mem
*.ini
imgui_log.txt
.vscode
.vscode
*Manifest.toml
build
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "cimgui"]
path = cimgui-pack/cimgui
url = https://github.com/cimgui/cimgui.git
[submodule "cimplot"]
path = cimgui-pack/cimplot
url = https://github.com/cimgui/cimplot.git
[submodule "cimnodes"]
path = cimgui-pack/cimnodes
url = https://github.com/cimgui/cimnodes.git
21 changes: 21 additions & 0 deletions LibCImGui.jl/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Yupei Qi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
19 changes: 19 additions & 0 deletions LibCImGui.jl/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name = "LibCImGui"
uuid = "9be01004-c4f5-478b-abeb-cb32b114cf5e"
authors = ["Yupei Qi <[email protected]>"]
version = "1.89.5"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
CImGuiPack_jll = "333409e9-af72-5310-9767-d6ad21a76a05"

[compat]
CEnum = "0.4,0.5"
CImGuiPack_jll = "~0.2"
julia = "1.6"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
36 changes: 36 additions & 0 deletions LibCImGui.jl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# LibCImGui

[![CI](https://github.com/JuliaImGui/LibCImGui.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/JuliaImGui/LibCImGui.jl/actions/workflows/ci.yml)
[![TagBot](https://github.com/JuliaImGui/LibCImGui.jl/actions/workflows/TagBot.yml/badge.svg)](https://github.com/JuliaImGui/LibCImGui.jl/actions/workflows/TagBot.yml)
[![Coverage](https://codecov.io/gh/JuliaImGui/LibCImGui.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaImGui/LibCImGui.jl)

Julia language binding for [cimgui](https://github.com/cimgui/cimgui)(docking
branch), [cimplot](https://github.com/cimgui/cimplot), and
[cimnodes](https://github.com/cimgui/cimnodes).

The code the bindings are generated from come from the
[CImGuiPack](https://github.com/JuliaPackaging/Yggdrasil/tree/master/C/CImGuiPack)
JLL, which is built from the
[cimgui-pack](https://github.com/JuliaImGui/cimgui-pack) repo. Note that the
versioning of this repo *does not* exactly match upstream Dear ImGui, we only
match the major and minor version. The patch version is specific to
LibCImGui.jl. See the release notes for the exact Dear ImGui version used for
each LibCImGui.jl release.

## Installation
```
pkg> add LibCImGui
```

If you are looking for a high-level Julian API you might wish to take a look at [CImGui.jl](https://github.com/Gnimuc/CImGui.jl).

## Updating
The bindings for the different platforms in [lib/](lib/) are generated by the
files in [gen/](gen/). To update the bindings you'll first need to update
`CImGuiPack_jll`, then run:
```
julia --project=gen generator.jl
```

The first time might take a while since it has to download artifacts for each
platform.
9 changes: 9 additions & 0 deletions LibCImGui.jl/gen/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
CImGuiPack_jll = "333409e9-af72-5310-9767-d6ad21a76a05"
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"

[compat]
CEnum = "0.2,0.3,0.4"
CImGuiPack_jll = "~0.1"
Clang = "0.17"
25 changes: 25 additions & 0 deletions LibCImGui.jl/gen/generator.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Clang.Generators
using Clang.JLLEnvs
using CImGuiPack_jll

cd(@__DIR__)

include_dir = joinpath(CImGuiPack_jll.artifact_dir, "include")

cimgui_h = joinpath(include_dir, "cimgui.h") |> normpath
cimplot_h = joinpath(include_dir, "cimplot.h") |> normpath
cimnodes_h = joinpath(include_dir, "cimnodes.h") |> normpath

for target in JLLEnvs.JLL_ENV_TRIPLES
@info "processing $target"

options = load_options(joinpath(@__DIR__, "generator.toml"))
options["general"]["output_file_path"] = joinpath(@__DIR__, "..", "lib", "$target.jl")

args = get_default_args(target)
push!(args, "-I$include_dir", "-DCIMGUI_DEFINE_ENUMS_AND_STRUCTS")

ctx = create_context([cimgui_h, cimplot_h, cimnodes_h], args, options)

build!(ctx)
end
28 changes: 28 additions & 0 deletions LibCImGui.jl/gen/generator.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[general]
library_name = "libcimgui"

output_ignorelist = [
"API",
"EXTERN",
"CIMGUI_API",
"CONST",
"CIMGUI_INCLUDED",
]

[codegen]
field_access_method_list = [
"ImGuiIO",
"ImDrawList",
"ImDrawData",
"ImDrawCmd",
"ImFontAtlas",
"ImGuiSizeCallbackData",
"ImFontConfig",
"ImGuiPlatformIO",
"ImGuiViewport",
"ImVec2",
"ImVec4",
"ImGuiPlatformMonitor",
"ImGuiStyle",
]
wrap_variadic_function = true
Loading
Loading