Initial revision
[apps/madtty.git] / roteprivate.h
1 #ifndef btco_ROTE_vtstate_h
2 #define btco_ROTE_vtstate_h
3
4 #define ESEQ_BUF_SIZE 128  /* size of escape sequence buffer */
5 #define MAX_CUSTOM_ES_HANDLERS 32
6
7 /* Terminal private data */
8 struct RoteTermPrivate_ {
9    bool escaped;              /* whether we are currently reading an
10                                * escape sequence */
11
12    bool graphmode;            /* whether terminal is in graphical 
13                                * character mode or not */
14
15    int scrolltop, scrollbottom;  /* current scrolling region of terminal */
16    int saved_x, saved_y;         /* saved cursor position */
17
18    char esbuf[ESEQ_BUF_SIZE]; /* 0-terminated string. Does NOT include
19                                * the initial escape (\x1B) character. */
20    int esbuf_len;             /* length of buffer. The following property
21                                * is always kept: esbuf[esbuf_len] == '\0' */
22
23    int pty;                   /* file descriptor for the pty attached to
24                                * this terminal. -1 if none. */
25
26    /* custom escape sequence handler */
27    rote_es_handler_t handler;
28 };
29
30 #endif
31