Skip to content

Commit

Permalink
fix some lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gucio321 committed Sep 18, 2023
1 parent a727785 commit 669f55f
Show file tree
Hide file tree
Showing 25 changed files with 42 additions and 44 deletions.
2 changes: 1 addition & 1 deletion Alignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"image"

"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
)

// These constants holds information about where GetWidgetWidth should proceed their
Expand Down
2 changes: 1 addition & 1 deletion Canvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"image"
"image/color"

"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
)

// Canvas represents imgui.DrawList
Expand Down
2 changes: 1 addition & 1 deletion Events.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package giu

import "github.com/AllenDang/cimgui-go"
import imgui "github.com/AllenDang/cimgui-go"

// MouseButton represents imgui.MouseButton.
type MouseButton imgui.MouseButton
Expand Down
8 changes: 4 additions & 4 deletions Flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ const (
ColorEditFlagsHDR ColorEditFlags = ColorEditFlags(imgui.ColorEditFlagsHDR)
// [Display] // ColorEdit: override _display_ type among RGB/HSV/Hex. ColorPicker: select any combination using one or more of RGB/HSV/Hex.
ColorEditFlagsDisplayRGB ColorEditFlags = ColorEditFlags(imgui.ColorEditFlagsDisplayRGB)
// [Display] // "
// [Display] // ".
ColorEditFlagsDisplayHSV ColorEditFlags = ColorEditFlags(imgui.ColorEditFlagsDisplayHSV)
// [Display] // "
// [Display] // ".
ColorEditFlagsDisplayHex ColorEditFlags = ColorEditFlags(imgui.ColorEditFlagsDisplayHex)
// [DataType] // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0..255.
ColorEditFlagsUint8 ColorEditFlags = ColorEditFlags(imgui.ColorEditFlagsUint8)
Expand Down Expand Up @@ -446,7 +446,7 @@ const (
TableColumnFlagsNoDirectResize TableColumnFlags = TableColumnFlags(imgui.TableColumnFlagsNoDirectResize)
)

// SliderFlags represents imgui.SliderFlags
// SliderFlags represents imgui.SliderFlags.
type SliderFlags imgui.SliderFlags

// slider flags.
Expand Down Expand Up @@ -478,7 +478,7 @@ const (
PlotFlagsNoBoxSelect = PlotFlags(imgui.PlotFlagsNoBoxSelect)
// PlotFlagsNoMousePos = PlotFlags(imgui.PlotFlagsNoMousePos)
// PlotFlagsNoHighlight = PlotFlags(imgui.PlotFlagsNoHighlight)
// PlotFlagsNoChild = PlotFlags(imgui.PlotFlagsNoChild)
// PlotFlagsNoChild = PlotFlags(imgui.PlotFlagsNoChild).
PlotFlagsEqual = PlotFlags(imgui.PlotFlagsEqual)
// PlotFlagsYAxis2 = PlotFlags(imgui.PlotFlagsYAxis2)
// PlotFlagsYAxis3 = PlotFlags(imgui.PlotFlagsYAxis3)
Expand Down
4 changes: 2 additions & 2 deletions FontAtlasProsessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sync"
"unsafe"

"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
"github.com/AllenDang/go-findfont"
)

Expand Down Expand Up @@ -242,7 +242,7 @@ func (a *FontAtlas) rebuildFontAtlas() {
}

fonts := Context.IO().Fonts()
//fonts.Clear() /// TODO: I'm commenting this out, because it produces panic.
// fonts.Clear() /// TODO: I'm commenting this out, because it produces panic.

var sb strings.Builder

Expand Down
2 changes: 1 addition & 1 deletion ImageWidgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"time"

"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
)

var _ Widget = &ImageWidget{}
Expand Down
8 changes: 3 additions & 5 deletions Keycode.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package giu

import (
imgui "github.com/AllenDang/cimgui-go"
"log"

imgui "github.com/AllenDang/cimgui-go"
)

// Key represents a imgui key.
Expand All @@ -13,7 +14,6 @@ type Key imgui.Key
// put in the 256+ range).
const (
KeyNone Key = Key(imgui.KeyNone)
KeyUnknown = KeyNone // DEPRECATED: since cimgui-go migration use KeyNone
KeySpace Key = Key(imgui.KeySpace)
KeyApostrophe Key = Key(imgui.KeyApostrophe)
KeyComma Key = Key(imgui.KeyComma)
Expand Down Expand Up @@ -62,8 +62,6 @@ const (
KeyBackslash Key = Key(imgui.KeyBackslash)
KeyRightBracket Key = Key(imgui.KeyRightBracket)
KeyGraveAccent Key = Key(imgui.KeyGraveAccent)
//KeyWorld1 Key = Key(imgui.KeyWorld1)
//KeyWorld2 Key = Key(imgui.KeyWorld2)
KeyEscape Key = Key(imgui.KeyEscape)
KeyEnter Key = Key(imgui.KeyEnter)
KeyTab Key = Key(imgui.KeyTab)
Expand Down Expand Up @@ -106,7 +104,7 @@ const (
KeyMenu = Key(imgui.KeyMenu)
)

// refer glfw3.h
// refer glfw3.h.
func keyFromGLFWKey(k imgui.GLFWKey) Key {
data := map[imgui.GLFWKey]Key{
imgui.GLFWKeySpace: KeySpace,
Expand Down
4 changes: 1 addition & 3 deletions ListClipper.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package giu

import (
"github.com/AllenDang/cimgui-go"
)
import imgui "github.com/AllenDang/cimgui-go"

var _ Widget = &ListClipperWrapper{}

Expand Down
14 changes: 7 additions & 7 deletions MasterWindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"golang.org/x/image/colornames"
)

// MasterWindowFlags implements BackendWindowFlags
// MasterWindowFlags implements BackendWindowFlags.
type MasterWindowFlags int

// master window flags.
Expand All @@ -27,7 +27,7 @@ const (
MasterWindowFlagsTransparent
)

// parseAndApply converts MasterWindowFlags to appropiate imgui.GLFWWindowFlags.
// parseAndApply converts MasterWindowFlags to appropriate imgui.GLFWWindowFlags.
func (m MasterWindowFlags) parseAndApply(b imgui.Backend[imgui.GLFWWindowFlags]) {
data := map[MasterWindowFlags]struct {
f imgui.GLFWWindowFlags
Expand All @@ -47,7 +47,7 @@ func (m MasterWindowFlags) parseAndApply(b imgui.Backend[imgui.GLFWWindowFlags])
}
}

// TODO
// TODO(gucio321) implement this in cimgui-go
// DontCare could be used as an argument to (*MasterWindow).SetSizeLimits.
// var DontCare int = imgui.GlfwDontCare

Expand Down Expand Up @@ -274,13 +274,13 @@ func (w *MasterWindow) SetBgColor(bgColor color.Color) {
}

// GetPos return position of master window.
func (w *MasterWindow) GetPos() (int, int) {
var x, y int32
func (w *MasterWindow) GetPos() (x int, y int) {
var xResult, yResult int32
if w.backend != nil {
x, y = w.backend.GetWindowPos()
xResult, yResult = w.backend.GetWindowPos()
}

return int(x), int(y)
return int(xResult), int(yResult)
}

// SetPos sets position of master window.
Expand Down
7 changes: 4 additions & 3 deletions Plot.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package giu

import (
"github.com/AllenDang/cimgui-go"
"image"

imgui "github.com/AllenDang/cimgui-go"
)

// PlotWidget is implemented by all the particular plots, which can be used
Expand Down Expand Up @@ -398,7 +399,7 @@ func (p *LinePlot) Plot() {
)

// TODO: no idea what should it be...
//imgui.PlotDragLineX(Context.FontAtlas.RegisterString(p.title), p.values, p.xScale, p.x0, p.offset)
// imgui.PlotDragLineX(Context.FontAtlas.RegisterString(p.title), p.values, p.xScale, p.x0, p.offset)
//imgui.PlotDragLineX(
// Context.FontAtlas.RegisterString(p.title),
// p.values,
Expand Down Expand Up @@ -441,7 +442,7 @@ func (p *LineXYPlot) Offset(offset int) *LineXYPlot {
// Plot implements Plot interface.
func (p *LineXYPlot) Plot() {
// TODO: migrate this
//imgui.ImPlotSetPlotYAxis(imgui.ImPlotYAxis(p.yAxis))
// imgui.ImPlotSetPlotYAxis(imgui.ImPlotYAxis(p.yAxis))
//imgui.ImPlotLineXY(Context.FontAtlas.RegisterString(p.title), p.xs, p.ys, p.offset)
}

Expand Down
2 changes: 1 addition & 1 deletion Popups.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package giu

import (
"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
)

// OpenPopup opens a popup with specified id.
Expand Down
2 changes: 1 addition & 1 deletion ProgressIndicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sync"
"time"

"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
)

var _ Disposable = &progressIndicatorState{}
Expand Down
2 changes: 1 addition & 1 deletion SliderWidgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package giu
import (
"fmt"

"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
)

var _ Widget = &SliderIntWidget{}
Expand Down
2 changes: 1 addition & 1 deletion SplitLayout.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package giu
import (
"image/color"

"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
)

// SplitDirection represents a direction (vertical/horizontal) of splitting layout.
Expand Down
2 changes: 1 addition & 1 deletion StackWidget.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package giu

import "github.com/AllenDang/cimgui-go"
import imgui "github.com/AllenDang/cimgui-go"

var _ Widget = &StackWidget{}

Expand Down
2 changes: 1 addition & 1 deletion Style.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package giu
import (
"image/color"

"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
)

// You may want to use styles in order to make your app looking more beautiful.
Expand Down
2 changes: 1 addition & 1 deletion StyleIDs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package giu

import "github.com/AllenDang/cimgui-go"
import imgui "github.com/AllenDang/cimgui-go"

// Here are the style IDs for styling imgui apps.
// For details about each of attributes read comment above them.
Expand Down
2 changes: 1 addition & 1 deletion StyleSetter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package giu
import (
"image/color"

"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
)

var _ Widget = &StyleSetter{}
Expand Down
2 changes: 1 addition & 1 deletion TableWidgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package giu
import (
"image/color"

"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
)

type TableRowWidget struct {
Expand Down
2 changes: 1 addition & 1 deletion TextWidgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"golang.org/x/image/colornames"

"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
"github.com/sahilm/fuzzy"
)

Expand Down
3 changes: 2 additions & 1 deletion Texture.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package giu

import (
"github.com/AllenDang/cimgui-go"
"image"

imgui "github.com/AllenDang/cimgui-go"
)

// Texture represents imgui.TextureID.
Expand Down
4 changes: 2 additions & 2 deletions Utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,15 @@ func OpenURL(url string) {
}

// ColorToUint converts GO color into Uint32 color
// it is 0xRRGGBBAA
// it is 0xRRGGBBAA.
func ColorToUint(col color.Color) uint32 {
r, g, b, a := col.RGBA()
mask := uint32(0xff)

return r&mask<<24 + g&mask<<16 + b&mask<<8 + a&mask
}

// UintToColor converts uint32 of form 0xRRGGBB into color.RGBA
// UintToColor converts uint32 of form 0xRRGGBB into color.RGBA.
func UintToColor(col uint32) *color.RGBA {
mask := 0xff
r := byte(col >> 24 & uint32(mask))
Expand Down
2 changes: 1 addition & 1 deletion Utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"image/color"
"testing"

"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion Widgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"image/color"

"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
)

// GenAutoID automatically generates fidget's id.
Expand Down
2 changes: 1 addition & 1 deletion Window.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package giu
import (
"fmt"

"github.com/AllenDang/cimgui-go"
imgui "github.com/AllenDang/cimgui-go"
)

// SingleWindow creates one window filling all available space
Expand Down

0 comments on commit 669f55f

Please sign in to comment.