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

reenable imnodes #733

Merged
merged 8 commits into from
Feb 17, 2024
Merged
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions FontAtlasProsessor.go
Original file line number Diff line number Diff line change
@@ -289,7 +289,7 @@ func (a *FontAtlas) rebuildFontAtlas() {
} else {
fontConfig.SetFontDataOwnedByAtlas(false)
fonts.AddFontFromMemoryTTFV(
unsafe.Pointer(imgui.SliceToPtr(fontInfo.fontByte)), //nolint:gosec // we need this here
uintptr(unsafe.Pointer(imgui.SliceToPtr(fontInfo.fontByte))), //nolint:gosec // we need this here
int32(len(fontInfo.fontByte)),
fontInfo.size,
fontConfig,
@@ -327,7 +327,7 @@ func (a *FontAtlas) rebuildFontAtlas() {
fontConfig := imgui.NewFontConfig()
fontConfig.SetFontDataOwnedByAtlas(false)
f = fonts.AddFontFromMemoryTTFV(
unsafe.Pointer(imgui.SliceToPtr(fontInfo.fontByte)), //nolint:gosec // we need this here
uintptr(unsafe.Pointer(imgui.SliceToPtr(fontInfo.fontByte))), //nolint:gosec // we need this here
int32(len(fontInfo.fontByte)),
fontInfo.size,
fontConfig,
4 changes: 2 additions & 2 deletions MasterWindow.go
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ type MasterWindow struct {
func NewMasterWindow(title string, width, height int, flags MasterWindowFlags) *MasterWindow {
imGuiContext := imgui.CreateContext()
imgui.PlotCreateContext()
// imgui.ImNodesCreateContext() // TODO after implementing ImNodes in cimgui
imgui.ImNodesCreateContext()

io := imgui.CurrentIO()

@@ -207,7 +207,7 @@ func (w *MasterWindow) afterRender() {

func (w *MasterWindow) beforeDestroy() {
imgui.PlotDestroyContext()
// imgui.ImNodesDestroyContext() // TODO: after adding ImNodes (https://github.com/AllenDang/cimgui-go/issues/137)
imgui.ImNodesDestroyContext()
}

func (w *MasterWindow) render() {
2 changes: 1 addition & 1 deletion Texture.go
Original file line number Diff line number Diff line change
@@ -43,5 +43,5 @@ func (t *Texture) ID() imgui.TextureID {
return t.tex.ID()
}

return nil
return imgui.TextureID{}
}
4 changes: 2 additions & 2 deletions examples/dragdrop/dragdrop.go
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ func loop() {
data := 9
imgui.SetDragDropPayload(
"DND_DEMO",
unsafe.Pointer(&data),
uintptr(unsafe.Pointer(&data)),
0,
)
g.Label("9").Build()
@@ -32,7 +32,7 @@ func loop() {
data := 10
imgui.SetDragDropPayload(
"DND_DEMO",
unsafe.Pointer(&data),
uintptr(unsafe.Pointer(&data)),
0,
)
g.Label("10").Build()
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ module github.com/AllenDang/giu
go 1.21

require (
github.com/AllenDang/cimgui-go v0.0.0-20231219093052-24bd5dc22643
github.com/AllenDang/cimgui-go v0.0.0-20240217115856-389161c9afbe
github.com/AllenDang/go-findfont v0.0.0-20200702051237-9f180485aeb8
github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3
github.com/mazznoer/csscolorparser v0.1.3
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/AllenDang/cimgui-go v0.0.0-20231219093052-24bd5dc22643 h1:lhxdXiabL5kqRx5VEHOABr8T25J+IbwxNsbmmSLGrEY=
github.com/AllenDang/cimgui-go v0.0.0-20231219093052-24bd5dc22643/go.mod h1:UH0IZCbsJKA1hAVQQU6AIDfamqTk0/d3VucaN8lp1Gs=
github.com/AllenDang/cimgui-go v0.0.0-20240217115856-389161c9afbe h1:hCgPHyxsipQgkSIDoDkFS6/axFK2tDqXgRySwqdYvZc=
github.com/AllenDang/cimgui-go v0.0.0-20240217115856-389161c9afbe/go.mod h1:e6feXR4FrATVY/UrWS3si3KCJOm0wruwbxVI/B85fUM=
github.com/AllenDang/go-findfont v0.0.0-20200702051237-9f180485aeb8 h1:dKZMqib/yUDoCFigmz2agG8geZ/e3iRq304/KJXqKyw=
github.com/AllenDang/go-findfont v0.0.0-20200702051237-9f180485aeb8/go.mod h1:b4uuDd0s6KRIPa84cEEchdQ9ICh7K0OryZHbSzMca9k=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=

Unchanged files with check annotations Beta

// ShowWhitespaces sets if whitespace is shown in code editor.
func (ce *CodeEditorWidget) ShowWhitespaces(s bool) *CodeEditorWidget {
// ce.getState().editor.SetShowWhitespaces(s)

Check failure on line 58 in CodeEditor.go

GitHub Actions / Lint

commentedOutCode: may want to remove commented-out code (gocritic)
return ce
}
// TabSize sets editor's tab size.
func (ce *CodeEditorWidget) TabSize(size int) *CodeEditorWidget {
// ce.getState().editor.SetTabSize(size)

Check failure on line 64 in CodeEditor.go

GitHub Actions / Lint

commentedOutCode: may want to remove commented-out code (gocritic)
return ce
}
// LanguageDefinition sets code editor language definition.
func (ce *CodeEditorWidget) LanguageDefinition(definition LanguageDefinition) *CodeEditorWidget {
// s := ce.getState()

Check failure on line 71 in CodeEditor.go

GitHub Actions / Lint

commentedOutCode: may want to remove commented-out code (gocritic)
lookup := map[LanguageDefinition]func(){
//LanguageDefinitionSQL: s.editor.SetLanguageDefinitionSQL,
//LanguageDefinitionCPP: s.editor.SetLanguageDefinitionCPP,
// Text sets editor's text.
func (ce *CodeEditorWidget) Text(str string) *CodeEditorWidget {
// ce.getState().editor.SetText(str)

Check failure on line 91 in CodeEditor.go

GitHub Actions / Lint

commentedOutCode: may want to remove commented-out code (gocritic)
return ce
}
// ErrorMarkers sets error markers.
// func (ce *CodeEditorWidget) ErrorMarkers(markers imgui.ErrorMarkers) *CodeEditorWidget {
// ce.getState().editor.SetErrorMarkers(markers)
//return ce

Check failure on line 98 in CodeEditor.go

GitHub Actions / Lint

commentFormatting: put a space between `//` and comment text (gocritic)
//}
// HandleKeyboardInputs sets if editor should handle keyboard input.
func (ce *CodeEditorWidget) HandleKeyboardInputs(b bool) *CodeEditorWidget {
// ce.getState().editor.SetHandleKeyboardInputs(b)

Check failure on line 103 in CodeEditor.go

GitHub Actions / Lint

commentedOutCode: may want to remove commented-out code (gocritic)
return ce
}
// HasSelection returns true if some text is selected.
func (ce *CodeEditorWidget) HasSelection() bool {
// return ce.getState().editor.HasSelection()

Check failure on line 121 in CodeEditor.go

GitHub Actions / Lint

commentedOutCode: may want to remove commented-out code (gocritic)
return false
}
// GetSelectedText returns selected text.
func (ce *CodeEditorWidget) GetSelectedText() string {
// return ce.getState().editor.GetSelectedText()

Check failure on line 127 in CodeEditor.go

GitHub Actions / Lint

commentedOutCode: may want to remove commented-out code (gocritic)
return ""
}
// GetText returns whole text from editor.
func (ce *CodeEditorWidget) GetText() string {
// return ce.getState().editor.GetText()

Check failure on line 133 in CodeEditor.go

GitHub Actions / Lint

commentedOutCode: may want to remove commented-out code (gocritic)
return ""
}
// GetCurrentLineText returns current line.
func (ce *CodeEditorWidget) GetCurrentLineText() string {
// return ce.getState().editor.GetCurrentLineText()

Check failure on line 139 in CodeEditor.go

GitHub Actions / Lint

commentedOutCode: may want to remove commented-out code (gocritic)
return ""
}