diff --git a/README.md b/README.md index cf0a5fa..930afcc 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,21 @@ go run cmd/tui/main.go ### cmd -- future command line application structure using cobra in cli folder -- tui in tui folder, makes sense huh +- entrypoint for our application with main.go ### internal - code that is not reusable and we don't want to share it with others, maybe parts of code in cmd will be moved here instead +- tui and cli logic + +### configs + +- example of configuration + +### vendor + +- localy downloaded libraries and imports + +```shell +go mod vendor +``` diff --git a/cmd/main.go b/cmd/main.go new file mode 100644 index 0000000..9c97066 --- /dev/null +++ b/cmd/main.go @@ -0,0 +1,29 @@ +package main + +import ( + "fmt" + "whspbrd/pkg/cell_size" +) + +func main() { + //systray.Systray() + // and here is agrid making a grid of images + //for i := 0; i < 10; i++ { + // for j := 0; j < 10; j++ { + // render_image.RenderImage("kogami-pf-edit.jpg", i*3+2, j*7+23, 64, 64) + // } + //} + + //render_image.RenderImage("kogami-pf-edit.jpg", 0, 3, 750, 0) + + w, h, err := cell_size.GetTerminalCellSizePixels() + if err != nil { + fmt.Println("Error getting terminal cell size:", err) + return + } + width, height := cell_size.GetConsoleSize() + + fmt.Println("Terminal cell size in pixels:", w, "x", h) + fmt.Println("Console size in characters:", width, "x", height) + +} diff --git a/configs/config.json b/configs/config.json index e69de29..544b7b4 100644 --- a/configs/config.json +++ b/configs/config.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/FS.md b/docs/FS.md similarity index 100% rename from FS.md rename to docs/FS.md diff --git a/docs/TASKS_TO_BE_SOLVED.md b/docs/TASKS_TO_BE_SOLVED.md new file mode 100644 index 0000000..6957384 --- /dev/null +++ b/docs/TASKS_TO_BE_SOLVED.md @@ -0,0 +1,11 @@ +# List of task to solve + +- [ ] Emoji input support +- [x] Image rendering (gif) +- [ ] Style highlighting (**Bold**, ...) +- [x] Rerender on scale change, to see images +- [ ] ImageMagick files like profile pictures +- [ ] Load chat and scroll through it +- [ ] File picker on Windows and Linux to upload files and images +- [ ] System tray launcher +- [ ] Scrolling with images diff --git a/TECH_STACK.md b/docs/TECH_STACK.md similarity index 100% rename from TECH_STACK.md rename to docs/TECH_STACK.md diff --git a/cmd/tui/main.go b/internal/tui/tui.go similarity index 82% rename from cmd/tui/main.go rename to internal/tui/tui.go index 158a834..73bee72 100644 --- a/cmd/tui/main.go +++ b/internal/tui/tui.go @@ -1,14 +1,14 @@ -package main +package tui import ( "fmt" _ "image/jpeg" _ "image/png" + "log" "strings" "github.com/jroimartin/gocui" //"whspbrd/pkg/systray" - "whspbrd/pkg/cell_size" "whspbrd/pkg/render_image" ) @@ -193,40 +193,20 @@ func quit(g *gocui.Gui, v *gocui.View) error { return gocui.ErrQuit } -func main() { - //systray.Systray() - //g, err := gocui.NewGui(gocui.OutputNormal) - //if err != nil { - // log.Panicln(err) - //} - //defer g.Close() - // - //g.SetManagerFunc(layout) - // - //if err := keybindings(g); err != nil { - // log.Panicln(err) - //} - // - //if err := g.MainLoop(); err != nil && err != gocui.ErrQuit { - // log.Panicln(err) - //} - // and here is agrid making a grid of images - //for i := 0; i < 10; i++ { - // for j := 0; j < 10; j++ { - // render_image.RenderImage("kogami-pf-edit.jpg", i*3+2, j*7+23, 64, 64) - // } - //} - - //render_image.RenderImage("kogami-pf-edit.jpg", 0, 3, 750, 0) - - w, h, err := cell_size.GetTerminalCellSizePixels() +func Run() { + g, err := gocui.NewGui(gocui.OutputNormal) if err != nil { - fmt.Println("Error getting terminal cell size:", err) - return + log.Panicln(err) } - width, height := cell_size.GetConsoleSize() + defer g.Close() - fmt.Println("Terminal cell size in pixels:", w, "x", h) - fmt.Println("Console size in characters:", width, "x", height) + g.SetManagerFunc(layout) + if err := keybindings(g); err != nil { + log.Panicln(err) + } + + if err := g.MainLoop(); err != nil && err != gocui.ErrQuit { + log.Panicln(err) + } }