chiark / gitweb /
28089875cd0db8648e06324e138375a1c53bba6f
[sympathy.git] / src / ansi.h
1 /*
2  * ansi.h:
3  *
4  * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
5  * All rights reserved.
6  *
7  */
8
9 /*
10  * $Id$
11  */
12
13 /*
14  * $Log$
15  * Revision 1.9  2008/02/20 19:36:06  james
16  * @@
17  *
18  * Revision 1.8  2008/02/20 19:25:09  james
19  * *** empty log message ***
20  *
21  * Revision 1.7  2008/02/13 16:57:29  james
22  * *** empty log message ***
23  *
24  * Revision 1.6  2008/02/13 01:08:18  james
25  * *** empty log message ***
26  *
27  * Revision 1.5  2008/02/07 12:16:04  james
28  * *** empty log message ***
29  *
30  * Revision 1.4  2008/02/07 00:43:27  james
31  * *** empty log message ***
32  *
33  * Revision 1.3  2008/02/07 00:39:13  james
34  * *** empty log message ***
35  *
36  * Revision 1.2  2008/02/06 11:30:37  james
37  * *** empty log message ***
38  *
39  * Revision 1.1  2008/02/03 23:31:25  james
40  * *** empty log message ***
41  *
42  */
43
44 #ifndef __ANSI_H__
45 #define __ANSI_H__
46
47 #define ANSI_INVAL -1
48
49 #define ANSI_ESCAPE_BUF_LEN 10
50 #define ANSI_ESCAPE_TIMEOUT     100000 /*in ms */
51
52 typedef struct
53 {
54   int in_escape;
55   struct timeval last_escape;
56   char escape_buf[ANSI_ESCAPE_BUF_LEN];
57   int escape_ptr;
58 } ANSI_Parser;
59
60 struct CRT_struct;
61 struct Context_struct;
62
63 typedef struct ANSI_struct
64 {
65   ANSI_Parser parser;
66
67   TTY *terminal;
68
69   CRT crt;
70   CRT_Pos pos;
71   CRT_Pos size;
72   int hide_cursor;
73   int attr;
74   int color;
75
76
77   int history_ptr;
78
79   void (*dispatch)(struct ANSI_struct *,struct Context_struct *);
80   void (*update)(struct ANSI_struct *,struct Context_struct *);
81   void (*oneshot)(struct ANSI_struct *,struct CRT_struct *);
82   void (*reset)(struct ANSI_struct *,struct CRT_struct *);
83   void (*terminal_reset)(struct ANSI_struct *);
84   void (*close)(struct ANSI_struct *);
85 } ANSI;
86
87
88 #endif /* __ANSI_H__ */