-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from JuliaImGui/cimgui2
CImGui 2 files
- Loading branch information
Showing
53 changed files
with
7,055 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
build | ||
*Manifest.toml | ||
test_engine/ImGuiTestEngine | ||
test_engine/config.toml | ||
test_engine/jlImGuiTestEngine-report.txt | ||
test_engine/src/overrides.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[deps] | ||
CxxWrap = "1f15a43c-97ca-5a2a-ae31-89f07a497df4" | ||
GLFW_jll = "0656b61e-2033-5cc2-a64a-77c0f6c09b89" | ||
WrapIt = "962878d8-9763-11ee-8c14-fbf60c98afae" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import WrapIt: wrapit | ||
import CxxWrap | ||
import GLFW_jll | ||
|
||
|
||
cxxwrap_prefix = CxxWrap.prefix_path() | ||
|
||
# Generate the imgui_test_engine wrappers | ||
cd(joinpath(@__DIR__, "test_engine")) do | ||
# Write the config file from the template | ||
config = read("config.template.toml", String) | ||
new_config = replace(config, | ||
"{CXXWRAP_INCLUDE_DIR}" => joinpath(cxxwrap_prefix, "include"), | ||
"{JULIA_INCLUDE_DIR}" => joinpath(dirname(Sys.BINDIR), "include/julia")) | ||
write("config.toml", new_config) | ||
|
||
rm("src/overrides.h"; force=true) | ||
wrapit("config.toml"; force=true, verbosity=0) | ||
end | ||
|
||
cd(@__DIR__) do | ||
if !isdir("build") | ||
mkdir("build") | ||
end | ||
|
||
cp("test_engine/overrides.h", "test_engine/src/overrides.h"; force=true) | ||
|
||
cd("build") do | ||
run(`cmake -DCMAKE_BUILD_TYPE=Release | ||
-DGLFW_LIBRARY=$(GLFW_jll.libglfw) | ||
-DCMAKE_PREFIX_PATH=$(cxxwrap_prefix) ..`) | ||
nprocs = Sys.CPU_THREADS | ||
run(`cmake --build . -j$(nprocs)`) | ||
end | ||
end |
Submodule cimgui
updated
23 files
+3 −3 | .github/workflows/build.yml | |
+2 −2 | CMakeLists.txt | |
+8 −0 | Makefile | |
+7 −4 | README.md | |
+480 −213 | cimgui.cpp | |
+815 −473 | cimgui.h | |
+4 −0 | generator/cimgui_template.h | |
+139 −54 | generator/cpp2ffi.lua | |
+2 −2 | generator/generator.bat | |
+20 −6 | generator/generator.lua | |
+59 −7 | generator/generator.sh | |
+6 −1 | generator/output/cimgui_impl.h | |
+3,654 −1,921 | generator/output/definitions.json | |
+3,482 −2,012 | generator/output/definitions.lua | |
+93 −40 | generator/output/impl_definitions.json | |
+84 −40 | generator/output/impl_definitions.lua | |
+23 −11 | generator/output/overloads.txt | |
+1,848 −779 | generator/output/structs_and_enums.json | |
+2,636 −1,936 | generator/output/structs_and_enums.lua | |
+16 −4 | generator/output/typedefs_dict.json | |
+16 −4 | generator/output/typedefs_dict.lua | |
+8 −0 | generator/print_defines.cpp | |
+1 −1 | imgui |
Submodule cimplot
updated
10 files
+1 −1 | README.md | |
+63 −19 | cimplot.cpp | |
+33 −21 | cimplot.h | |
+63 −4 | generator/generator.sh | |
+1,292 −601 | generator/output/definitions.json | |
+1,260 −706 | generator/output/definitions.lua | |
+22 −12 | generator/output/overloads.txt | |
+48 −44 | generator/output/structs_and_enums.json | |
+103 −100 | generator/output/structs_and_enums.lua | |
+1 −1 | implot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module_name = "ImGuiTestEngine" | ||
uuid = "d6eb4cb6-1e07-14c4-5835-ae91bedf8555" | ||
include_dirs = [".", "./imgui_test_engine/imgui_test_engine", "../cimgui/imgui"] | ||
input = ["imgui_te_engine.h", "imgui_te_internal.h", "imgui_te_context.h", | ||
"imgui_te_perftool.h", "imgui_te_ui.h", "imgui_te_utils.h", "imgui_te_exporters.h", | ||
"overrides.h"] | ||
cxx-std = "c++17" | ||
out_cxx_dir = "src" | ||
|
||
veto_list = "veto_list.txt" | ||
extra_headers = ["imgui.h", "imgui_internal.h", "thirdparty/Str/Str.h"] | ||
clang_opts = ["-DIMGUI_TEST_ENGINE_ENABLE_STD_FUNCTION=1", "-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1", | ||
"-I{CXXWRAP_INCLUDE_DIR}", | ||
"-I{JULIA_INCLUDE_DIR}"] | ||
lib_basename = "$(@__DIR__)/../../../build/libcimgui" | ||
export = "none" | ||
vetoed_copy_ctor_classes = ["ImGuiContext"] |
Submodule imgui_test_engine
added at
c3a507
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#ifndef OVERRIDES_H | ||
#define OVERRIDES_H | ||
|
||
#include "imgui_internal.h" | ||
#include "imgui_te_engine.h" | ||
#include "jlcxx/array.hpp" | ||
|
||
inline void* TestFunc(ImGuiTest* test) { | ||
return reinterpret_cast<void*>(test->TestFunc); | ||
} | ||
|
||
inline void* set_TestFunc(ImGuiTest* test, void* func) { | ||
test->TestFunc = reinterpret_cast<ImGuiTestTestFunc*>(func); | ||
return func; | ||
} | ||
|
||
inline void* GuiFunc(ImGuiTest* test) { | ||
return reinterpret_cast<void*>(test->GuiFunc); | ||
} | ||
|
||
inline void* set_GuiFunc(ImGuiTest* test, void* func) { | ||
test->GuiFunc = reinterpret_cast<ImGuiTestGuiFunc*>(func); | ||
return func; | ||
} | ||
|
||
inline ImGuiContext* Ptr2ImGuiContext(void* ctx) { | ||
return static_cast<ImGuiContext*>(ctx); | ||
} | ||
|
||
inline void* GetWindowByRef(ImGuiTestContext* ctx, ImGuiTestRef ref) { | ||
return static_cast<void*>(ctx->GetWindowByRef(ref)); | ||
} | ||
|
||
inline void SetRef(ImGuiTestContext* ctx, void* window) { | ||
ctx->SetRef(static_cast<ImGuiWindow*>(window)); | ||
} | ||
|
||
inline void ScrollToTabItem(ImGuiTestContext* ctx, void* tab_bar, ImGuiID tab_id) { | ||
ctx->ScrollToTabItem(static_cast<ImGuiTabBar*>(tab_bar), tab_id); | ||
} | ||
|
||
inline bool TabBarCompareOrder(ImGuiTestContext* ctx, void* tab_bar, const char** tab_order) { | ||
return ctx->TabBarCompareOrder(static_cast<ImGuiTabBar*>(tab_bar), tab_order); | ||
} | ||
|
||
inline jlcxx::Array<ImGuiTest*> TestsAll(ImGuiTestEngine* engine) { | ||
auto size{ engine->TestsAll.size() }; | ||
jlcxx::Array<ImGuiTest*> tests{ static_cast<size_t>(size) }; | ||
|
||
// jl_array_data() changed in 1.11 so we need to check the Julia version | ||
// we're building against. | ||
#if JULIA_VERSION_MAJOR == 1 && JULIA_VERSION_MINOR < 11 | ||
ImGuiTest** data_ptr{ (ImGuiTest**)jl_array_data(tests.wrapped()) }; | ||
#else | ||
ImGuiTest** data_ptr{ jl_array_data(tests.wrapped(), ImGuiTest*) }; | ||
#endif | ||
|
||
for (int i = 0; i < size; ++i) { | ||
data_ptr[i] = engine->TestsAll[i]; | ||
} | ||
|
||
return tests; | ||
} | ||
|
||
#endif |
Oops, something went wrong.