aboutsummaryrefslogtreecommitdiffstats
path: root/vt100.py
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-09-14 21:57:12 -0400
committerJesse Luehrs <doy@tozt.net>2014-09-14 21:57:12 -0400
commit033673ac065a189bc611af689c964a7f75a3a183 (patch)
tree7f4394ddb463df52d8e6966ccb58f1d3af6d8a1c /vt100.py
parent25378ae42097762c7b9e36b0272d8bac41baa762 (diff)
downloadpython-termcast-server-033673ac065a189bc611af689c964a7f75a3a183.tar.gz
python-termcast-server-033673ac065a189bc611af689c964a7f75a3a183.zip
set the terminal size as requested by the termcaster
Diffstat (limited to 'vt100.py')
-rw-r--r--vt100.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/vt100.py b/vt100.py
index b6ec1a9..97c345d 100644
--- a/vt100.py
+++ b/vt100.py
@@ -50,12 +50,9 @@ class vt100_cell(Structure):
def contents(self):
return self._contents[:self.len].decode('utf-8')
-new_prototype = CFUNCTYPE(c_void_p)
+new_prototype = CFUNCTYPE(c_void_p, c_int, c_int)
vt100_new = new_prototype(("vt100_screen_new", libvt100))
-set_window_size_prototype = CFUNCTYPE(None, c_void_p)
-vt100_set_window_size = set_window_size_prototype(("vt100_screen_set_window_size", libvt100))
-
process_string_prototype = CFUNCTYPE(c_int, c_void_p, c_char_p, c_size_t)
vt100_process_string = process_string_prototype(("vt100_screen_process_string", libvt100))
@@ -66,9 +63,8 @@ delete_prototype = CFUNCTYPE(None, c_void_p)
vt100_delete = delete_prototype(("vt100_screen_delete", libvt100))
class vt100(object):
- def __init__(self):
- self.vt = vt100_new()
- vt100_set_window_size(self.vt)
+ def __init__(self, rows, cols):
+ self.vt = vt100_new(rows, cols)
def __del__(self):
vt100_delete(self.vt)