mirror of https://github.com/miguelmota/cointop
Fix after merge. Remove compat.
parent
baeee67e64
commit
7e4ede0ab8
@ -1,32 +0,0 @@
|
||||
// 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.
|
||||
|
||||
package gocui
|
||||
|
||||
import "github.com/cointop-sh/cointop/pkg/termbox"
|
||||
|
||||
// Attribute represents a terminal attribute, like color, font style, etc. They
|
||||
// can be combined using bitwise OR (|). Note that it is not possible to
|
||||
// combine multiple color attributes.
|
||||
type Attribute termbox.Attribute
|
||||
|
||||
// Color attributes.
|
||||
const (
|
||||
ColorDefault Attribute = Attribute(termbox.ColorDefault)
|
||||
ColorBlack = Attribute(termbox.ColorBlack)
|
||||
ColorRed = Attribute(termbox.ColorRed)
|
||||
ColorGreen = Attribute(termbox.ColorGreen)
|
||||
ColorYellow = Attribute(termbox.ColorYellow)
|
||||
ColorBlue = Attribute(termbox.ColorBlue)
|
||||
ColorMagenta = Attribute(termbox.ColorMagenta)
|
||||
ColorCyan = Attribute(termbox.ColorCyan)
|
||||
ColorWhite = Attribute(termbox.ColorWhite)
|
||||
)
|
||||
|
||||
// Text style attributes.
|
||||
// const (
|
||||
// AttrBold Attribute = Attribute(termbox.AttrBold)
|
||||
// AttrUnderline = Attribute(termbox.AttrUnderline)
|
||||
// AttrReverse = Attribute(termbox.AttrReverse)
|
||||
// )
|
@ -1,103 +0,0 @@
|
||||
// Copyright 2020 The TCell Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use file except in compliance with the License.
|
||||
// You may obtain a copy of the license at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Package termbox is a compatibility layer to allow tcell to emulate
|
||||
// the github.com/nsf/termbox package.
|
||||
package termbox
|
||||
|
||||
// Ugly globals
|
||||
// var screen tcell.Screen
|
||||
// var outMode OutputMode
|
||||
|
||||
// func SetScreen(s tcell.Screen) {
|
||||
// screen = s
|
||||
// }
|
||||
|
||||
// Attribute affects the presentation of characters, such as color, boldness,
|
||||
// and so forth.
|
||||
type Attribute uint16
|
||||
|
||||
// Colors first. The order here is significant.
|
||||
const (
|
||||
ColorDefault Attribute = iota
|
||||
ColorBlack
|
||||
ColorRed
|
||||
ColorGreen
|
||||
ColorYellow
|
||||
ColorBlue
|
||||
ColorMagenta
|
||||
ColorCyan
|
||||
ColorWhite
|
||||
)
|
||||
|
||||
// Other attributes.
|
||||
// const (
|
||||
// AttrBold Attribute = 1 << (9 + iota)
|
||||
// AttrUnderline
|
||||
// AttrReverse
|
||||
// )
|
||||
|
||||
// Clear clears the screen with the given attributes.
|
||||
// func Clear(fg, bg Attribute) {
|
||||
// st := MkStyle(fg, bg)
|
||||
// w, h := screen.Size()
|
||||
// for row := 0; row < h; row++ {
|
||||
// for col := 0; col < w; col++ {
|
||||
// screen.SetContent(col, row, ' ', nil, st)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// OutputMode represents an output mode, which determines how colors
|
||||
// are used. See the termbox documentation for an explanation.
|
||||
// type OutputMode int
|
||||
|
||||
// // OutputMode values.
|
||||
// const (
|
||||
// OutputCurrent OutputMode = iota
|
||||
// OutputNormal
|
||||
// Output256
|
||||
// Output216
|
||||
// OutputGrayscale
|
||||
// )
|
||||
|
||||
// SetOutputMode is used to set the color palette used.
|
||||
// func SetOutputMode(mode OutputMode) OutputMode {
|
||||
// if screen.Colors() < 256 {
|
||||
// mode = OutputNormal
|
||||
// }
|
||||
// switch mode {
|
||||
// case OutputCurrent:
|
||||
// return outMode
|
||||
// case OutputNormal, Output256, Output216, OutputGrayscale:
|
||||
// outMode = mode
|
||||
// return mode
|
||||
// default:
|
||||
// return outMode
|
||||
// }
|
||||
// }
|
||||
|
||||
// scaledColor returns a Color that is proportional to the x/y coordinates
|
||||
// func scaledColor(x, y int) tcell.Color {
|
||||
// w, h := screen.Size()
|
||||
// blu := int32(255 * float64(x) / float64(w))
|
||||
// grn := int32(255 * float64(y) / float64(h))
|
||||
// red := int32(200)
|
||||
// return tcell.NewRGBColor(red, grn, blu)
|
||||
// }
|
||||
|
||||
// PollEvent blocks until an event is ready, and then returns it.
|
||||
// func PollEvent() tcell.Event {
|
||||
// return screen.PollEvent()
|
||||
// }
|
Loading…
Reference in New Issue