Drawing methods implemented

master
Leonardo Domingues 2021-11-29 12:04:09 -03:00
parent f3f5e80160
commit ee65505e8f
1 changed files with 22 additions and 0 deletions

View File

@ -269,6 +269,28 @@ func (c *Cli) DisplaySetRes(d *DEVMODE) error {
return err return err
} }
/***************** Draw Functions *****************/
func (c *Cli) DrawCLear() error {
err := c.HttpCli().JsonGet("/ipc/draw/clear", nil)
return err
}
func (c *Cli) DrawBox(x, y, w, h, t int) error {
err := c.HttpCli().JsonGet(fmt.Sprintf("/ipc/draw/addbox?x=%d&y=%d&w=%d&h=%d&t=%d", x, y, w, h, t), nil)
return err
}
func (c *Cli) DrawRect(x, y, w, h int) error {
err := c.HttpCli().JsonGet(fmt.Sprintf("/ipc/draw/addrect?x=%d&y=%d&w=%d&h=%d", x, y, w, h), nil)
return err
}
func (c *Cli) DrawAddText(t string, x, y, w, h int) error {
err := c.HttpCli().JsonGet(fmt.Sprintf("/ipc/draw/addtext?t=%s&x=%d&y=%d&w=%d&h=%d", t, x, y, w, h), nil)
return err
}
func NewCli() *Cli { func NewCli() *Cli {
ret := &Cli{ApiCli: api.NewApiCli()} ret := &Cli{ApiCli: api.NewApiCli()}
return ret return ret