chiark / gitweb /
*** empty log message ***
[sympathy.git] / src / ansi.h
index 2a5977b973ad7def2834821a7bc6bc41abd11c6d..22c0bcdd14aadf69dfef0e10aceaf4a6c2120d47 100644 (file)
 
 /*
  * $Log$
+ * Revision 1.11  2008/02/20 20:16:07  james
+ * *** empty log message ***
+ *
+ * Revision 1.10  2008/02/20 19:44:37  james
+ * @@
+ *
+ * Revision 1.9  2008/02/20 19:36:06  james
+ * @@
+ *
+ * Revision 1.8  2008/02/20 19:25:09  james
+ * *** empty log message ***
+ *
+ * Revision 1.7  2008/02/13 16:57:29  james
+ * *** empty log message ***
+ *
+ * Revision 1.6  2008/02/13 01:08:18  james
+ * *** empty log message ***
+ *
+ * Revision 1.5  2008/02/07 12:16:04  james
+ * *** empty log message ***
+ *
+ * Revision 1.4  2008/02/07 00:43:27  james
+ * *** empty log message ***
+ *
+ * Revision 1.3  2008/02/07 00:39:13  james
+ * *** empty log message ***
+ *
  * Revision 1.2  2008/02/06 11:30:37  james
  * *** empty log message ***
  *
 
 #define ANSI_INVAL -1
 
+#define ANSI_ESCAPE_BUF_LEN 10
+#define ANSI_ESCAPE_TIMEOUT    100000 /*in ms */
+
 typedef struct
 {
-  int fd;
+  int in_escape;
+  struct timeval last_escape;
+  char escape_buf[ANSI_ESCAPE_BUF_LEN];
+  int escape_ptr;
+} ANSI_Parser;
+
+struct CRT_struct;
+struct Context_struct;
+
+typedef struct ANSI_struct
+{
+  ANSI_Parser parser;
+
+  TTY *terminal;
 
   CRT crt;
   CRT_Pos pos;
   CRT_Pos size;
   int hide_cursor;
-
   int attr;
+  int color;
+
+  int history_ptr;
+  FILE *file;
 
+  int (*dispatch)(struct ANSI_struct *,struct Context_struct *);
+  void (*update)(struct ANSI_struct *,struct Context_struct *);
+  void (*one_shot)(struct ANSI_struct *,struct CRT_struct *);
+  void (*reset)(struct ANSI_struct *,struct CRT_struct *);
+  void (*terminal_reset)(struct ANSI_struct *);
+  void (*close)(struct ANSI_struct *);
 } ANSI;