From dd2d740abb9b70e7b4cf518b5511a483510f61b7 Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Fri, 22 Feb 2019 01:11:36 -0500 Subject: [PATCH] Defining API for canvas methods that set cell options. --- canvas/canvas.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/canvas/canvas.go b/canvas/canvas.go index 5f02023..1078467 100644 --- a/canvas/canvas.go +++ b/canvas/canvas.go @@ -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