Skip to content

Commit

Permalink
Merge pull request #119 from Gnimuc/merge-deps
Browse files Browse the repository at this point in the history
Merge cimgui-pack and LibCImGui.jl
  • Loading branch information
JamesWrigley committed Jun 9, 2024
2 parents 12e1d9f + b46a8e5 commit 79333c7
Show file tree
Hide file tree
Showing 31 changed files with 192,933 additions and 2 deletions.
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

0 comments on commit 79333c7

Please sign in to comment.