Defining API for canvas methods that set cell options.

This commit is contained in:
Jakub Sobon 2019-02-22 01:11:36 -05:00
parent a16d908b5e
commit dd2d740abb
No known key found for this signature in database
GPG Key ID: F2451A77FB05D3B7
1 changed files with 15 additions and 0 deletions

View File

@ -16,6 +16,7 @@
package canvas
import (
"errors"
"fmt"
"image"
@ -94,6 +95,20 @@ func (c *Canvas) Cell(p image.Point) (*cell.Cell, error) {
return c.buffer[p.X][p.Y].Copy(), nil
}
// SetCellOpts sets options on the specified cell of the canvas without
// modifying the content of the cell.
// Sets the default cell options if no options are provided.
// This method is idempotent.
func (c *Canvas) SetCellOpts(p image.Point, opts ...cell.Option) error {
return errors.New("unimplemented")
}
// SetAreaCellOpts is like SetCellOpts, but sets the specified options on all
// the cells within the provided area.
func (c *Canvas) SetAreaCellOpts(cellArea image.Rectangle, opts ...cell.Option) error {
return errors.New("unimplemented")
}
// setCellFunc is a function that sets cell content on a terminal or a canvas.
type setCellFunc func(image.Point, rune, ...cell.Option) error