core

package
v0.0.0-...-d3199ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

README

A rearranged tcell.

Documentation

Overview

Package easing is a go implementation of Robert Penner's Easing Equations - http://robertpenner.com/easing/

Index

Constants

View Source
const (
	Debug = false // if set to false, the compiler will cleanup/remove the lines inside functions
)

Variables

View Source
var (
	// ErrNoScreen indicates that no suitable screen could be found.
	// This may result from attempting to run on a platform where there is no support for either termios or console I/O (such as nacl), or from running in an environment where there is no access to a suitable console/terminal device.
	// (For example, running on without a controlling TTY or with no /dev/tty on POSIX platforms.)
	ErrNoScreen = errors.New("no suitable screen available")

	// ErrNoCharset indicates that the locale environment the program is not supported by the program, because no suitable encoding was found for it.
	// This problem never occurs if the environment is UTF-8 or UTF-16.
	ErrNoCharset = errors.New("character set not supported")
)

Functions

func BackIn

func BackIn(p float64) float64

BackIn easing

func BackInOut

func BackInOut(p float64) float64

BackInOut easing

func BackOut

func BackOut(p float64) float64

BackOut easing

func BounceIn

func BounceIn(p float64) float64

BounceIn easing

func BounceInOut

func BounceInOut(p float64) float64

func BounceOut

func BounceOut(p float64) float64

BounceOut easing

func Linear

func Linear(p float64) float64

Linear easing

func NewCore

func NewCore(termEnv string, options ...Option) (term.Engine, error)

NewCore returns a Engine that uses the stock TTY interface and POSIX termios, combined with a comm description taken from the $TERM environment variable. It returns an error if the terminal is not supported for any reason. For terminals that do not support dynamic resize events, the $LINES $COLUMNS environment variables can be set to the actual window size, otherwise defaults taken from the terminal database are used.

func QuadIn

func QuadIn(p float64) float64

QuadIn easing

func SineIn

func SineIn(p float64) float64

SineIn easing

func SineInOut

func SineInOut(p float64) float64

SineInOut easing

func SineOut

func SineOut(p float64) float64

SineOut easing

func WrapString

func WrapString(s string, lim uint) string

WrapString wraps the given string within lim width in characters.

Wrapping is currently naive and only happens at white-space. A future version of the library will implement smarter wrapping. This means that pathological cases can dramatically reach past the limit, such as a very long word.

Types

type EventResize

type EventResize struct {
	// contains filtered or unexported fields
}

EventResize is sent when the window size changes.

func NewResizeEvent

func NewResizeEvent(cols, rows int) *EventResize

NewResizeEvent

func (*EventResize) Size

func (e *EventResize) Size() *term.Size

Size

type Finalizer

type Finalizer func()

type Option

type Option func(core *core)

func WithFinalizer

func WithFinalizer(c Finalizer) Option

if the caller of the NewCore want

func WithRunesFallback

func WithRunesFallback(fallback map[rune]string) Option

WithRunesFallback is a functional option to set a different runes fallback equivalence. See defaultRunesFallback for current defaults.

func WithTrueColor

func WithTrueColor(trueColor string) Option

WithTrueColor is a functional option to disable true color, if needed. Just set the trueColor to "disable".

func WithWinSizeBufferedChannelSize

func WithWinSizeBufferedChannelSize(size int) Option

WithWinSizeBufferedChannelSize is a functional option to set the buffered channel size, used for resize events. Default is the runtime.NumCPU().

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL