File: ts.go

package info (click to toggle)
golang-github-olekukonko-ts 0.0~git20140412.0.ecf753e-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, bullseye-backports, buster, buster-backports, sid, trixie
  • size: 96 kB
  • ctags: 28
  • sloc: makefile: 3
file content (36 lines) | stat: -rw-r--r-- 681 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2014 Oleku Konko All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.

// This module is a Terminal  API for the Go Programming Language.
// The protocols were written in pure Go and works on windows and unix systems

package ts

// Return System Size
type Size struct {
	row  uint16
	col  uint16
	posX uint16
	posY uint16
}

// Get Terminal Width
func (w Size) Col() int {
	return int(w.col)
}

// Get Terminal Height
func (w Size) Row() int {
	return int(w.row)
}

// Get Position X
func (w Size) PosX() int {
	return int(w.posX)
}

// Get Position Y
func (w Size) PosY() int {
	return int(w.posY)
}