Support cursor, be an rxvt, fix emacs, vim, screen, and mutt.
[apps/madtty.git] / madtty / madtty.h
index 2defa71..c7e2a82 100644 (file)
 #include <wchar.h>
 
 #define MAX_CSI_ES_PARAMS 32
-#define ESEQ_BUF_SIZE     128  /* size of escape sequence buffer */
 
-typedef struct mtty_row_t {
-    wchar_t  *text;
-    uint16_t *attr;
-} mtty_row_t;
-
-/* Represents each of the text cells in the terminal screen */
-typedef struct {
-    char s[4];
-    char len;
-    int16_t attrs;
-} RoteCell;
+typedef struct mtty_row_t mtty_row_t;
 
 typedef struct {
     int   pty;
     pid_t childpid;
 
     /* flags */
-    unsigned insert    : 1;
-    unsigned escaped   : 1;
-    unsigned graphmode : 1;
+    unsigned seen_input : 1;
+    unsigned insert     : 1;
+    unsigned escaped    : 1;
+    unsigned graphmode  : 1;
+    unsigned curshid    : 1;
 
     /* geometry */
     int rows, cols;
@@ -70,8 +61,8 @@ typedef struct {
     /* buffers and parsing state */
     mbstate_t ps;
     char rbuf[BUFSIZ];
-    char esbuf[ESEQ_BUF_SIZE];
-    int  rbuf_len, esbuf_len;
+    char ebuf[BUFSIZ];
+    int  rlen, elen;
 } madtty_t;
 
 void madtty_initialize(void);