From owner-ports-jp@jp.FreeBSD.org Fri Jul  2 04:34:10 2004
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id i61JYAL03295;
	Fri, 2 Jul 2004 04:34:10 +0900 (JST)
	(envelope-from owner-ports-jp@jp.FreeBSD.org)
Received: from mocha.argv.org (mocha.argv.org [210.249.69.194])
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) with ESMTP/inet id i61JYAI03290
	for <ports-jp@jp.FreeBSD.org>; Fri, 2 Jul 2004 04:34:10 +0900 (JST)
	(envelope-from seiken@ARGV.org)
Received: (qmail 62307 invoked from network); 1 Jul 2004 19:34:06 -0000
Received: from akane.argv.org (210.249.69.195)
  by mocha.argv.org with SMTP; 1 Jul 2004 19:34:06 -0000
Received: (qmail 25436 invoked from network); 1 Jul 2004 19:34:05 -0000
Received: from localhost.argv.org (HELO localhost) (127.0.0.1)
  by localhost.argv.org with SMTP; 1 Jul 2004 19:34:05 -0000
Message-Id: <20040702.043405.193707582.seiken@ARGV.org>
To: ports-jp@jp.FreeBSD.org
From: =?iso-2022-jp?B?GyRCQFpMQEAvN3sbKEI=?= (KIRIAKE Masanori)
 <seiken@ARGV.org>
X-Mailer: Mew version 4.0.66 on Emacs 21.3.50.1 i386-unknown-freebsd5.2/
 Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Multipart/Mixed;
 boundary="--Next_Part(Fri_Jul__2_04_34_05_2004_364)--"
Content-Transfer-Encoding: 7bit
Reply-To: ports-jp@jp.FreeBSD.org
Precedence: list
Date: Fri, 02 Jul 2004 04:34:05 +0900
X-Sequence: ports-jp 14835
Subject: [ports-jp 14835] screen with shared memory patch
Sender: owner-ports-jp@jp.FreeBSD.org
X-Originator: seiken@ARGV.org
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+040628

----Next_Part(Fri_Jul__2_04_34_05_2004_364)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

$B@ZL@$H$b$&$7$^$9!#(B

UN*X$B$N%3%s%=!<%k2hLL$rE@;z%G%#%9%W%l%$$KI=<($9$k(B brltty $B$J$k%=%U%H$,$"(B
$B$k$N$G$9$,!"(B brltty-3.5 $B$G(BFreeBSD$B%5%]!<%H$,DI2C$5$l$?$h$&$G$9!#$3$N(B
port$B$b:n@.$;$M$P$H;W$C$F$$$^$9$,!"$=$l$h$jA0$K!#(B

$B$3$N(Bbrltty$B$O!"(Bscreen$B$r;H$C$F2hLL>pJs$r<hF@$7$^$9!#(Bscreen$B$K%Q%C%A$rE,MQ(B
$B$9$kI,MW$,$"$k$N$G$9!#(B

$B$H$F$b4JC1$G$O$"$j$^$9$,!"8=>u$N(Bport$B$X$N%Q%C%A$r:n$C$F$_$^$7$?!#:n$jJ}(B
$B$J$I$G%3%a%s%H$r$$$?$@$1$l$P9,$$$G$9!#$=$N8e(Bsend-pr$B$7$?$$$J$H;W$C$F$$(B
$B$^$9!#(B

$B$h$m$7$/$*4j$$$7$^$9!#(B

-----------------------------------------------------------------
*    Accessibility Research Group for the Visually Impaired     *
*    KIRIAKE Masanori    $B@ZL@!!@/7{(B                             *
*    E-Mail: seiken@ARGV.ORG  ICQ Number: 64208972              *
*    WebPage: http://www.ARGV.ORG/~seiken/                      *
*           Powered by FreeBSD 5.2-RELEASE                      *
-----------------------------------------------------------------

----Next_Part(Fri_Jul__2_04_34_05_2004_364)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename=diff

diff -urN screen/Makefile screen-shm/Makefile
--- screen/Makefile	Mon Jun 21 05:21:40 2004
+++ screen-shm/Makefile	Fri Jul  2 03:49:54 2004
@@ -21,6 +21,9 @@
 
 NO_PACKAGE=	Tends to loop using 100% CPU when used from package - perhaps it hard-codes information about the build host
 
+.if defined(WITH_SHM)
+EXTRA_PATCHES=  ${PATCHDIR}/shm-patch
+.endif
 .include <bsd.port.pre.mk>
 
 .if ${ARCH} == "alpha"
diff -urN screen/files/shm-patch screen-shm/files/shm-patch
--- screen/files/shm-patch	Thu Jan  1 09:00:00 1970
+++ screen-shm/files/shm-patch	Fri Jul  2 03:42:37 2004
@@ -0,0 +1,216 @@
+diff -ur ../../../screen-4.0.2/Makefile.in ./Makefile.in
+--- ../../../screen-4.0.2/Makefile.in	Fri Jul  2 03:34:12 2004
++++ ./Makefile.in	Fri Jul  2 03:35:50 2004
+@@ -46,7 +46,12 @@
+ # -DDUMPSHADOW
+ #	With shadow-pw screen would never dump core. Use this option if
+ #	you still want to have a core. Use only for debugging.
+-OPTIONS=
++# -DIPC_EXPORT_IMAGE
++#	Allows an other program to get the screen contetn through shared mem 
++#	 and ipc. This is used e.g. for braille and speech software.
++
++OPTIONS=-DIPC_EXPORT_IMAGE
++#OPTIONS=
+ #OPTIONS= -DDEBUG
+ 
+ SHELL=/bin/sh
+diff -ur ../../../screen-4.0.2/extern.h ./extern.h
+--- ../../../screen-4.0.2/extern.h	Fri Aug 22 21:27:57 2003
++++ ./extern.h	Fri Jul  2 03:36:18 2004
+@@ -139,6 +139,11 @@
+ extern void  FreePseudowin __P((struct win *));
+ #endif
+ extern void  nwin_compose __P((struct NewWindow *, struct NewWindow *, struct NewWindow *));
++
++#ifdef IPC_EXPORT_IMAGE
++extern void  CopyWinImage __P((struct win *, char *));
++#endif
++
+ extern int   DoStartLog __P((struct win *, char *, int));
+ extern int   ReleaseAutoWritelock __P((struct display *, struct win *));
+ extern int   ObtainAutoWritelock __P((struct display *, struct win *));
+diff -ur ../../../screen-4.0.2/sched.c ./sched.c
+--- ../../../screen-4.0.2/sched.c	Mon Sep  8 23:26:36 2003
++++ ./sched.c	Fri Jul  2 03:36:30 2004
+@@ -110,6 +110,10 @@
+   return min;
+ }
+ 
++#ifdef IPC_EXPORT_IMAGE
++ extern struct window *windows;
++#endif
++
+ void
+ sched()
+ {
+@@ -121,6 +125,11 @@
+ 
+   for (;;)
+     {
++#ifdef IPC_EXPORT_IMAGE
++      /* export image from last used window which is on top of the list */
++      CopyWinImage( windows, shm );
++#endif
++
+       if (calctimeout)
+ 	timeoutev = calctimo();
+       if (timeoutev)
+diff -ur ../../../screen-4.0.2/screen.c ./screen.c
+--- ../../../screen-4.0.2/screen.c	Mon Sep  8 23:26:41 2003
++++ ./screen.c	Fri Jul  2 03:37:35 2004
+@@ -71,6 +71,14 @@
+ #if (defined(AUX) || defined(_AUX_SOURCE)) && defined(POSIX)
+ # include <compat.h>
+ #endif
++
++#ifdef IPC_EXPORT_IMAGE
++# include <sys/ipc.h>
++# include <sys/shm.h>
++#endif
++
++
++
+ #if defined(USE_LOCALE) || defined(ENCODINGS)
+ # include <locale.h>
+ #endif
+@@ -78,6 +86,11 @@
+ # include <langinfo.h>
+ #endif
+ 
++#ifdef IPC_EXPORT_IMAGE
++# include <sys/ipc.h>
++# include <sys/shm.h>
++#endif
++
+ #include "screen.h"
+ #ifdef HAVE_BRAILLE
+ # include "braille.h"
+@@ -234,6 +247,12 @@
+ 
+ 
+ 
++
++#ifdef IPC_EXPORT_IMAGE
++char *shm;              /* pointer to shared memory segment */
++#endif
++
++
+ /*
+  * Do this last
+  */
+@@ -459,6 +478,37 @@
+ #ifdef ZMODEM
+   zmodem_sendcmd = SaveStr("!!! sz -vv -b ");
+   zmodem_recvcmd = SaveStr("!!! rz -vv -b -E");
++#endif
++
++#ifdef IPC_EXPORT_IMAGE
++  {
++    key_t key = 0xBACD072F;     /* random static IPC key */
++    int shmid;
++
++    /* Allocation of shared mem for 18000 bytes (screen text and attributes
++     * + few coord.).  We supose no screen will be wider than 132x66.
++     * 0x1C0 = [rwx------].
++     */
++    shmid = shmget( key, 18000, IPC_CREAT | 0x1C0 );
++    if( shmid < 0 )
++      {
++        Panic( errno, "shmget" );
++        /* NOTRECHED */
++      }
++    shm = shmat( shmid, 0, 0);
++    if ( shm == (void*)-1 )
++      {
++        Panic( errno, "shmat" );
++        /* NOTRECHED */
++      }
++    /* minimal initialisation just to have valid data */
++    shm[0] = 80;   /* scrdim x */
++    shm[1] = 1;    /* scrdim y */
++    shm[2] = 0;    /* csrpos x */
++    shm[3] = 0;    /* csrpos y */
++    strcpy( shm+4, "screen is initializing..." );
++    memset( shm+4+strlen(shm+4), ' ', 80);
++  }
+ #endif
+ 
+ #ifdef COPY_PASTE
+diff -ur ../../../screen-4.0.2/screen.h ./screen.h
+--- ../../../screen-4.0.2/screen.h	Fri Aug 22 21:28:43 2003
++++ ./screen.h	Fri Jul  2 03:37:08 2004
+@@ -288,6 +288,10 @@
+   int sym;	/* symbol defined in ttydev.h */
+ };
+ 
++#ifdef IPC_EXPORT_IMAGE
++char *shm;		  /* pointer to shared memory segment */
++#endif
++
+ /*
+  * windowlist orders
+  */
+diff -ur ../../../screen-4.0.2/window.c ./window.c
+--- ../../../screen-4.0.2/window.c	Fri Dec  5 22:45:41 2003
++++ ./window.c	Fri Jul  2 03:35:57 2004
+@@ -1993,6 +1993,59 @@
+     }
+ }
+ 
++
++#ifdef IPC_EXPORT_IMAGE
++
++void
++CopyWinImage( p, dest )
++struct win *p;
++char *dest;
++{
++  register char *s, *d = dest, *m;
++  register int x, y;
++  struct display *display = p->w_pdisplay;
++  int st = (display) ? D_status : 0;
++
++  if( p && p->w_mlines )
++    {
++      *d++ = p->w_width;                        /* scrdim x */
++      *d++ = p->w_height;                       /* scrdim y */
++      *d++ = (st) ? D_status_len : p->w_x;      /* csrpos x */
++      *d++ = (st) ? STATLINE : p->w_y;          /* csrpos y */
++      /* copy window image to buffer */
++      for( y = 0; y < p->w_height; y++ )
++        {
++          s = p->w_mlines[y].image;
++          x = p->w_width;
++          if( st && y == STATLINE )
++            for( m = D_status_lastmsg; *m && x; *d++ = *m++, s++, x-- );
++          for( ; x; *d++ = *s++, x-- );
++        }
++      /* copy attributes from window image to buffer */
++      for( y = 0; y < p->w_height; y++ )
++        {
++          s = p->w_mlines[y].attr;
++          x = p->w_width;
++          if( st && y == STATLINE )
++            for( ; x; *d++ = 0, s++, x-- );
++          for( ; x; *d++ = *s++, x-- );
++        }
++    }
++  else
++    {
++      /* no window pointer */
++      *d++ = 80;   /* scrdim x */
++      *d++ = 1;    /* scrdim y */
++      *d++ = 0;    /* csrpos x */
++      *d++ = 0;    /* csrpos y */
++      strcpy( d, "*** screen: no window pointer ***" );
++      memset( d+strlen(d), ' ', 80);
++    }
++}
++
++#endif	/* IPC_EXPORT_IMAGE */
++ 
++
+ #ifdef ZMODEM
+ 
+ static int

----Next_Part(Fri_Jul__2_04_34_05_2004_364)----
