vendor: update all dependencies

* Update all dependencies
  * Remove all `[[constraint]]` from Gopkg.toml
  * Add in the minimum number of `[[override]]` to build
  * Remove go get of github.com/inconshreveable/mousetrap as it is vendored
  * Update docs with new policy on constraints
This commit is contained in:
Nick Craig-Wood 2018-05-02 17:09:45 +01:00
parent 21383877df
commit 6427029c4e
4902 changed files with 1443417 additions and 227283 deletions

View file

@ -36,3 +36,4 @@ There are also some interesting projects using termbox-go:
- [pinger](https://github.com/hirose31/pinger) helps you to monitor numerous hosts using ICMP ECHO_REQUEST.
- [vixl44](https://github.com/sebashwa/vixl44) lets you create pixel art inside your terminal using vim movements
- [zterm](https://github.com/varunrau/zterm) is a typing game inspired by http://zty.pe/
- [cointop](https://github.com/miguelmota/cointop) is an interactive terminal based UI application for tracking cryptocurrencies.

View file

@ -1,5 +1,6 @@
package termbox
import "math"
import "syscall"
import "unsafe"
import "unicode/utf16"
@ -57,6 +58,10 @@ type (
control_key_state dword
event_flags dword
}
console_font_info struct {
font uint32
font_size coord
}
)
const (
@ -94,6 +99,7 @@ var (
proc_create_event = kernel32.NewProc("CreateEventW")
proc_wait_for_multiple_objects = kernel32.NewProc("WaitForMultipleObjects")
proc_set_event = kernel32.NewProc("SetEvent")
proc_get_current_console_font = kernel32.NewProc("GetCurrentConsoleFont")
get_system_metrics = moduser32.NewProc("GetSystemMetrics")
)
@ -339,6 +345,19 @@ func set_event(ev syscall.Handle) (err error) {
return
}
func get_current_console_font(h syscall.Handle, info *console_font_info) (err error) {
r0, _, e1 := syscall.Syscall(proc_get_current_console_font.Addr(),
3, uintptr(h), 0, uintptr(unsafe.Pointer(info)))
if int(r0) == 0 {
if e1 != 0 {
err = error(e1)
} else {
err = syscall.EINVAL
}
}
return
}
type diff_msg struct {
pos short
lines short
@ -383,6 +402,7 @@ var (
tmp_coord0 = coord{0, 0}
tmp_coord = coord{0, 0}
tmp_rect = small_rect{0, 0, 0, 0}
tmp_finfo console_font_info
)
func get_cursor_position(out syscall.Handle) coord {
@ -411,9 +431,14 @@ func get_win_min_size(out syscall.Handle) coord {
}
}
err1 := get_current_console_font(out, &tmp_finfo)
if err1 != nil {
panic(err1)
}
return coord{
x: short(x),
y: short(y),
x: short(math.Ceil(float64(x) / float64(tmp_finfo.font_size.x))),
y: short(math.Ceil(float64(y) / float64(tmp_finfo.font_size.y))),
}
}
@ -442,8 +467,9 @@ func get_win_size(out syscall.Handle) coord {
}
func update_size_maybe() {
size := get_term_size(out)
size := get_win_size(out)
if size.x != term_size.x || size.y != term_size.y {
set_console_screen_buffer_size(out, size)
term_size = size
back_buffer.resize(int(size.x), int(size.y))
front_buffer.resize(int(size.x), int(size.y))

View file

@ -69,6 +69,12 @@ func load_terminfo() ([]byte, error) {
}
}
// next, /lib/terminfo
data, err = ti_try_path("/lib/terminfo")
if err == nil {
return data, nil
}
// fall back to /usr/share/terminfo
return ti_try_path("/usr/share/terminfo")
}