Skip to content

Commit a2fc4c0

Browse files
authored
Merge pull request #414 from gucio321/vendor-workaround
Vendor workaround + deps upgrade
2 parents 3731572 + f6373af commit a2fc4c0

File tree

594 files changed

+16293
-9790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

594 files changed

+16293
-9790
lines changed

ImGuiColorTextEdit/cflags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package ImGuiColorTextEdit
22

3-
// #cgo CPPFLAGS: -DCIMGUI_DEFINE_ENUMS_AND_STRUCTS
3+
// #cgo CPPFLAGS: -DCIMGUI_DEFINE_ENUMS_AND_STRUCTS -DIMGUI_USE_WCHAR32
44
// #cgo CXXFLAGS: --std=c++11
55
// #cgo amd64,linux LDFLAGS: ${SRCDIR}/../lib/linux/x64/cimgui.a
66
// #cgo linux CXXFLAGS: -Wno-changes-meaning -Wno-invalid-conversion -fpermissive

ImGuiColorTextEdit/funcs.go

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,18 @@ update: setup
120120
rm -rf cwrappers/*
121121
$(call update,cimgui,https://github.com/cimgui/cimgui,imgui,docking, --cflags "glfw opengl3 opengl2 sdl2 -DIMGUI_USE_WCHAR32")
122122
cat templates/assert.h >> cwrappers/imgui/imconfig.h
123-
$(call cimgui)
123+
$(call imgui)
124124
$(call update,cimplot,https://github.com/cimgui/cimplot,implot,master)
125-
$(call cimplot)
125+
$(call implot)
126126
$(call update,cimnodes,https://github.com/cimgui/cimnodes,imnodes,master)
127-
$(call cimnodes)
127+
$(call imnodes)
128128
$(call update,cimmarkdown,https://github.com/gucio321/cimmarkdown,imgui_markdown,main)
129-
$(call cimmarkdown)
129+
$(call immarkdown)
130130
$(call update,cimguizmo,https://github.com/cimgui/cimguizmo,ImGuizmo,master)
131-
$(call cimguizmo)
131+
$(call imguizmo)
132132
$(call update,cimCTE,https://github.com/cimgui/cimcte,ImGuiColorTextEdit,master)
133-
$(call cimcte)
133+
$(call imcte)
134+
$(call vendor-eliminate)
134135
$(call dummy)
135136

136137
# dummy creates dummy.go files to baypass GO vendor policy that excludes everything that has no .go files (including our C source).
@@ -143,6 +144,12 @@ define dummy
143144
echo ")" >> dummy.go
144145
endef
145146

147+
define vendor-eliminate
148+
for i in `find . -name vendor -type d`; do \
149+
mv $$i $${i}1; \
150+
done
151+
endef
152+
146153
.PHONY: dummy
147154
dummy:
148155
$(call dummy)

backend/ebiten-backend/ebiten_api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (e *EbitenBackend) onfinalize() {
9696
}
9797

9898
runtime.SetFinalizer(e, nil)
99-
e.ctx.Destroy()
99+
imgui.DestroyContext()
100100
}
101101

102102
func (e *EbitenBackend) controlCursorShapeFn() {

backend/glfwbackend/glfw_backend.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ GLFWwindow *igCreateGLFWWindow(const char *title, int width, int height,
8585
afterCreateContext();
8686
}
8787

88-
ImGuiIO *io = igGetIO();
88+
ImGuiIO *io = igGetIO_Nil();
8989
io->ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
9090
// io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad
9191
// Controls
@@ -145,7 +145,7 @@ void glfw_render(GLFWwindow *window, VoidCallback renderLoop) {
145145
igRender();
146146
ImGui_ImplOpenGL3_RenderDrawData(igGetDrawData());
147147

148-
ImGuiIO *io = igGetIO();
148+
ImGuiIO *io = igGetIO_Nil();
149149

150150
// Update and Render additional Platform Windows
151151
// (Platform functions may change the current OpenGL context, so we
@@ -165,7 +165,7 @@ void glfw_render(GLFWwindow *window, VoidCallback renderLoop) {
165165
void igGLFWRunLoop(GLFWwindow *window, VoidCallback loop, VoidCallback beforeRender, VoidCallback afterRender,
166166
VoidCallback beforeDestroyContext) {
167167
glfwMakeContextCurrent(window);
168-
ImGuiIO *io = igGetIO();
168+
ImGuiIO *io = igGetIO_Nil();
169169

170170
// Load Fonts
171171
// - If no fonts are loaded, dear imgui will use the default font. You can

backend/sdlbackend/sdl_backend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ SDL_Window* igCreateSDLWindow(const char* title, int width, int height,VoidCallb
9696
afterCreateContext();
9797
}
9898

99-
ImGuiIO* io = igGetIO();
99+
ImGuiIO* io = igGetIO_Nil();
100100
io->ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
101101
io->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
102102
io->ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking
@@ -149,7 +149,7 @@ void igRefresh() {
149149

150150
void igSDLRunLoop(SDL_Window *window, VoidCallback loop, VoidCallback beforeRender, VoidCallback afterRender,
151151
VoidCallback beforeDestroyContext) {
152-
ImGuiIO* io = igGetIO();
152+
ImGuiIO* io = igGetIO_Nil();
153153
// Main loop
154154
bool done = false;
155155
#ifdef __EMSCRIPTEN__

cmd/codegen/cimgui-go-preset.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"ImGuiInputTextCallback": true
5151
},
5252
"SkipFiles": [
53+
"imgui_freetype"
5354
],
5455
"TypedefsPoolSize": 32,
5556
"TypedefsCustomPoolSizes": {
@@ -58,7 +59,8 @@
5859
"igGetDrawData": "CurrentDrawData",
5960
"igGetDrawListSharedData": "CurrentDrawListSharedData",
6061
"igGetFont": "CurrentFont",
61-
"igGetIO": "CurrentIO",
62+
"igGetIO_Nil": "CurrentIO",
63+
"igGetPlatformIO_Nil": "CurrentPlatformIO",
6264
"igGetPlatformIO": "CurrentPlatformIO",
6365
"igGetStyle": "CurrentStyle",
6466
"igGetMouseCursor": "CurrentMouseCursor",

cmd/codegen/gencpp.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ extern "C" {
7070
}
7171

7272
// check if func name is valid
73-
if len(f.FuncName) == 0 {
73+
if len(f.FuncName) == 0 ||
74+
MapContainsAny(f.Location, ctx.preset.SkipFiles) {
7475
shouldSkip = true
7576
}
7677

cmd/codegen/gengo_callbacks.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (g *callbacksGenerator) writeCallback(typedefName CIdentifier, def string)
8080
// - returnType <funcName>(args1 arg1Name, args2 arg2Name, args3 arg3Name);
8181
// NOTE: the second is uesed mainly in immarkdown
8282
// NOTE: in the 1st, spaces does not matter so we'll trim them
83-
expr1, err := regexp.Compile("([a-zA-Z0-9_]+\\*?)\\(\\*.*\\)\\((.*)\\);")
83+
expr1, err := regexp.Compile("(typedef )?([a-zA-Z0-9_]+\\*?) *\\(\\*.*\\)\\((.*)\\);")
8484
if err != nil {
8585
panic(fmt.Sprintf("Cannot compile regex expr1!: %v", err))
8686
}
@@ -102,6 +102,7 @@ func (g *callbacksGenerator) writeCallback(typedefName CIdentifier, def string)
102102
// now split by "("
103103
// it should be something like this:
104104
// ["returnType", "*<optional func name)", "args1 arg1Name, args2 arg2Name, args3 arg3Name);"]
105+
def = TrimPrefix(def, "typedef ")
105106
parts := Split(def, "(")
106107
if len(parts) != 3 {
107108
panic("Cannot split by (, check implementation in cmd/codegen!")

cwrappers/ImGuiColorTextEdit/ImGuiDebugPanel.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,20 @@ void TextEditor::ImGuiDebugPanel(const std::string& panelName)
1111
ImGui::DragInt("Cursor count", &mState.mCurrentCursor);
1212
for (int i = 0; i <= mState.mCurrentCursor; i++)
1313
{
14+
static Coordinates sanitizedStart, sanitizedEnd;
15+
sanitizedStart = SanitizeCoordinates(mState.mCursors[i].mInteractiveStart);
16+
sanitizedEnd = SanitizeCoordinates(mState.mCursors[i].mInteractiveStart);
1417
ImGui::DragInt2("Interactive start", &mState.mCursors[i].mInteractiveStart.mLine);
1518
ImGui::DragInt2("Interactive end", &mState.mCursors[i].mInteractiveEnd.mLine);
19+
ImGui::Text("Sanitized start: %d, %d", sanitizedStart.mLine, sanitizedStart.mColumn);
20+
ImGui::Text("Sanitized end: %d, %d", sanitizedEnd.mLine, sanitizedEnd.mColumn);
1621
}
1722
}
1823
if (ImGui::CollapsingHeader("Lines"))
1924
{
2025
for (int i = 0; i < mLines.size(); i++)
2126
{
22-
ImGui::Text("%d", mLines[i].size());
27+
ImGui::Text("%zu", mLines[i].size());
2328
}
2429
}
2530
if (ImGui::CollapsingHeader("Undo"))

0 commit comments

Comments
 (0)