chiark / gitweb /
*** empty log message ***
authorjames <james>
Thu, 28 Feb 2008 12:12:24 +0000 (12:12 +0000)
committerjames <james>
Thu, 28 Feb 2008 12:12:24 +0000 (12:12 +0000)
apps/clients.c
src/keydis.c
src/tty.c
src/vt102.c

index 598121e5ffaf2405d410588b49591a73955b7d8e..c75c9841e69c4db5b46ef8f5dd137c7de32df88e 100644 (file)
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.12  2008/02/28 12:12:24  james
+ * *** empty log message ***
+ *
  * Revision 1.11  2008/02/23 11:48:51  james
  * *** empty log message ***
  *
@@ -85,6 +88,12 @@ client_msg (IPC_Msg * m, Context * c)
     case IPC_MSG_TYPE_HANGUP:
       tty_hangup (c->t);
       break;
+    case IPC_MSG_TYPE_SETSIZE:
+      vt102_resize(c,m->setsize.winsize);
+      break;
+    case IPC_MSG_TYPE_RESET:
+      vt102_reset(c);
+      break;
     default:
       fprintf (stderr, "Unhandeled message type %d\n", m->hdr.type);
     }
index 9a7bd45398c00b86f8363bcb931ea1d6263dd673..27140ec77d4d9108995fe595d50a31b9c61c38d3 100644 (file)
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.6  2008/02/28 12:12:25  james
+ * *** empty log message ***
+ *
  * Revision 1.5  2008/02/23 11:48:37  james
  * *** empty log message ***
  *
@@ -116,6 +119,30 @@ keydis_ipc_hangup (KeyDis * _t, Context * c)
   return 0;
 }
 
+
+static int
+keydis_ipc_set_size (KeyDis * _t, Context * c,int w,int h)
+{
+CRT_Pos p={w,h};
+
+  KeyDis_IPC *t = (KeyDis_IPC *) _t;
+
+  ipc_msg_send_setsize (t->s,p);
+
+  return 0;
+}
+
+
+static int
+keydis_ipc_reset (KeyDis * _t, Context * c)
+{
+  KeyDis_IPC *t = (KeyDis_IPC *) _t;
+
+  ipc_msg_send_reset (t->s);
+
+  return 0;
+}
+
 static int
 keydis_vt102_key (KeyDis * _t, Context * c, int key)
 {
@@ -179,6 +206,27 @@ keydis_vt102_hangup (KeyDis * _t, Context * c)
   return 0;
 }
 
+static int
+keydis_vt102_set_size (KeyDis * _t, Context * c,int w, int h)
+{
+  KeyDis_VT102 *t = (KeyDis_VT102 *) _t;
+  CRT_Pos p={w,h};
+  
+  vt102_resize(c,p);
+
+  return 0;
+}
+
+static int
+keydis_vt102_reset (KeyDis * _t, Context * c)
+{
+  KeyDis_VT102 *t = (KeyDis_VT102 *) _t;
+
+  vt102_reset (c);
+
+  return 0;
+}
+
 
 
 KeyDis *
@@ -192,6 +240,8 @@ keydis_vt102_new (void)
   t->set_flow = keydis_vt102_set_flow;
   t->set_ansi = keydis_vt102_set_ansi;
   t->hangup = keydis_vt102_hangup;
+  t->set_size = keydis_vt102_set_size;
+  t->reset = keydis_vt102_reset;
   return (KeyDis *) t;
 }
 
@@ -207,6 +257,8 @@ keydis_ipc_new (Socket * s)
   t->set_flow = keydis_ipc_set_flow;
   t->set_ansi = keydis_ipc_set_ansi;
   t->hangup = keydis_ipc_hangup;
+  t->set_size = keydis_ipc_set_size;
+  t->reset = keydis_ipc_reset;
   t->s = s;
   return (KeyDis *) t;
 }
index 316133b7e111346b9eb176d0e5b325b558933e53..e165dd58d8a24b63438d36089010a8fd5a7b4865 100644 (file)
--- a/src/tty.c
+++ b/src/tty.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.16  2008/02/28 12:12:25  james
+ * *** empty log message ***
+ *
  * Revision 1.15  2008/02/28 00:10:44  james
  * *** empty log message ***
  *
@@ -318,6 +321,12 @@ tty_set_flow (TTY * t, int flow)
 
 }
 
+void tty_winch(TTY *y,CRT_Pos p)
+{
+//FIXME:
+
+}
+
 void
 tty_hangup (TTY * t)
 {
index f1e00e8ae8d6211c450e08da548d461fc5035035..d94bc4d92d1a0946a7f6aa922cb2fd706ca3294a 100644 (file)
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.50  2008/02/28 12:12:25  james
+ * *** empty log message ***
+ *
  * Revision 1.49  2008/02/28 11:27:48  james
  * *** empty log message ***
  *
@@ -2090,6 +2093,8 @@ vt102_set_ansi (VT102 * v, int ansi)
 void vt102_resize(Context *c,CRT_Pos size)
 {
 
+       if (!size.x) size.x=c->v->current_size.x;
+       if (!size.y) size.x=c->v->current_size.y;
 
       if (size.x < 1)
         size.x = 1;