aboutsummaryrefslogtreecommitdiffstats
path: root/vt100
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-18 02:59:45 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-18 02:59:45 -0400
commit75a8e85aeb4000dad28a063876c34154024920a2 (patch)
treeea3a29b7a2502048d7b83a9d0301da968aaa6ebb /vt100
parent91295c22eff10201049e4fb926680b3db9e11dde (diff)
downloadlibvt100-python-75a8e85aeb4000dad28a063876c34154024920a2.tar.gz
libvt100-python-75a8e85aeb4000dad28a063876c34154024920a2.zip
add the layout of the vt100_screen struct
Diffstat (limited to 'vt100')
-rw-r--r--vt100/__init__.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/vt100/__init__.py b/vt100/__init__.py
index b05c633..3c320fa 100644
--- a/vt100/__init__.py
+++ b/vt100/__init__.py
@@ -109,12 +109,41 @@ class vt100_cell(Structure):
def is_wide(self):
return self._is_wide != 0
+class vt100_screen(Structure):
+ _fields_ = [
+ ("_grid", c_void_p),
+ ("_alternate", c_void_p),
+ ("_title", c_char_p),
+ ("_title_len", c_size_t),
+ ("_icon_name", c_char_p),
+ ("_icon_name_len", c_size_t),
+ ("_attrs", vt100_cell_attrs),
+ ("_scrollback_length", c_int),
+ ("_parser_state", c_void_p),
+ ("_hide_cursor", c_ubyte, 1),
+ ("_application_keypad", c_ubyte, 1),
+ ("_application_cursor", c_ubyte, 1),
+ ("_mouse_reporting_press", c_ubyte, 1),
+ ("_mouse_reporting_press_release", c_ubyte, 1),
+ ("_mouse_reporting_button_motion", c_ubyte, 1),
+ ("_mouse_reporting_sgr_mode", c_ubyte, 1),
+ ("_bracketed_paste", c_ubyte, 1),
+ ("_visual_bell", c_ubyte, 1),
+ ("_audible_bell", c_ubyte, 1),
+ ("_update_title", c_ubyte, 1),
+ ("_update_icon_name", c_ubyte, 1),
+ ("_has_selection", c_ubyte, 1),
+ ("_dirty", c_ubyte, 1),
+ ("_custom_scrollback_length", c_ubyte, 1),
+ ]
+
# XXX process/cell need mutexes
class vt100(object):
def __init__(self, rows, cols):
self.rows = rows
self.cols = cols
self.vt = vt100_raw.new(rows, cols)
+ self.screen = vt100_screen.from_address(self.vt)
def __del__(self):
vt100_raw.delete(self.vt)