Add shm flavor, to use with brltty
ok brad@
This commit is contained in:
parent
1faebf6f10
commit
e724bd1f82
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.49 2003/10/19 03:59:27 brad Exp $
|
||||
# $OpenBSD: Makefile,v 1.50 2003/11/22 00:56:58 espie Exp $
|
||||
|
||||
COMMENT= "multi-screen window manager"
|
||||
|
||||
@ -23,12 +23,15 @@ SUBST_VARS= VERSION
|
||||
CONFIGURE_STYLE= gnu
|
||||
CONFIGURE_ARGS= --with-sys-screenrc="${SYSCONFDIR}/screenrc"
|
||||
|
||||
FLAVORS= static
|
||||
FLAVORS= static shm
|
||||
FLAVOR?=
|
||||
|
||||
.if ${FLAVOR:L} == "static"
|
||||
CONFIGURE_ENV= LDFLAGS="-static"
|
||||
.endif
|
||||
.if ${FLAVOR:L} == "shm"
|
||||
PATCH_LIST= patch-* shmpatch-*
|
||||
.endif
|
||||
|
||||
ALL_TARGET= screen screen.info
|
||||
|
||||
|
17
misc/screen/patches/shmpatch-Makefile_in
Normal file
17
misc/screen/patches/shmpatch-Makefile_in
Normal file
@ -0,0 +1,17 @@
|
||||
$OpenBSD: shmpatch-Makefile_in,v 1.1 2003/11/22 00:56:58 espie Exp $
|
||||
--- Makefile.in.orig 2003-09-18 18:13:02.000000000 +0200
|
||||
+++ Makefile.in 2003-11-17 23:37:54.000000000 +0100
|
||||
@@ -46,7 +46,12 @@ AWK = @AWK@
|
||||
# -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
|
32
misc/screen/patches/shmpatch-configure_in
Normal file
32
misc/screen/patches/shmpatch-configure_in
Normal file
@ -0,0 +1,32 @@
|
||||
$OpenBSD: shmpatch-configure_in,v 1.1 2003/11/22 00:56:58 espie Exp $
|
||||
--- configure.in.orig 2003-06-03 13:58:24.000000000 +0200
|
||||
+++ configure.in 2003-11-17 23:37:54.000000000 +0100
|
||||
@@ -1193,17 +1193,17 @@ main() {
|
||||
exit(0); /* libc version works properly. */
|
||||
}], AC_DEFINE(USEMEMCPY))
|
||||
|
||||
-AC_MSG_CHECKING(long file names)
|
||||
-(echo 1 > /tmp/conftest9012345) 2>/dev/null
|
||||
-(echo 2 > /tmp/conftest9012346) 2>/dev/null
|
||||
-val=`cat /tmp/conftest9012345 2>/dev/null`
|
||||
-if test -f /tmp/conftest9012345 && test "$val" = 1; then
|
||||
-AC_MSG_RESULT(yes)
|
||||
-else
|
||||
-AC_MSG_RESULT(no)
|
||||
-AC_DEFINE(NAME_MAX, 14)
|
||||
-fi
|
||||
-rm -f /tmp/conftest*
|
||||
+#AC_MSG_CHECKING(long file names)
|
||||
+#(echo 1 > /tmp/conftest9012345) 2>/dev/null
|
||||
+#(echo 2 > /tmp/conftest9012346) 2>/dev/null
|
||||
+#val=`cat /tmp/conftest9012345 2>/dev/null`
|
||||
+#if test -f /tmp/conftest9012345 && test "$val" = 1; then
|
||||
+#AC_MSG_RESULT(yes)
|
||||
+#else
|
||||
+#AC_MSG_RESULT(no)
|
||||
+#AC_DEFINE(NAME_MAX, 14)
|
||||
+#fi
|
||||
+#rm -f /tmp/conftest*
|
||||
|
||||
AC_MSG_CHECKING(for vsprintf)
|
||||
AC_TRY_LINK(,[vsprintf(0,0,0);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
|
15
misc/screen/patches/shmpatch-extern_h
Normal file
15
misc/screen/patches/shmpatch-extern_h
Normal file
@ -0,0 +1,15 @@
|
||||
$OpenBSD: shmpatch-extern_h,v 1.1 2003/11/22 00:56:58 espie Exp $
|
||||
--- extern.h.orig 2003-08-22 14:27:57.000000000 +0200
|
||||
+++ extern.h 2003-11-17 23:37:54.000000000 +0100
|
||||
@@ -139,6 +139,11 @@ extern int winexec __P((char **));
|
||||
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 *));
|
26
misc/screen/patches/shmpatch-sched_c
Normal file
26
misc/screen/patches/shmpatch-sched_c
Normal file
@ -0,0 +1,26 @@
|
||||
$OpenBSD: shmpatch-sched_c,v 1.1 2003/11/22 00:56:58 espie Exp $
|
||||
--- sched.c.orig 2003-09-08 16:26:36.000000000 +0200
|
||||
+++ sched.c 2003-11-17 23:37:54.000000000 +0100
|
||||
@@ -110,6 +110,10 @@ calctimo()
|
||||
return min;
|
||||
}
|
||||
|
||||
+#ifdef IPC_EXPORT_IMAGE
|
||||
+ extern struct window *windows;
|
||||
+#endif
|
||||
+
|
||||
void
|
||||
sched()
|
||||
{
|
||||
@@ -121,6 +125,11 @@ sched()
|
||||
|
||||
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)
|
81
misc/screen/patches/shmpatch-screen_c
Normal file
81
misc/screen/patches/shmpatch-screen_c
Normal file
@ -0,0 +1,81 @@
|
||||
$OpenBSD: shmpatch-screen_c,v 1.1 2003/11/22 00:56:58 espie Exp $
|
||||
--- screen.c.orig 2003-09-08 16:26:41.000000000 +0200
|
||||
+++ screen.c 2003-11-17 23:37:54.000000000 +0100
|
||||
@@ -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 @@ struct win *console_window;
|
||||
|
||||
|
||||
|
||||
+
|
||||
+#ifdef IPC_EXPORT_IMAGE
|
||||
+char *shm; /* pointer to shared memory segment */
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
/*
|
||||
* Do this last
|
||||
*/
|
||||
@@ -461,6 +480,37 @@ char **av;
|
||||
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
|
||||
CompileKeys((char *)0, 0, mark_key_tab);
|
||||
#endif
|
14
misc/screen/patches/shmpatch-screen_h
Normal file
14
misc/screen/patches/shmpatch-screen_h
Normal file
@ -0,0 +1,14 @@
|
||||
$OpenBSD: shmpatch-screen_h,v 1.1 2003/11/22 00:56:58 espie Exp $
|
||||
--- screen.h.orig 2003-08-22 14:28:43.000000000 +0200
|
||||
+++ screen.h 2003-11-17 23:37:54.000000000 +0100
|
||||
@@ -288,6 +288,10 @@ struct baud_values
|
||||
int sym; /* symbol defined in ttydev.h */
|
||||
};
|
||||
|
||||
+#ifdef IPC_EXPORT_IMAGE
|
||||
+char *shm; /* pointer to shared memory segment */
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* windowlist orders
|
||||
*/
|
63
misc/screen/patches/shmpatch-window_c
Normal file
63
misc/screen/patches/shmpatch-window_c
Normal file
@ -0,0 +1,63 @@
|
||||
$OpenBSD: shmpatch-window_c,v 1.1 2003/11/22 00:56:58 espie Exp $
|
||||
--- window.c.orig 2003-09-08 16:27:21.000000000 +0200
|
||||
+++ window.c 2003-11-17 23:37:54.000000000 +0100
|
||||
@@ -1993,6 +1993,59 @@ char *data;
|
||||
}
|
||||
}
|
||||
|
||||
+
|
||||
+#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
|
@ -9,3 +9,4 @@ regions between windows.
|
||||
|
||||
Flavors:
|
||||
static - Build with statically linked binaries.
|
||||
shm - export screen as shared memory, useful for brltty.
|
||||
|
Loading…
Reference in New Issue
Block a user