From a838daccd15aa13075aea935906b6e639291944a Mon Sep 17 00:00:00 2001 From: gucio321 Date: Sat, 16 Nov 2024 22:24:42 +0100 Subject: [PATCH 1/6] codegen presets: add cgo preamble --- cmd/codegen/cimgui-go-preset.json | 5 ++++- cmd/codegen/gengo_callbacks.go | 4 ++-- cmd/codegen/gengo_funcs.go | 11 ++++++----- cmd/codegen/presets.go | 13 +++++++++++++ 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/cmd/codegen/cimgui-go-preset.json b/cmd/codegen/cimgui-go-preset.json index 1fe1dab6..7dd196d9 100644 --- a/cmd/codegen/cimgui-go-preset.json +++ b/cmd/codegen/cimgui-go-preset.json @@ -73,5 +73,8 @@ ], "OriginReplace": { "TextEditor_GetText": "TextEditor_GetText_alloc" - } + }, + "ExtraCGOPreamble": [ + "#include \"../imgui/extra_types.h\"" + ] } diff --git a/cmd/codegen/gengo_callbacks.go b/cmd/codegen/gengo_callbacks.go index d27e0a19..cb7edc63 100644 --- a/cmd/codegen/gengo_callbacks.go +++ b/cmd/codegen/gengo_callbacks.go @@ -457,10 +457,10 @@ func (g *callbacksGenerator) saveToDisk() error { fmt.Fprintf(result, `// #include // #include -// #include "../imgui/extra_types.h" // #include "wrapper.h" // #include "typedefs.h" -`) +%s +`, g.ctx.preset.MergeCGoPreamble()) fmt.Fprintf(result, g.cgoSb.String()) diff --git a/cmd/codegen/gengo_funcs.go b/cmd/codegen/gengo_funcs.go index 58c5c4f7..d83570f6 100644 --- a/cmd/codegen/gengo_funcs.go +++ b/cmd/codegen/gengo_funcs.go @@ -44,6 +44,7 @@ func GenerateGoFuncs( enumNames: context.enumNames, refTypedefs: context.refTypedefs, context: context, + sb: &strings.Builder{}, } generator.writeFuncsFileHeader() @@ -105,7 +106,7 @@ type goFuncsGenerator struct { enumNames map[CIdentifier]bool refTypedefs map[CIdentifier]bool - sb strings.Builder + sb *strings.Builder convertedFuncCount int shouldGenerate bool @@ -116,14 +117,14 @@ type goFuncsGenerator struct { func (g *goFuncsGenerator) writeFuncsFileHeader() { g.sb.WriteString(getGoPackageHeader(g.context)) - g.sb.WriteString( - `// #include "../imgui/extra_types.h" -// #include "structs_accessor.h" + fmt.Fprintf(g.sb, + `// #include "structs_accessor.h" // #include "wrapper.h" +%s import "C" import "unsafe" -`) +`, g.context.preset.MergeCGoPreamble()) } func (g *goFuncsGenerator) GenerateFunction(f FuncDef, args []GoIdentifier, argWrappers []ArgumentWrapperData) (noErrors bool) { diff --git a/cmd/codegen/presets.go b/cmd/codegen/presets.go index e986b0f5..4821fda6 100644 --- a/cmd/codegen/presets.go +++ b/cmd/codegen/presets.go @@ -30,4 +30,17 @@ type Preset struct { // Introduced to replace TextEditor_GetText -> TextEditor_GetText_alloc // but could be re-used to force use of another function than json tells us to use. OriginReplace map[CIdentifier]CIdentifier + // ExtraCGOPreamble allows to specify additional C code elements in Go files. + // For example could be used to include extra files. + // For ease of use, its in form of []string. These lines will be merged and prefixed (if appliable) with '//' + ExtraCGOPreamble []string +} + +func (p *Preset) MergeCGoPreamble() string { + result := "" + for _, line := range p.ExtraCGOPreamble { + result += "// " + line + "\n" + } + + return result } From 330fca2ac8e820aa1475a979fe7420255ff5fd05 Mon Sep 17 00:00:00 2001 From: gucio321 Date: Sat, 16 Nov 2024 22:35:11 +0100 Subject: [PATCH 2/6] codegen preset: add support for internal --- cmd/codegen/cimgui-go-preset.json | 6 +++++- cmd/codegen/gengo_funcs.go | 7 +++++-- cmd/codegen/presets.go | 6 ++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/cmd/codegen/cimgui-go-preset.json b/cmd/codegen/cimgui-go-preset.json index 7dd196d9..2df26f13 100644 --- a/cmd/codegen/cimgui-go-preset.json +++ b/cmd/codegen/cimgui-go-preset.json @@ -76,5 +76,9 @@ }, "ExtraCGOPreamble": [ "#include \"../imgui/extra_types.h\"" - ] + ], + "InternalFiles": [ + "imgui_internal" + ], + "InternalPrefix": "Internal" } diff --git a/cmd/codegen/gengo_funcs.go b/cmd/codegen/gengo_funcs.go index d83570f6..645431ba 100644 --- a/cmd/codegen/gengo_funcs.go +++ b/cmd/codegen/gengo_funcs.go @@ -303,8 +303,11 @@ func (g *goFuncsGenerator) generateFuncDeclarationStmt(receiver GoIdentifier, fu // if file comes from imgui_internal.h,prefix Internal is added. // ref: https://github.com/AllenDang/cimgui-go/pull/118 - if strings.Contains(f.Location, "imgui_internal") { - goFuncName = "Internal" + goFuncName + for _, internalFile := range g.context.preset.InternalFiles { + if strings.HasPrefix(f.Location, internalFile) { + goFuncName = GoIdentifier(g.context.preset.InternalPrefix) + goFuncName + break + } } // Generate default param value hint diff --git a/cmd/codegen/presets.go b/cmd/codegen/presets.go index 4821fda6..467af5e4 100644 --- a/cmd/codegen/presets.go +++ b/cmd/codegen/presets.go @@ -34,6 +34,12 @@ type Preset struct { // For example could be used to include extra files. // For ease of use, its in form of []string. These lines will be merged and prefixed (if appliable) with '//' ExtraCGOPreamble []string + // InternalFiles allows to specify files that are considered Internal. + // If an identifier is found in such a file, it will be generated but its + // name will be prefixed with InternalPrefix + InternalFiles []string + // InternalPrefix is a prefix for identifiers from InternalFiles. + InternalPrefix string } func (p *Preset) MergeCGoPreamble() string { From b2555b5da1158bd8f4c9fdef0fa56cda2ce4cc50 Mon Sep 17 00:00:00 2001 From: gucio321 Date: Sat, 16 Nov 2024 22:47:53 +0100 Subject: [PATCH 3/6] codegen presets: add PackagePath --- cmd/codegen/cimgui-go-preset.json | 1 + cmd/codegen/gengo_typedefs.go | 4 ++-- cmd/codegen/main.go | 21 ++++++++++++++++----- cmd/codegen/presets.go | 7 +++++++ 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/cmd/codegen/cimgui-go-preset.json b/cmd/codegen/cimgui-go-preset.json index 2df26f13..c5bb39a9 100644 --- a/cmd/codegen/cimgui-go-preset.json +++ b/cmd/codegen/cimgui-go-preset.json @@ -1,4 +1,5 @@ { + "PackagePath": "github.com/AllenDang/cimgui-go", "SkipFuncs": { "igInputText": true, "igInputTextWithHint": true, diff --git a/cmd/codegen/gengo_typedefs.go b/cmd/codegen/gengo_typedefs.go index c58512ca..69df2a22 100644 --- a/cmd/codegen/gengo_typedefs.go +++ b/cmd/codegen/gengo_typedefs.go @@ -226,12 +226,12 @@ extern "C" { fmt.Fprintf(g.GoSb, `// #include // #include -// #include "../imgui/extra_types.h" // #include "wrapper.h" // #include "typedefs.h" +%s import "C" import "unsafe" -`) +`, g.ctx.preset.MergeCGoPreamble()) } // k is plain C name of the typedef (key in typedefs_dict.json) diff --git a/cmd/codegen/main.go b/cmd/codegen/main.go index ccf59727..a03934ca 100644 --- a/cmd/codegen/main.go +++ b/cmd/codegen/main.go @@ -9,10 +9,8 @@ import ( ) const ( - cimguiGoPackagePath = "github.com/AllenDang/cimgui-go" - generatorInfo = "// Code generated by cmd/codegen from https://github.com/AllenDang/cimgui-go.\n// DO NOT EDIT.\n\n" - goPackageHeader = generatorInfo + "package %[1]s\n\nimport (\n\"" + cimguiGoPackagePath + "/datautils\"\n\t\"" + cimguiGoPackagePath + "/%[2]s\"\n)\n\n" - cppFileHeader = generatorInfo + generatorInfo = "// Code generated by cmd/codegen from https://github.com/AllenDang/cimgui-go.\n// DO NOT EDIT.\n\n" + cppFileHeader = generatorInfo ) // this cextracts enums and structs names from json file. @@ -273,7 +271,20 @@ func main() { } func getGoPackageHeader(ctx *Context) string { - return fmt.Sprintf(goPackageHeader, ctx.flags.packageName, ctx.flags.refPackageName) + return fmt.Sprintf( + `%[1]s +package %[2]s + +import ( + "%[4]s/utils" + "%[4]s/%[3]s" +) +`, + generatorInfo, + ctx.flags.packageName, + ctx.flags.refPackageName, + ctx.preset.PackagePath, + ) } func prefixGoPackage(t, sourcePackage GoIdentifier, ctx *Context) GoIdentifier { diff --git a/cmd/codegen/presets.go b/cmd/codegen/presets.go index 467af5e4..b3df45dc 100644 --- a/cmd/codegen/presets.go +++ b/cmd/codegen/presets.go @@ -40,6 +40,13 @@ type Preset struct { InternalFiles []string // InternalPrefix is a prefix for identifiers from InternalFiles. InternalPrefix string + // PackagePath is an import path of the package. + // This is base path. flags.packageName will be added. + // Example: + // "github.com/AllenDang/cimgui-go" + // If enerated with -pkg imgui, import path + // is supposed to be "github.com/AllenDang/cimgui-go/imgui" + PackagePath string } func (p *Preset) MergeCGoPreamble() string { From 514a3e747c2f3fc50e20d49dad2d8dbacc101719 Mon Sep 17 00:00:00 2001 From: gucio321 Date: Sat, 16 Nov 2024 22:59:05 +0100 Subject: [PATCH 4/6] regenerate code --- ImGuiColorTextEdit/callbacks.go | 3 ++- ImGuiColorTextEdit/funcs.go | 3 ++- ImGuiColorTextEdit/typedefs.go | 3 ++- imgui/callbacks.go | 3 ++- imgui/funcs.go | 3 ++- imgui/typedefs.go | 3 ++- imguizmo/callbacks.go | 3 ++- imguizmo/funcs.go | 3 ++- imguizmo/typedefs.go | 3 ++- immarkdown/callbacks.go | 3 ++- immarkdown/funcs.go | 3 ++- immarkdown/typedefs.go | 3 ++- imnodes/callbacks.go | 3 ++- imnodes/funcs.go | 3 ++- imnodes/typedefs.go | 3 ++- implot/callbacks.go | 3 ++- implot/funcs.go | 3 ++- implot/typedefs.go | 3 ++- 18 files changed, 36 insertions(+), 18 deletions(-) diff --git a/ImGuiColorTextEdit/callbacks.go b/ImGuiColorTextEdit/callbacks.go index eb03bf0b..7958627b 100644 --- a/ImGuiColorTextEdit/callbacks.go +++ b/ImGuiColorTextEdit/callbacks.go @@ -5,7 +5,8 @@ package ImGuiColorTextEdit // #include // #include -// #include "../imgui/extra_types.h" // #include "wrapper.h" // #include "typedefs.h" +// #include "../imgui/extra_types.h" + import "C" diff --git a/ImGuiColorTextEdit/funcs.go b/ImGuiColorTextEdit/funcs.go index 6ee39e35..d7cef8c2 100644 --- a/ImGuiColorTextEdit/funcs.go +++ b/ImGuiColorTextEdit/funcs.go @@ -8,9 +8,10 @@ import ( "github.com/AllenDang/cimgui-go/internal" ) -// #include "../imgui/extra_types.h" // #include "structs_accessor.h" // #include "wrapper.h" +// #include "../imgui/extra_types.h" + import "C" func (self *TextEditor) AllCursorsHaveSelection() bool { diff --git a/ImGuiColorTextEdit/typedefs.go b/ImGuiColorTextEdit/typedefs.go index 7a68d684..3b5976b2 100644 --- a/ImGuiColorTextEdit/typedefs.go +++ b/ImGuiColorTextEdit/typedefs.go @@ -5,9 +5,10 @@ package ImGuiColorTextEdit // #include // #include -// #include "../imgui/extra_types.h" // #include "wrapper.h" // #include "typedefs.h" +// #include "../imgui/extra_types.h" + import "C" import "github.com/AllenDang/cimgui-go/internal" diff --git a/imgui/callbacks.go b/imgui/callbacks.go index 90991473..138f29dc 100644 --- a/imgui/callbacks.go +++ b/imgui/callbacks.go @@ -5,9 +5,10 @@ package imgui // #include // #include -// #include "../imgui/extra_types.h" // #include "wrapper.h" // #include "typedefs.h" +// #include "../imgui/extra_types.h" + // extern void callbackDrawCallback0(ImDrawList*, ImDrawCmd*); // extern void callbackDrawCallback1(ImDrawList*, ImDrawCmd*); // extern void callbackDrawCallback2(ImDrawList*, ImDrawCmd*); diff --git a/imgui/funcs.go b/imgui/funcs.go index 905ab932..4c17c16d 100644 --- a/imgui/funcs.go +++ b/imgui/funcs.go @@ -3,9 +3,10 @@ package imgui -// #include "../imgui/extra_types.h" // #include "structs_accessor.h" // #include "wrapper.h" +// #include "../imgui/extra_types.h" + import "C" import ( "unsafe" diff --git a/imgui/typedefs.go b/imgui/typedefs.go index 314d4d19..390c7a31 100644 --- a/imgui/typedefs.go +++ b/imgui/typedefs.go @@ -5,9 +5,10 @@ package imgui // #include // #include -// #include "../imgui/extra_types.h" // #include "wrapper.h" // #include "typedefs.h" +// #include "../imgui/extra_types.h" + import "C" import "github.com/AllenDang/cimgui-go/internal" diff --git a/imguizmo/callbacks.go b/imguizmo/callbacks.go index a077bbe1..922b59cc 100644 --- a/imguizmo/callbacks.go +++ b/imguizmo/callbacks.go @@ -5,7 +5,8 @@ package imguizmo // #include // #include -// #include "../imgui/extra_types.h" // #include "wrapper.h" // #include "typedefs.h" +// #include "../imgui/extra_types.h" + import "C" diff --git a/imguizmo/funcs.go b/imguizmo/funcs.go index 2768709e..cc8743d4 100644 --- a/imguizmo/funcs.go +++ b/imguizmo/funcs.go @@ -10,9 +10,10 @@ import ( "github.com/AllenDang/cimgui-go/internal" ) -// #include "../imgui/extra_types.h" // #include "structs_accessor.h" // #include "wrapper.h" +// #include "../imgui/extra_types.h" + import "C" func AllowAxisFlip(value bool) { diff --git a/imguizmo/typedefs.go b/imguizmo/typedefs.go index f542121a..1993ad3e 100644 --- a/imguizmo/typedefs.go +++ b/imguizmo/typedefs.go @@ -5,9 +5,10 @@ package imguizmo // #include // #include -// #include "../imgui/extra_types.h" // #include "wrapper.h" // #include "typedefs.h" +// #include "../imgui/extra_types.h" + import "C" import "github.com/AllenDang/cimgui-go/internal" diff --git a/immarkdown/callbacks.go b/immarkdown/callbacks.go index 3c4e1597..98e8912e 100644 --- a/immarkdown/callbacks.go +++ b/immarkdown/callbacks.go @@ -5,9 +5,10 @@ package immarkdown // #include // #include -// #include "../imgui/extra_types.h" // #include "wrapper.h" // #include "typedefs.h" +// #include "../imgui/extra_types.h" + // extern void callbackMarkdownFormalCallback0(MarkdownFormatInfo*, bool); // extern void callbackMarkdownFormalCallback1(MarkdownFormatInfo*, bool); // extern void callbackMarkdownFormalCallback2(MarkdownFormatInfo*, bool); diff --git a/immarkdown/funcs.go b/immarkdown/funcs.go index e7ecaaa6..76866471 100644 --- a/immarkdown/funcs.go +++ b/immarkdown/funcs.go @@ -10,9 +10,10 @@ import ( "github.com/AllenDang/cimgui-go/internal" ) -// #include "../imgui/extra_types.h" // #include "structs_accessor.h" // #include "wrapper.h" +// #include "../imgui/extra_types.h" + import "C" func IsCharInsideWord(c_ rune) bool { diff --git a/immarkdown/typedefs.go b/immarkdown/typedefs.go index 6ccf6ae8..0d7b4dd6 100644 --- a/immarkdown/typedefs.go +++ b/immarkdown/typedefs.go @@ -5,9 +5,10 @@ package immarkdown // #include // #include -// #include "../imgui/extra_types.h" // #include "wrapper.h" // #include "typedefs.h" +// #include "../imgui/extra_types.h" + import "C" import "github.com/AllenDang/cimgui-go/internal" diff --git a/imnodes/callbacks.go b/imnodes/callbacks.go index feea642b..238eda8a 100644 --- a/imnodes/callbacks.go +++ b/imnodes/callbacks.go @@ -5,9 +5,10 @@ package imnodes // #include // #include -// #include "../imgui/extra_types.h" // #include "wrapper.h" // #include "typedefs.h" +// #include "../imgui/extra_types.h" + // extern void callbackMiniMapNodeHoveringCallback0(int, void*); // extern void callbackMiniMapNodeHoveringCallback1(int, void*); // extern void callbackMiniMapNodeHoveringCallback2(int, void*); diff --git a/imnodes/funcs.go b/imnodes/funcs.go index 42cd5bce..0fa8bf7c 100644 --- a/imnodes/funcs.go +++ b/imnodes/funcs.go @@ -10,9 +10,10 @@ import ( "github.com/AllenDang/cimgui-go/internal" ) -// #include "../imgui/extra_types.h" // #include "structs_accessor.h" // #include "wrapper.h" +// #include "../imgui/extra_types.h" + import "C" func NewEmulateThreeButtonMouse() *EmulateThreeButtonMouse { diff --git a/imnodes/typedefs.go b/imnodes/typedefs.go index 495776f1..6a09e0fe 100644 --- a/imnodes/typedefs.go +++ b/imnodes/typedefs.go @@ -5,9 +5,10 @@ package imnodes // #include // #include -// #include "../imgui/extra_types.h" // #include "wrapper.h" // #include "typedefs.h" +// #include "../imgui/extra_types.h" + import "C" import "github.com/AllenDang/cimgui-go/internal" diff --git a/implot/callbacks.go b/implot/callbacks.go index 36b494db..f76ed2b2 100644 --- a/implot/callbacks.go +++ b/implot/callbacks.go @@ -5,9 +5,10 @@ package implot // #include // #include -// #include "../imgui/extra_types.h" // #include "wrapper.h" // #include "typedefs.h" +// #include "../imgui/extra_types.h" + // extern int callbackFormatter0(double, char*, int, void*); // extern int callbackFormatter1(double, char*, int, void*); // extern int callbackFormatter2(double, char*, int, void*); diff --git a/implot/funcs.go b/implot/funcs.go index 24c0ae46..7001ad4f 100644 --- a/implot/funcs.go +++ b/implot/funcs.go @@ -11,9 +11,10 @@ import ( "github.com/AllenDang/cimgui-go/utils/vectors" ) -// #include "../imgui/extra_types.h" // #include "structs_accessor.h" // #include "wrapper.h" +// #include "../imgui/extra_types.h" + import "C" func (self *AlignmentData) Begin() { diff --git a/implot/typedefs.go b/implot/typedefs.go index 44b3d232..b7d49e92 100644 --- a/implot/typedefs.go +++ b/implot/typedefs.go @@ -5,9 +5,10 @@ package implot // #include // #include -// #include "../imgui/extra_types.h" // #include "wrapper.h" // #include "typedefs.h" +// #include "../imgui/extra_types.h" + import "C" import "github.com/AllenDang/cimgui-go/internal" From 7403a7c64bb10cc511ef5449280c02d6da64316c Mon Sep 17 00:00:00 2001 From: gucio321 Date: Sat, 16 Nov 2024 23:04:55 +0100 Subject: [PATCH 5/6] codegen: fix faulty \n --- cmd/codegen/presets.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/codegen/presets.go b/cmd/codegen/presets.go index b3df45dc..5b61ae6b 100644 --- a/cmd/codegen/presets.go +++ b/cmd/codegen/presets.go @@ -1,5 +1,7 @@ package main +import "strings" + // Preset is a set of rules iperative to XXX_templates/ json files. // They are used to manually set some properties of the generator. type Preset struct { @@ -55,5 +57,7 @@ func (p *Preset) MergeCGoPreamble() string { result += "// " + line + "\n" } + result = strings.TrimSuffix(result, "\n") + return result } From d77a9a1090656ffb92d274fcc547b1e3aed0f75a Mon Sep 17 00:00:00 2001 From: gucio321 Date: Sat, 16 Nov 2024 23:05:45 +0100 Subject: [PATCH 6/6] regenerate code --- ImGuiColorTextEdit/callbacks.go | 1 - ImGuiColorTextEdit/funcs.go | 1 - ImGuiColorTextEdit/typedefs.go | 1 - imgui/callbacks.go | 1 - imgui/funcs.go | 1 - imgui/typedefs.go | 1 - imguizmo/callbacks.go | 1 - imguizmo/funcs.go | 1 - imguizmo/typedefs.go | 1 - immarkdown/callbacks.go | 1 - immarkdown/funcs.go | 1 - immarkdown/typedefs.go | 1 - imnodes/callbacks.go | 1 - imnodes/funcs.go | 1 - imnodes/typedefs.go | 1 - implot/callbacks.go | 1 - implot/funcs.go | 1 - implot/typedefs.go | 1 - 18 files changed, 18 deletions(-) diff --git a/ImGuiColorTextEdit/callbacks.go b/ImGuiColorTextEdit/callbacks.go index 7958627b..7b574540 100644 --- a/ImGuiColorTextEdit/callbacks.go +++ b/ImGuiColorTextEdit/callbacks.go @@ -8,5 +8,4 @@ package ImGuiColorTextEdit // #include "wrapper.h" // #include "typedefs.h" // #include "../imgui/extra_types.h" - import "C" diff --git a/ImGuiColorTextEdit/funcs.go b/ImGuiColorTextEdit/funcs.go index d7cef8c2..46b01d20 100644 --- a/ImGuiColorTextEdit/funcs.go +++ b/ImGuiColorTextEdit/funcs.go @@ -11,7 +11,6 @@ import ( // #include "structs_accessor.h" // #include "wrapper.h" // #include "../imgui/extra_types.h" - import "C" func (self *TextEditor) AllCursorsHaveSelection() bool { diff --git a/ImGuiColorTextEdit/typedefs.go b/ImGuiColorTextEdit/typedefs.go index 3b5976b2..54d7eccd 100644 --- a/ImGuiColorTextEdit/typedefs.go +++ b/ImGuiColorTextEdit/typedefs.go @@ -8,7 +8,6 @@ package ImGuiColorTextEdit // #include "wrapper.h" // #include "typedefs.h" // #include "../imgui/extra_types.h" - import "C" import "github.com/AllenDang/cimgui-go/internal" diff --git a/imgui/callbacks.go b/imgui/callbacks.go index 138f29dc..2b8ca733 100644 --- a/imgui/callbacks.go +++ b/imgui/callbacks.go @@ -8,7 +8,6 @@ package imgui // #include "wrapper.h" // #include "typedefs.h" // #include "../imgui/extra_types.h" - // extern void callbackDrawCallback0(ImDrawList*, ImDrawCmd*); // extern void callbackDrawCallback1(ImDrawList*, ImDrawCmd*); // extern void callbackDrawCallback2(ImDrawList*, ImDrawCmd*); diff --git a/imgui/funcs.go b/imgui/funcs.go index 4c17c16d..ec9de6d8 100644 --- a/imgui/funcs.go +++ b/imgui/funcs.go @@ -6,7 +6,6 @@ package imgui // #include "structs_accessor.h" // #include "wrapper.h" // #include "../imgui/extra_types.h" - import "C" import ( "unsafe" diff --git a/imgui/typedefs.go b/imgui/typedefs.go index 390c7a31..c1cddd56 100644 --- a/imgui/typedefs.go +++ b/imgui/typedefs.go @@ -8,7 +8,6 @@ package imgui // #include "wrapper.h" // #include "typedefs.h" // #include "../imgui/extra_types.h" - import "C" import "github.com/AllenDang/cimgui-go/internal" diff --git a/imguizmo/callbacks.go b/imguizmo/callbacks.go index 922b59cc..a0a7cd4c 100644 --- a/imguizmo/callbacks.go +++ b/imguizmo/callbacks.go @@ -8,5 +8,4 @@ package imguizmo // #include "wrapper.h" // #include "typedefs.h" // #include "../imgui/extra_types.h" - import "C" diff --git a/imguizmo/funcs.go b/imguizmo/funcs.go index cc8743d4..468c431b 100644 --- a/imguizmo/funcs.go +++ b/imguizmo/funcs.go @@ -13,7 +13,6 @@ import ( // #include "structs_accessor.h" // #include "wrapper.h" // #include "../imgui/extra_types.h" - import "C" func AllowAxisFlip(value bool) { diff --git a/imguizmo/typedefs.go b/imguizmo/typedefs.go index 1993ad3e..a8857ff9 100644 --- a/imguizmo/typedefs.go +++ b/imguizmo/typedefs.go @@ -8,7 +8,6 @@ package imguizmo // #include "wrapper.h" // #include "typedefs.h" // #include "../imgui/extra_types.h" - import "C" import "github.com/AllenDang/cimgui-go/internal" diff --git a/immarkdown/callbacks.go b/immarkdown/callbacks.go index 98e8912e..83ca3a93 100644 --- a/immarkdown/callbacks.go +++ b/immarkdown/callbacks.go @@ -8,7 +8,6 @@ package immarkdown // #include "wrapper.h" // #include "typedefs.h" // #include "../imgui/extra_types.h" - // extern void callbackMarkdownFormalCallback0(MarkdownFormatInfo*, bool); // extern void callbackMarkdownFormalCallback1(MarkdownFormatInfo*, bool); // extern void callbackMarkdownFormalCallback2(MarkdownFormatInfo*, bool); diff --git a/immarkdown/funcs.go b/immarkdown/funcs.go index 76866471..b88b0b79 100644 --- a/immarkdown/funcs.go +++ b/immarkdown/funcs.go @@ -13,7 +13,6 @@ import ( // #include "structs_accessor.h" // #include "wrapper.h" // #include "../imgui/extra_types.h" - import "C" func IsCharInsideWord(c_ rune) bool { diff --git a/immarkdown/typedefs.go b/immarkdown/typedefs.go index 0d7b4dd6..6002c64b 100644 --- a/immarkdown/typedefs.go +++ b/immarkdown/typedefs.go @@ -8,7 +8,6 @@ package immarkdown // #include "wrapper.h" // #include "typedefs.h" // #include "../imgui/extra_types.h" - import "C" import "github.com/AllenDang/cimgui-go/internal" diff --git a/imnodes/callbacks.go b/imnodes/callbacks.go index 238eda8a..468685d9 100644 --- a/imnodes/callbacks.go +++ b/imnodes/callbacks.go @@ -8,7 +8,6 @@ package imnodes // #include "wrapper.h" // #include "typedefs.h" // #include "../imgui/extra_types.h" - // extern void callbackMiniMapNodeHoveringCallback0(int, void*); // extern void callbackMiniMapNodeHoveringCallback1(int, void*); // extern void callbackMiniMapNodeHoveringCallback2(int, void*); diff --git a/imnodes/funcs.go b/imnodes/funcs.go index 0fa8bf7c..16be91c2 100644 --- a/imnodes/funcs.go +++ b/imnodes/funcs.go @@ -13,7 +13,6 @@ import ( // #include "structs_accessor.h" // #include "wrapper.h" // #include "../imgui/extra_types.h" - import "C" func NewEmulateThreeButtonMouse() *EmulateThreeButtonMouse { diff --git a/imnodes/typedefs.go b/imnodes/typedefs.go index 6a09e0fe..416f56f9 100644 --- a/imnodes/typedefs.go +++ b/imnodes/typedefs.go @@ -8,7 +8,6 @@ package imnodes // #include "wrapper.h" // #include "typedefs.h" // #include "../imgui/extra_types.h" - import "C" import "github.com/AllenDang/cimgui-go/internal" diff --git a/implot/callbacks.go b/implot/callbacks.go index f76ed2b2..9fba4cd8 100644 --- a/implot/callbacks.go +++ b/implot/callbacks.go @@ -8,7 +8,6 @@ package implot // #include "wrapper.h" // #include "typedefs.h" // #include "../imgui/extra_types.h" - // extern int callbackFormatter0(double, char*, int, void*); // extern int callbackFormatter1(double, char*, int, void*); // extern int callbackFormatter2(double, char*, int, void*); diff --git a/implot/funcs.go b/implot/funcs.go index 7001ad4f..ba4f21fb 100644 --- a/implot/funcs.go +++ b/implot/funcs.go @@ -14,7 +14,6 @@ import ( // #include "structs_accessor.h" // #include "wrapper.h" // #include "../imgui/extra_types.h" - import "C" func (self *AlignmentData) Begin() { diff --git a/implot/typedefs.go b/implot/typedefs.go index b7d49e92..2eb3f496 100644 --- a/implot/typedefs.go +++ b/implot/typedefs.go @@ -8,7 +8,6 @@ package implot // #include "wrapper.h" // #include "typedefs.h" // #include "../imgui/extra_types.h" - import "C" import "github.com/AllenDang/cimgui-go/internal"