// Copyright 2014 The gocui Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.packagegocuiimport(standardErrors"errors""fmt""log""runtime""strings""sync""time""github.com/go-errors/errors")// OutputMode represents an output mode, which determines how colors// are used.typeOutputModeintvar(// ErrAlreadyBlacklisted is returned when the keybinding is already blacklisted.ErrAlreadyBlacklisted=standardErrors.New("keybind already blacklisted")// ErrBlacklisted is returned when the keybinding being parsed / used is blacklisted.ErrBlacklisted=standardErrors.New("keybind blacklisted")// ErrNotBlacklisted is returned when a keybinding being whitelisted is not blacklisted.ErrNotBlacklisted=standardErrors.New("keybind not blacklisted")// ErrNoSuchKeybind is returned when the keybinding being parsed does not exist.ErrNoSuchKeybind=standardErrors.New("no such keybind")// ErrUnknownView allows to assert if a View must be initialized.ErrUnknownView=standardErrors.New("unknown view")// ErrQuit is used to decide if the MainLoop finished successfully.ErrQuit=standardErrors.New("quit"))const(// OutputNormal provides 8-colors terminal mode.OutputNormalOutputMode=iota// Output256 provides 256-colors terminal mode.Output256// Output216 provides 216 ansi color terminal mode.Output216// OutputGrayscale provides greyscale terminal mode.OutputGrayscale// OutputTrue provides 24bit color terminal mode.// This mode is recommended even if your terminal doesn't support// such mode. The colors are represented exactly as you// write them (no clamping or truncating). `tcell` should take care// of what your terminal can do.OutputTrue)typetabClickHandlerfunc(int)errortypetabClickBindingstruct{viewNamestringhandlertabClickHandler}typeGuiMutexesstruct{// tickingMutex ensures we don't have two loops ticking. The point of 'ticking'// is to refresh the gui rapidly so that loader characters can be animated.tickingMutexsync.MutexViewsMutexsync.Mutex}typePlayModeintconst(NORMALPlayMode