chiark / gitweb /
*** empty log message ***
[sympathy.git] / src / vt102.c
index 40bef8eb7deda2d6a9c85e2e935519a3fed5a118..0253cdfdb76b1a9087212047e0ab05f303b04591 100644 (file)
@@ -10,6 +10,18 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.17  2008/02/07 01:58:28  james
+ * *** empty log message ***
+ *
+ * Revision 1.16  2008/02/07 01:57:46  james
+ * *** empty log message ***
+ *
+ * Revision 1.15  2008/02/07 00:43:27  james
+ * *** empty log message ***
+ *
+ * Revision 1.14  2008/02/07 00:40:23  james
+ * *** empty log message ***
+ *
  * Revision 1.13  2008/02/07 00:39:59  james
  * *** empty log message ***
  *
@@ -144,11 +156,6 @@ ESC)0
 
 CTRL-O
 
-ESC7
-ESC8
-ESCH
-ESCM
-ESC> 
 
 */
 
@@ -167,11 +174,10 @@ csi_ender (int c)
 }
 
 static inline int
-csi_starter (int c)
+scs_starter (int c)
 {
   switch (c)
     {
-    case '[':
     case '(':
     case ')':
       return 1;
@@ -179,6 +185,17 @@ csi_starter (int c)
   return 0;
 }
 
+static inline int
+csi_starter (int c)
+{
+  switch (c)
+    {
+    case '[':
+      return 1;
+    }
+  return 0;
+}
+
 static inline int
 in_margins (VT102 * v, CRT_Pos p)
 {
@@ -472,8 +489,10 @@ vt102_change_mode (VT102 * v, int private, char *ns, int set)
         case VT102_PRIVATE_MODE_CURSOR_MODE:
           if (v->application_keypad_mode)
             v->private_modes[m] = 0;
-          fprintf (stderr, "APPLICATION CURSOR MODE %d\n",
-                   v->private_modes[m]);
+#if 1
+          fprintf (stderr, "APPLICATION CURSOR MODE %d wanted %d\n",
+                   v->private_modes[m],set);
+#endif
           break;
         case VT102_PRIVATE_MODE_ORIGIN_MODE:
           vt102_cursor_home (v);
@@ -650,6 +669,11 @@ vt102_restore_state (VT102 * v)
   v->pending_wrap = 0;
 }
 
+void vt102_scs(VT102 *c,int g,int s)
+{
+/*Ignoring charsets*/
+}
+
 void
 vt102_parse_esc (VT102 * v, int c)
 {
@@ -940,12 +964,20 @@ vt102_parse_char (VT102 * v, int c)
           p->in_csi++;
           p->in_escape = 0;
         }
+      else if (scs_starter(c)) {
+       p->in_scs=c;
+        p->in_escape = 0;
+       }
       else
         {
           p->in_escape = 0;
           vt102_parse_esc (v, c);
         }
     }
+  else if (p->in_scs) {
+       vt102_scs(v,p->in_scs,c);
+       p->in_scs=0;
+  }
   else
     {
 
@@ -979,7 +1011,13 @@ vt102_parse_char (VT102 * v, int c)
           vt102_cursor_carriage_return (v);
           break;
          /*SO*/ case 14:
+               /*select G1*/
+               /*Ignoring charsets*/
+               break;
          /*SI*/ case 15:
+               /*select G0*/
+               /*Ignoring charsets*/
+               break;
          /*DLE*/ case 16:
         /*DC1 */ case 17:
         /*DC2 */ case 18:
@@ -1039,6 +1077,7 @@ vt102_parser_reset (VT102_parser * p)
   p->in_csi = 0;
   p->in_escape = 0;
   p->csi_ptr = 0;
+ p->in_scs=0;
 }
 
 
@@ -1047,7 +1086,7 @@ vt102_send (VT102 * v, uint8_t key)
 {
   uint8_t c;
 #if 0
-  fprintf(stderr,"vts: %d(%c)\n",key,(key>31)?key:' ');
+  fprintf (stderr, "vts: %d(%c)\n", key, (key > 31) ? key : ' ');
 #endif
   if ((key > 31) && (key < 127))
     {