summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmadeusz Sławiński (amade) <amade@asmblr.net>2011-01-04 02:00:23 +0100
committerAmadeusz Sławiński <amade@asmblr.net>2014-05-15 14:32:48 +0200
commitf1115ba0d242a5391aa07f482c79c918d434c602 (patch)
tree2877a98c4fbcdfa830a6c2315bfadbb76f52655e
parent61c6df7dd9f9cc4f86780fedf7b4af114151a6a3 (diff)
downloadscreen-f1115ba0d242a5391aa07f482c79c918d434c602.tar.gz
remove braille support
it's not like i can test it and code had comment that it probably has bugs also comments on ml suggest that there are better ways and it's not used
-rw-r--r--src/Makefile.in26
-rw-r--r--src/acconfig.h10
-rw-r--r--src/ansi.c1
-rw-r--r--src/braille.c945
-rw-r--r--src/braille.h83
-rw-r--r--src/braille_tsi.c319
-rw-r--r--src/comm.c33
-rw-r--r--src/display.c11
-rw-r--r--src/extern.h14
-rw-r--r--src/layer.c37
-rw-r--r--src/process.c4
-rw-r--r--src/screen.c25
-rw-r--r--src/window.h3
13 files changed, 9 insertions, 1502 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index e7f3053..5111288 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -63,13 +63,13 @@ SHELL=/bin/sh
CFILES= screen.c ansi.c fileio.c mark.c misc.c resize.c socket.c \
search.c tty.c term.c window.c utmp.c loadav.c putenv.c help.c \
termcap.c input.c attacher.c pty.c process.c display.c comm.c \
- kmapdef.c acls.c braille.c braille_tsi.c logfile.c layer.c \
+ kmapdef.c acls.c logfile.c layer.c \
sched.c teln.c nethack.c encoding.c canvas.c layout.c viewport.c \
list_display.c list_generic.c list_window.c
OFILES= screen.o ansi.o fileio.o mark.o misc.o resize.o socket.o \
search.o tty.o term.o window.o utmp.o loadav.o putenv.o help.o \
termcap.o input.o attacher.o pty.o process.o display.o comm.o \
- kmapdef.o acls.o braille.o braille_tsi.o logfile.o layer.o \
+ kmapdef.o acls.o logfile.o layer.o \
list_generic.o list_display.o list_window.o \
sched.o teln.o nethack.o encoding.o canvas.o layout.o viewport.o
@@ -184,7 +184,7 @@ $(SCREEN).tar: .version term.h comm.h tty.c kmapdef.c
mkdir dist/$(SCREEN)
ln acls.h ansi.h display.h extern.h logfile.h mark.h os.h \
layer.h patchlevel.h screen.h window.h image.h \
- term.sh tty.sh comm.sh braille.h \
+ term.sh tty.sh comm.sh \
sched.h \
$(CFILES) \
ChangeLog COPYING INSTALL NEWS* TODO install.sh \
@@ -276,10 +276,10 @@ depend.in: $(CFILES) term.h
### Dependencies:
screen.o: layout.h viewport.h canvas.h screen.c config.h screen.h os.h ansi.h acls.h \
- comm.h layer.h term.h image.h display.h window.h braille.h \
+ comm.h layer.h term.h image.h display.h window.h \
patchlevel.h logfile.h extern.h
ansi.o: layout.h viewport.h canvas.h ansi.c config.h screen.h os.h ansi.h acls.h \
- comm.h layer.h term.h image.h display.h window.h braille.h extern.h \
+ comm.h layer.h term.h image.h display.h window.h extern.h \
logfile.h
fileio.o: layout.h viewport.h canvas.h fileio.c config.h screen.h os.h ansi.h acls.h \
comm.h layer.h term.h image.h display.h window.h extern.h
@@ -316,19 +316,13 @@ pty.o: layout.h viewport.h canvas.h pty.c config.h screen.h os.h ansi.h acls.h c
process.o: layout.h viewport.h canvas.h process.c config.h screen.h os.h ansi.h acls.h \
comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
display.o: layout.h viewport.h canvas.h display.c config.h screen.h os.h ansi.h acls.h \
- comm.h layer.h term.h image.h display.h window.h extern.h braille.h
+ comm.h layer.h term.h image.h display.h window.h extern.h
canvas.o: layout.h viewport.h canvas.h canvas.c config.h screen.h os.h ansi.h acls.h \
- comm.h layer.h term.h image.h display.h window.h extern.h \
- braille.h
+ comm.h layer.h term.h image.h display.h window.h extern.h
comm.o: layout.h viewport.h canvas.h comm.c config.h acls.h comm.h
kmapdef.o: layout.h viewport.h canvas.h kmapdef.c config.h
acls.o: layout.h viewport.h canvas.h acls.c config.h screen.h os.h ansi.h acls.h comm.h \
layer.h term.h image.h display.h window.h extern.h
-braille.o: layout.h viewport.h canvas.h braille.c config.h screen.h os.h ansi.h acls.h \
- comm.h layer.h term.h image.h display.h window.h extern.h braille.h
-braille_tsi.o: layout.h viewport.h canvas.h braille_tsi.c config.h screen.h os.h ansi.h \
- acls.h comm.h layer.h term.h image.h display.h window.h extern.h \
- braille.h
logfile.o: layout.h viewport.h canvas.h logfile.c config.h screen.h os.h ansi.h acls.h \
comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
layer.o: layout.h viewport.h canvas.h layer.c config.h screen.h os.h ansi.h acls.h \
@@ -342,11 +336,9 @@ nethack.o: layout.h viewport.h canvas.h nethack.c config.h screen.h os.h ansi.h
encoding.o: layout.h viewport.h canvas.h encoding.c config.h screen.h os.h ansi.h acls.h \
comm.h layer.h term.h image.h display.h window.h extern.h
layout.o: layout.h viewport.h canvas.h layout.c config.h screen.h os.h ansi.h acls.h \
- comm.h layer.h term.h image.h display.h window.h extern.h \
- braille.h
+ comm.h layer.h term.h image.h display.h window.h extern.h
viewport.o: layout.h viewport.h canvas.h viewport.c config.h screen.h os.h ansi.h acls.h \
- comm.h layer.h term.h image.h display.h window.h extern.h \
- braille.h
+ comm.h layer.h term.h image.h display.h window.h extern.h
list_generic.o: list_generic.h list_generic.c layer.h screen.h
list_display.o: list_generic.h list_display.c layer.h screen.h
list_window.o: list_generic.h list_window.c window.h layer.h screen.h
diff --git a/src/acconfig.h b/src/acconfig.h
index 2e46985..b36392f 100644
--- a/src/acconfig.h
+++ b/src/acconfig.h
@@ -169,16 +169,6 @@
/*
- * If you have a braille display you should define HAVE_BRAILLE.
- * The code inside #ifdef HAVE_BRAILLE was contributed by Hadi Bargi
- * Rangin (bargi@dots.physics.orst.edu).
- * WARNING: this is more or less unsupported code, it may be full of
- * bugs leading to security holes, enable at your own risk!
- */
-#undef HAVE_BRAILLE
-
-
-/*
* As error messages are mostly meaningless to the user, we
* try to throw out phrases that are somewhat more familiar
* to ...well, at least familiar to us NetHack players.
diff --git a/src/ansi.c b/src/ansi.c
index b22b099..dc4751a 100644
--- a/src/ansi.c
+++ b/src/ansi.c
@@ -34,7 +34,6 @@
#include "config.h"
#include "screen.h"
-#include "braille.h"
#include "extern.h"
#include "logfile.h"
diff --git a/src/braille.c b/src/braille.c
deleted file mode 100644
index 62ed862..0000000
--- a/src/braille.c
+++ /dev/null
@@ -1,945 +0,0 @@
-/*
- * A braille interface to unix tty terminals
- *
- * Authors: Hadi Bargi Rangin bargi@dots.physics.orst.edu
- * Bill Barry barryb@dots.physics.orst.edu
- *
- * Copyright (c) 1995 by Science Access Project, Oregon State University.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program (see the file COPYING); if not, see
- * http://www.gnu.org/licenses/, or contact Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
- *
- ****************************************************************
- */
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-#include "config.h"
-#include "screen.h"
-#include "extern.h"
-#include "braille.h"
-
-#ifdef HAVE_BRAILLE
-
-
-extern int bd_init_powerbraille_40 (void);
-extern int bd_init_powerbraille_80 (void);
-extern int bd_init_navigator_40 (void);
-
-extern struct layer *flayer;
-extern struct display *displays, *display;
-extern char *rc_name;
-
-
-
-
-/* global variables */
-
-struct braille_display bd;
-
-struct bd_type {
- char *name;
- int (*init) (void);
-};
-
-static struct bd_type bd_typelist[] =
-{
- {"powerbraille_40", bd_init_powerbraille_40},
- {"powerbraille_80", bd_init_powerbraille_80},
- {"navigator_40" , bd_init_navigator_40}
-};
-
-static void position_braille_cursor (void);
-static int initialize_braille_display_type (char *);
-static int open_braille_device ();
-static int load_braille_table (char *);
-static void bd_signal (void);
-static void bd_bc_left (void);
-static void bd_bc_right (void);
-static void bd_bc_up (void);
-static void bd_bc_down (void);
-static void bd_upper_left (void);
-static void bd_upper_right (void);
-static void bd_lower_left (void);
-static void bd_lower_right (void);
-static int bd_do_search (int, int, int);
-static void bd_normalize (int, int);
-static void bd_readev_fn (struct event *, char *);
-static void bd_writeev_fn (struct event *, char *);
-static void bd_selectev_fn (struct event *, char *);
-
-static unsigned char btable_local [] =
-{
- 0xC8,0xC1,0xC3,0xC9,0xD9,0xD1,0xCB,0xDB,
- 0xD3,0xCA,0xDA,0xC5,0xC7,0xCD,0xDD,0xD5,
- 0xCF,0xDF,0xD7,0xCE,0xDE,0xE5,0xE7,0xFA,
- 0xED,0xFD,0xF5,0xEA,0xF3,0xFB,0xD8,0xF8,
- 0x00,0x2E,0x10,0x3C,0x2B,0x29,0x2F,0x04,
- 0x37,0x3E,0x21,0x2C,0x20,0x24,0x28,0x0C,
- 0x34,0x02,0x06,0x12,0x32,0x22,0x16,0x36,
- 0x26,0x14,0x31,0x30,0x23,0x3F,0x1C,0x39,
- 0x48,0x41,0x43,0x49,0x59,0x51,0x4B,0x5B,
- 0x53,0x4A,0x5A,0x45,0x47,0x4D,0x5D,0x55,
- 0x4F,0x5F,0x57,0x4E,0x5E,0x65,0x67,0x7A,
- 0x6D,0x7D,0x75,0x6A,0x73,0x7B,0x58,0x38,
- 0x08,0x01,0x03,0x09,0x19,0x11,0x0B,0x1B,
- 0x13,0x0A,0x1A,0x05,0x07,0x0D,0x1D,0x15,
- 0x0F,0x1F,0x17,0x0E,0x1E,0x25,0x27,0x3A,
- 0x2D,0x3D,0x35,0x2A,0x33,0x3B,0x18,0x78,
- 0x88,0x81,0x83,0x89,0x99,0x91,0x8B,0x9B,
- 0x93,0x8A,0x9A,0x85,0x87,0x8D,0x9D,0x95,
- 0x8F,0x9F,0x97,0x8E,0x9E,0xA5,0xA7,0xBA,
- 0xAD,0xBD,0xB5,0xAA,0xB3,0xBB,0x98,0xB8,
- 0x40,0x6E,0x50,0x7C,0x6B,0x69,0x6F,0x44,
- 0x77,0x7E,0x61,0x6C,0x60,0x64,0x68,0x4C,
- 0x74,0x42,0x46,0x52,0x72,0x62,0x56,0x76,
- 0x66,0x54,0x71,0x70,0x63,0x7F,0x5C,0x79,
- 0xC0,0xEE,0xD0,0xFC,0xEB,0xE9,0xEF,0xC4,
- 0xF7,0xFE,0xE1,0xEC,0xE0,0xE4,0xE8,0xCC,
- 0xF4,0xC2,0xC6,0xD2,0xF2,0xE2,0xD6,0xF6,
- 0xE6,0xD4,0xF1,0xF0,0xE3,0xFF,0xDC,0xF9,
- 0x80,0xAE,0x90,0xBC,0xAB,0xA9,0xAF,0x84,
- 0xB7,0xBE,0xA1,0xAC,0xA0,0xA4,0xA8,0x8C,
- 0xB4,0x82,0x86,0x92,0xB2,0xA2,0x96,0xB6,
- 0xA6,0x94,0xB1,0xB0,0xA3,0xBF,0x9C,0xB9
-};
-
-void
-InitBraille()
-{
- bd.bd_start_braille=0;
- bd.bd_port = 0;
- bd.bd_braille_table = SaveStr("internal us-braille.tbl");
- bd.bd_type = 0;
- bd.bd_baud = 9600;
- bd.bd_bell = 1;
- bd.bd_eightdot = 1;
- bd.bd_info = 0;
- bd.bd_link = 1;
- bd.bd_ncells = 0;
- bd.bd_width = 0;
- bd.bd_ncrc = 1;
- bd.bd_scroll = 1;
- bd.bd_skip = 0;
- bd.bd_using_braille = 0;
- bd.bd_obuflen = 0;
- bd.bd_fd = -1;
- bcopy((char *)btable_local, bd.bd_btable, 256);
-}
-
-static int
-initialize_braille_display_type(s)
-char *s;
-{
- int i;
-
- for (i = 0; i < sizeof(bd_typelist)/sizeof(*bd_typelist); i++)
- if (!strcmp(s, bd_typelist[i].name))
- break;
- if (i == sizeof(bd_typelist)/sizeof(*bd_typelist))
- {
- Msg(0, "No entry for bd_type: %s ", s);
- return -1;
- }
- bd.bd_type = bd_typelist[i].name;
- if ((*bd_typelist[i].init)())
- return -1;
-
- if (!bd.bd_width)
- bd.bd_width = bd.bd_ncells;
-
- return 0;
-}
-
-void
-StartBraille()
-{
- bd.bd_dpy = displays;
-
- debug("StartBraille called\n");
- evdeq(&bd.bd_readev);
- evdeq(&bd.bd_writeev);
- evdeq(&bd.bd_selectev);
- bd.bd_using_braille = 0;
-
- if (!bd.bd_start_braille)
- return;
-
- if (bd.bd_type == 0 || bd.bd_port == 0)
- return;
-
- if (bd.bd_fd < 0 && open_braille_device())
- {
- Msg(0, "bd_port turned off");
- free(bd.bd_port);
- bd.bd_port = 0;
- return;
- }
-
- /* check if braille display is connected and turned on */
- if (bd.bd_response_test())
- {
- Msg(0, "Make sure that braille display is connected and turned on. ");
- Msg(0, "start_braille turned off");
- bd.bd_start_braille = 0;
- }
- else
- {
- bd.bd_using_braille = 1;
- bd.bd_readev.fd = bd.bd_writeev.fd = bd.bd_fd;
- bd.bd_readev.type = EV_READ;
- bd.bd_writeev.type = EV_WRITE;
- bd.bd_selectev.type = EV_ALWAYS;
- bd.bd_readev.data = bd.bd_writeev.data = bd.bd_selectev.data = (char *)&bd;
- bd.bd_readev.handler = bd_readev_fn;
- bd.bd_writeev.handler = bd_writeev_fn;
- bd.bd_selectev.handler = bd_selectev_fn;
- evenq(&bd.bd_readev);
- bd.bd_writeev.condpos = &bd.bd_obuflen;
- bd.bd_writeev.condneg = 0;
- evenq(&bd.bd_writeev);
- bd.bd_selectev.pri = -20;
- evenq(&bd.bd_selectev);
- }
-}
-
-
-static int
-load_braille_table(tablename)
-char *tablename;
-{
- int i, j, c, p;
- FILE *fp;
- char buffer[80], a[10];
-
- if ((fp = secfopen(tablename, "r")) == 0)
- {
- Msg(errno, "Braille table not found: %s ", tablename);
- return -1;
- }
- bzero(bd.bd_btable, 256);
- /* format:
- * Dec Hex Braille Description
- * 7 07 (12-45--8) BEL
- */
- while (fgets(buffer, sizeof(buffer), fp))
- {
- if (buffer[0] == '#')
- continue;
- sscanf(buffer,"%d %x %8s", &i, &j, a);
- if (i < 0 || i > 255)
- continue;
- for (j=1, p=1, c=0; j<9; j++, p*=2)
- if (a[j] == '0' + j)
- c += p;
- bd.bd_btable[i] = c;
- }
- fclose(fp);
- return 0;
-}
-
-
-static int
-open_braille_device(s)
-char *s;
-{
- char str[256];
-
- sprintf(str, "%d cs8 -istrip ixon ixoff", bd.bd_baud);
- bd.bd_fd = OpenTTY(bd.bd_port, str);
- if (bd.bd_fd == -1)
- {
- Msg(errno, "open comm port failed: %s ", bd.bd_port);
- return -1;
- }
- fcntl(bd.bd_fd, F_SETFL, FNBLOCK);
- return 0;
-}
-
-
-static void
-position_braille_cursor()
-{
- int sx = bd.bd_sx;
- int bx = BD_FORE->w_bd_x;
- int eol = BD_FORE->w_width;
- int w = bd.bd_width;
-
- if (bd.bd_scroll)
- bx = sx - w + bd.bd_ncrc; /* keep rc centered in window */
- else
- bx = w * (int)(sx / w); /* increase bc in integral steps */
-
- if (bx > eol - w)
- bx = eol - w;
- if (bx < 0)
- bx = 0;
- BD_FORE->w_bd_x = bx;
- BD_FORE->w_bd_y = bd.bd_sy;
-}
-
-
-void
-RefreshBraille()
-{
- int i, y, xs, xe;
- int cursor_pos;
-
- if (!bd.bd_using_braille)
- return;
- if (!BD_FORE)
- return;
- bcopy(bd.bd_line, bd.bd_oline, bd.bd_ncells);
- bd.bd_refreshing = 1;
- flayer = bd.bd_dpy->d_forecv->c_layer;
- bd.bd_sx = flayer->l_x;
- bd.bd_sy = flayer->l_y;
- display = bd.bd_dpy;
- if ((D_obufp != D_obuf) && bd.bd_link)
- {
- /* jump to real cursor */
- debug("calling position_braille_cursor\n");
- position_braille_cursor();
- }
- bclear(bd.bd_line, bd.bd_ncells);
-
- y = BD_FORE->w_bd_y;
- xs = BD_FORE->w_bd_x;
-
- if (bd.bd_info & 1)
- {
- sprintf(bd.bd_line, "%02d%02d", (BD_FORE->w_bd_x + 1) % 100, (BD_FORE->w_bd_y + 1) % 100);
- bd.bd_line[4] = ' ';
- }
- if (bd.bd_info & 2)
- {
- sprintf(bd.bd_line + bd.bd_ncells - 4, "%02d%02d",(bd.bd_sx +1) % 100, (bd.bd_sy +1) % 100);
- }
-
- xe = xs + bd.bd_width - 1;
-
- if (xs > flayer->l_width - 1)
- xs = flayer->l_width - 1;
- if (xe > flayer->l_width - 1)
- xe = flayer->l_width - 1;
-
- if (D_status)
- {
- sprintf(bd.bd_line, "**%-*.*s", bd.bd_ncells - 2, bd.bd_ncells - 2, D_status_lastmsg ? D_status_lastmsg : "unknown msg");
- xs = xe = -1;
- }
- else if (xs <= xe)
- {
- LayRedisplayLine(-1, xs, xe, 1);
- LayRedisplayLine(y, xs, xe, 1);
- }
-
- debug1("Braille: got >%s<\n", bd.bd_line);
-
- bd.bd_refreshing = 0;
-
- if (y == bd.bd_sy && xs <= bd.bd_sx && bd.bd_sx <= xe)
- cursor_pos = bd.bd_sx - xs + (bd.bd_info & 1 ? 4 : 0);
- else
- cursor_pos = bd.bd_ncells;
- for (i = 0; i < bd.bd_ncells; i++)
- if (bd.bd_line[i] != bd.bd_oline[i])
- break;
- if (bd.bd_cursorpos != cursor_pos || i < bd.bd_ncells)
- bd.write_line_braille(bd.bd_line, bd.bd_ncells, cursor_pos);
- bd.bd_cursorpos = cursor_pos;
-}
-
-
-/**********************************************************************
- *
- */
-
-/*
- * So, why is there a Flush() down below? The reason is simple: the
- * cursor warp (if bd_link is on) checks the obuf to see if something
- * happened. If there would be no Flush, screen would warp the
- * bd cursor if a bd movement command tries to ring the bell.
- * (In other words: this is a gross hack!)
- */
-static void
-bd_signal()
-{
- if (!bd.bd_bell)
- return;
- display = bd.bd_dpy;
- if (D_obufp != D_obuf)
- AddCStr(D_BL);
- else
- {
- AddCStr(D_BL);
- Flush(0);
- }
-}
-
-static int
-bd_do_search(y, xs, xe)
-int y, xs, xe;
-{
- int oy = BD_FORE->w_bd_y;
-
- if (!bd.bd_skip) /* no skip mode, found it */
- {
- if (xs > xe)
- return 0;
- bd.bd_searchmin = xs;
- bd.bd_searchmax = xe;
- return 1;
- }
- flayer = bd.bd_dpy->d_forecv->c_layer;
- bd.bd_searchmax = -1;
- bd.bd_searchmin = flayer->l_width;
- if (xs <= xe)
- {
- BD_FORE->w_bd_y = y; /* stupid hack */
- bd.bd_refreshing = bd.bd_searching = 1;
- bd.bd_searchstart = xs;
- bd.bd_searchend = xe;
- LayRedisplayLine(-1, xs, xe, 1);
- LayRedisplayLine(y, xs, xe, 1);
- bd.bd_refreshing = bd.bd_searching = 0;
- BD_FORE->w_bd_y = oy;
- }
- return bd.bd_searchmax >= 0;
-}
-
-static void
-bd_normalize(x, y)
-int x, y;
-{
- if (x > BD_FORE->w_width - bd.bd_width)
- x = BD_FORE->w_width - bd.bd_width;
- if (x < 0)
- x = 0;
- if (y < 0)
- {
- bd_signal();
- y = 0;
- }
- if (y >= BD_FORE->w_height)
- {
- bd_signal();
- y = BD_FORE->w_height - 1;
- }
- if (x != BD_FORE->w_bd_x || y != BD_FORE->w_bd_y)
- bd.bd_moved = 1;
- BD_FORE->w_bd_x = x;
- BD_FORE->w_bd_y = y;
-}
-
-static void
-bd_bc_left()
-{
- int bx = BD_FORE->w_bd_x, by = BD_FORE->w_bd_y;
- int ex;
-
- ex = bx - 1;
- bx = 0;
- for (; by >= 0; by--)
- {
- if (bd_do_search(by, 0, ex))
- {
- if (!bd.bd_skip && by != BD_FORE->w_bd_y)
- bd_signal();
- bx = bd.bd_searchmax + 1 - bd.bd_width;
- break;
- }
- ex = BD_FORE->w_width - 1;
- }
- bd_normalize(bx, by);
-}
-
-static void
-bd_bc_right()
-{
- int bx = BD_FORE->w_bd_x, by = BD_FORE->w_bd_y;
- int sx;
-
- sx = bx + bd.bd_width;
- bx = BD_FORE->w_width - bd.bd_width;
- for (; by < BD_FORE->w_height; by++)
- {
- if (bd_do_search(by, sx, BD_FORE->w_width - 1))
- {
- if (!bd.bd_skip && by != BD_FORE->w_bd_y)
- bd_signal();
- bx = bd.bd_searchmin;
- break;
- }
- sx = 0;
- }
- bd_normalize(bx, by);
-}
-
-static void
-bd_bc_up()
-{
- int bx = BD_FORE->w_bd_x, by = BD_FORE->w_bd_y;
-
- for (by--; by >= 0; by--)
- if (bd_do_search(by, bx, bx + bd.bd_width - 1))
- break;
- bd_normalize(bx, by);
-}
-
-static void
-bd_bc_down()
-{
- int bx = BD_FORE->w_bd_x, by = BD_FORE->w_bd_y;
-
- for (by++; by < BD_FORE->w_height; by++)
- if (bd_do_search(by, bx, bx + bd.bd_width - 1))
- break;
- bd_normalize(bx, by);
-}
-
-
-static void
-bd_upper_left()
-{
- bd_normalize(0, 0);
-}
-
-
-static void
-bd_upper_right()
-{
- bd_normalize(BD_FORE->w_width - bd.bd_width, 0);
-}
-
-
-static void
-bd_lower_left()
-{
- bd_normalize(0, BD_FORE->w_height - 1);
-}
-
-
-static void
-bd_lower_right()
-{
- bd_normalize(BD_FORE->w_width - bd.bd_width, BD_FORE->w_height -1);
-}
-
-/**********************************************************************
- *
- */
-
-
-static void
-bd_check(x, c)
-int x, c;
-{
- if (c == ' ')
- return;
- if (x < bd.bd_searchstart || x > bd.bd_searchend)
- return;
- if (x > bd.bd_searchmax)
- bd.bd_searchmax = x;
- if (x < bd.bd_searchmin)
- bd.bd_searchmin = x;
-}
-
-
-
-/*ARGSUSED*/
-void
-BGotoPos(la, x, y)
-struct layer *la;
-int x, y;
-{
-}
-
-/*ARGSUSED*/
-void
-BCDisplayLine(la, ml, y, xs, xe, isblank)
-struct layer *la;
-struct mline *ml;
-int y, xs, xe;
-int isblank;
-{
- int x;
- int sx, ex;
- char *l;
-
- if (y != BD_FORE->w_bd_y)
- return;
- if (bd.bd_searching)
- {
- for (x = xs; x <= xe; x++)
- bd_check(x, ml->image[x]);
- return;
- }
- l = bd.bd_line;
- sx = BD_FORE->w_bd_x;
- ex = sx + bd.bd_width - 1;
- if (bd.bd_info & 1)
- l += 4;
- for (x = xs; x <= xe; x++)
- if (x >= sx && x <= ex)
- l[x - sx] = ml->image[x];
-}
-
-/*ARGSUSED*/
-void
-BPutChar(la, c, x, y)
-struct layer *la;
-struct mchar *c;
-int x, y;
-{
- int sx, ex;
- char *l;
-
- if (y != BD_FORE->w_bd_y)
- return;
- if (bd.bd_searching)
- {
- bd_check(x, c->image);
- return;
- }
- l = bd.bd_line;
- sx = BD_FORE->w_bd_x;
- ex = sx + bd.bd_width - 1;
- if (bd.bd_info & 1)
- l += 4;
- if (x >= sx && x <= ex)
- l[x - sx] = c->image;
-}
-
-/*ARGSUSED*/
-void
-BPutStr(la, s, n, r, x, y)
-struct layer *la;
-char *s;
-int n;
-struct mchar *r;
-int x, y;
-{
- int sx, ex;
- char *l;
-
- if (y != BD_FORE->w_bd_y)
- return;
- if (bd.bd_searching)
- {
- for (; n > 0; n--, s++, x++)
- bd_check(x, *s);
- return;
- }
- l = bd.bd_line;
- sx = BD_FORE->w_bd_x;
- ex = sx + bd.bd_width - 1;
- if (bd.bd_info & 1)
- l += 4;
- for (; n > 0; n--, s++, x++)
- if (x >= sx && x <= ex)
- l[x - sx] = *s;
-}
-
-
-
-/**********************************************************************
- *
- */
-
-static char *infonames[] = {"none", "bc", "sc", "bc+sc"};
-
-void
-DoBrailleAction(act, msgok)
-struct action *act;
-int msgok;
-{
- int nr, dosig;
- int n, l, o;
- char *s, **args;
- struct stat st;
-
- nr = act->nr;
- args = act->args;
- dosig = display && !*rc_name;
-
- switch(nr)
- {
- case RC_BD_BELL:
- if (ParseSwitch(act, &bd.bd_bell) || !msgok)
- {
- bd_signal();
- break;
- }
- Msg(0, bd.bd_bell ? "bd_bell is on." : "bd_bell is off.");
- break;
-
- case RC_BD_EIGHTDOT:
- if (ParseSwitch(act, &bd.bd_eightdot) || !msgok)
- break;
- Msg(0, "switched to %d-dots system.", bd.bd_eightdot ? 8 : 6);
- break;
-
- case RC_BD_INFO:
- n = bd.bd_info;
- if (*args)
- {
- if (strlen(*args) == 4)
- n = args[0][n] - '0';
- else if (ParseNum(act, &n))
- break;
- }
- if (n < 0 && n > 3)
- {
- Msg(0, "Out of range; 0 <= bd_info >= 3 ");
- break;
- }
- /* bd_width at the beginning is unknown */
- if (bd.bd_width == 0)
- break;
-
- o = (bd.bd_info * 2 + 2) & 12;
- l = (n * 2 + 2) & 12;
- if (l >= bd.bd_ncells)
- {
- Msg(0, "bd_info is too large for braille display.");
- break;
- }
- if (l >= bd.bd_width + o)
- {
- Msg(0, "bd_info is too large for bd_width.");
- break;
- }
- bd.bd_width += o - l;
- bd.bd_info = n;
-
- if (msgok)
- Msg(0, "bd_info is %s.", infonames[n]);
- position_braille_cursor();
- break;
-
- case RC_BD_LINK:
- if (*args == 0 && bd.bd_moved)
- bd.bd_link = 0;
- if (ParseSwitch(act, &bd.bd_link))
- break;
- if (bd.bd_link)
- {
- bd.bd_moved = 0;
- if (dosig)
- bd_signal();
- position_braille_cursor();
- }
- if (msgok)
- Msg(0, bd.bd_link ? "bd_link is on." : "bd_link is off.");
- break;
-
- case RC_BD_SKIP:
- if (ParseSwitch(act, &bd.bd_skip))
- break;
- if (bd.bd_skip && dosig)
- bd_signal();
- if (msgok)
- Msg(0, bd.bd_skip ? "bd_skip is on." : "bd_skip is off.");
- break;
-
- case RC_BD_SCROLL:
- if (ParseSwitch(act, &bd.bd_scroll) || !msgok)
- {
- position_braille_cursor();
- break;
- }
- Msg(0, bd.bd_scroll ? "bd_scroll is on." : "bd_scroll is off.");
- break;
-
- case RC_BD_NCRC:
- n = bd.bd_ncrc;
- if (*args)
- {
- if (args[0][0] == '+')
- n = (n + atoi(*args + 1)) % bd.bd_width + 1;
- else if (args[0][0] == '-')
- n = (n - atoi(*args + 1)) % bd.bd_width + 1;
- else if (ParseNum(act, &n))
- break;
- }
- if (n < 1 || n > bd.bd_width)
- {
- Msg(0, "Out of range; 1 <= bd_ncrc >= %d", bd.bd_width);
- break;
- }
- bd.bd_ncrc = n;
- if (msgok)
- Msg(0, "bd_ncrc status is: %d ", bd.bd_ncrc);
- position_braille_cursor();
- break;
-
- case RC_BD_BRAILLE_TABLE:
- s = 0;
- if (*args)
- {
- if (ParseSaveStr(act, &s))
- break;
- if (load_braille_table(s))
- {
- free(s);
- break;
- }
- if (bd.bd_braille_table)
- free(bd.bd_braille_table);
- bd.bd_braille_table = s;
- }
- if (msgok)
- Msg(0, "bd_braille_table is: %s ", bd.bd_braille_table);
- break;
-
- case RC_BD_PORT:
- s = 0;
- if (*args)
- {
- if (ParseSaveStr(act, &s))
- break;
-
- if (stat(s, &st) || !S_ISCHR(st.st_mode) || access(s, R_OK|W_OK))
- {
- Msg(0, "Cannot access braille device port %s", s);
- free(s);
- break;
- }
- if (bd.bd_fd >= 0)
- close(bd.bd_fd);
- bd.bd_fd = -1;
- if (bd.bd_port)
- free(bd.bd_port);
- bd.bd_port = s;
- }
- if (msgok)
- Msg(0, "bd_port is: %s ", bd.bd_port ? bd.bd_port : "not set");
- StartBraille();
- break;
-
- case RC_BD_TYPE:
- s = 0;
- if (*args)
- if (ParseSaveStr(act, &s) || initialize_braille_display_type(s))
- break;
- if (msgok)
- Msg(0, "bd_type is: %s ", bd.bd_type ? bd.bd_type : "not set");
- StartBraille();
- break;
-
- case RC_BD_START_BRAILLE:
- if (ParseSwitch(act, &bd.bd_start_braille))
- break;
- if (msgok)
- Msg(0, bd.bd_start_braille ? "bd_start_braille is on." : "bd_start_braille is off.");
- StartBraille();
- break;
-
- case RC_BD_WIDTH:
- n = bd.bd_width;
- if (*args)
- {
- if (ParseNum(act, &n))
- break;
- }
- if (n <= 0)
- {
- Msg(0, "Invalid value for bd_width: %d ", n);
- break;
- }
- l = (bd.bd_info * 2 + 2) & 12;
- if (n > bd.bd_ncells - l || n < l)
- {
- Msg(0, "bd_info is too large for bd_width.");
- break;
- }
- bd.bd_width = n;
- if (msgok)
- Msg(0, "bd_width is: %d ", bd.bd_width);
- break;
-
- case RC_BD_BC_LEFT:
- bd_bc_left();
- break;
-
- case RC_BD_BC_RIGHT:
- bd_bc_right();
- break;
-
- case RC_BD_BC_UP:
- bd_bc_up();
- break;
-
- case RC_BD_BC_DOWN:
- bd_bc_down();
- break;
-
- case RC_BD_UPPER_LEFT:
- bd_upper_left();
- break;
-
- case RC_BD_UPPER_RIGHT:
- bd_upper_right();
- break;
-
- case RC_BD_LOWER_LEFT:
- bd_lower_left();
- break;
-
- case RC_BD_LOWER_RIGHT:
- bd_lower_right();
- break;
-
- default:
- break;
- }
-}
-
-static void
-bd_readev_fn(ev, data)
-struct event *ev;
-char *data;
-{
- bd.buttonpress();
-}
-
-static void
-bd_writeev_fn(ev, data)
-struct event *ev;
-char *data;
-{
- int len;
-
- if (bd.bd_obuflen == 0)
- return;
- if ((len = write(bd.bd_fd, bd.bd_obuf, bd.bd_obuflen)) < 0)
- len = bd.bd_obuflen; /* dead braille display */
- if ((bd.bd_obuflen -= len))
- bcopy(bd.bd_obuf + len, bd.bd_obuf, bd.bd_obuflen);
-}
-
-static void
-bd_selectev_fn(ev, data)
-struct event *ev;
-char *data;
-{
- RefreshBraille();
-}
-
-#endif /* HAVE_BRAILLE */
diff --git a/src/braille.h b/src/braille.h
deleted file mode 100644
index b4dbe96..0000000
--- a/src/braille.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Authors: Hadi Bargi Rangin bargi@dots.physics.orst.edu
- * Bill Barry barryb@dots.physics.orst.edu
- * Randy Lundquist randyl@dots.physics.orst.edu
- *
- * Modifications Copyright (c) 1995 by
- * Science Access Project, Oregon State University.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program (see the file COPYING); if not, see
- * http://www.gnu.org/licenses/, or contact Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
- *
- ****************************************************************
- * $Id$ GNU
- */
-
-#ifdef HAVE_BRAILLE
-
-extern void StartBraille (void);
-
-struct braille_display
-{
- struct display *bd_dpy; /* display we are connected to */
- int bd_start_braille; /* screenrc var to request to turn braille on */
- int bd_using_braille; /* all is fine, use braille */
- struct event bd_readev;
- struct event bd_writeev;
- struct event bd_selectev;
- int bd_fd; /* file descriptor */
- int bd_obuflen; /* current number of charactors in output buffer */
- char bd_obuf[IOSIZE];
- int bd_info; /* default, no info, 0,1,2,3 */
- int bd_ncrc; /* default 1, numbers of cells on the right side of real cursor, 1...bd_width */
- int bd_skip; /* default off, on/off */
- int bd_link; /* default, linked, on/off */
- int bd_width; /* length of braille display to use, <=bd_ncells */
- int bd_scroll; /* default on, scroll on/off */
- char *bd_braille_table; /* braille code */
-
- int bd_bell; /* bell used for navigation on/off */
- int bd_ncells; /* real number of cells on braille display */
- int bd_eightdot; /* eightdot on/off */
- int bd_baud; /* communication baudrate between port and braille display */
- char *bd_port; /* serial port to use */
- char *bd_type; /* kind of braille display */
- double bd_version; /* rom version of braille display */
- char bd_btable[256]; /* braille translation table */
-
- /* functions which communicate with braille displays */
- int (*write_line_braille) (char [],int, int);
- void (*buttonpress) (void);
- int (*bd_response_test) (void);
-
- int bd_refreshing; /* are we doing a refresh? */
- char bd_line[40+1]; /* bd_ncells chars displayed on braille */
- int bd_cursorpos; /* cursor position on braille */
- char bd_oline[40+1]; /* bd_ncells chars displayed on braille */
- int bd_sx, bd_sy; /* screen cursor pos */
- int bd_moved; /* used braille move keys */
-
- int bd_searching; /* are we seaching (bd_skip is on) */
- int bd_searchmax; /* search: max x */
- int bd_searchmin; /* search: min x */
- int bd_searchstart;
- int bd_searchend;
-};
-
-extern struct braille_display bd;
-
-#define BD_FORE bd.bd_dpy->d_fore
-
-#endif
diff --git a/src/braille_tsi.c b/src/braille_tsi.c
deleted file mode 100644
index c70f27c..0000000
--- a/src/braille_tsi.c
+++ /dev/null
@@ -1,319 +0,0 @@
-/* bd-tsi.c, TSI specific key bindings and display commands
- *
- * dotscreen
- * A braille interface to unix tty terminals
- * Authors: Hadi Bargi Rangin bargi@dots.physics.orst.edu
- * Bill Barry barryb@dots.physics.orst.edu
- *
- * Copyright (c) 1995 by Science Access Project, Oregon State University.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program (see the file COPYING); if not, see
- * http://www.gnu.org/licenses/, or contact Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
- *
- ****************************************************************
- */
-
-#include "config.h"
-#include "screen.h"
-#include "extern.h"
-#include "braille.h"
-
-#ifdef HAVE_BRAILLE
-
-extern struct display *display;
-
-struct key2rc {
- int key;
- int nr;
- char *arg1;
- char *arg2;
-};
-
-
-static int tsi_ctype = 1; /* cursor type, 0,1,2 */
-
-static int tsi_line_type; /* indicates number of cells on powerbraille
- display 01=20 cells 02=40 cells 03=80 cells */
-
-static int display_status_tsi (void);
-static int write_line_tsi (char *, int, int);
-static void buttonpress_tsi (struct key2rc *);
-static void buttonpress_navigator_40 (void);
-static void buttonpress_powerbraille_40 (void);
-static void buttonpress_powerbraille_80 (void);
-
-int
-bd_init_powerbraille_40()
-{
- bd.write_line_braille = write_line_tsi;
- bd.buttonpress = buttonpress_powerbraille_40;
- bd.bd_response_test = display_status_tsi;
- bd.bd_ncells = 40;
- tsi_line_type = 2;
- return 0;
-}
-
-int
-bd_init_powerbraille_80()
-{
- bd.write_line_braille = write_line_tsi;
- bd.buttonpress = buttonpress_powerbraille_80;
- bd.bd_response_test = display_status_tsi;
- bd.bd_ncells = 80;
- tsi_line_type = 3;
- return 0;
-}
-
-int
-bd_init_navigator_40()
-{
- bd.write_line_braille = write_line_tsi;
- bd.buttonpress = buttonpress_navigator_40;
- bd.bd_response_test = display_status_tsi;
- bd.bd_ncells = 40;
- tsi_line_type = 2;
- return 0;
-}
-
-static int
-display_status_tsi()
-{
- char obuf[3],ibuf[20];
- int r;
-
- obuf[0] = 0xff;
- obuf[1] = 0xff;
- obuf[2] = 0x0a;
- r = read(bd.bd_fd, ibuf, 20); /* flush the input port */
- r = write(bd.bd_fd, obuf, 3);
- if (r != 3)
- return -1;
-
- /* we have written to the display asking for a response
- we wait 1 second for the response, read it and if no
- response we wait 2 seconds, if still no response,
- return -1 to indicate no braille display available */
- sleep(1);
- r = read(bd.bd_fd, ibuf, 2);
- if (r == -1)
- {
- sleep(2);
- r = read(bd.bd_fd, ibuf, 2);
- }
- debug2("first chars from braille display %d %d\n",ibuf[0],ibuf[1]);
- if (r != 2 || ibuf[0] != 0 || ibuf[1] != 5)
- return -1;
-
- r= read(bd.bd_fd,ibuf,2);
- if (r != 2)
- return -1;
- debug2("braille display size:%d dots:%d\n", ibuf[0], ibuf[1]);
- bd.bd_ncells = (unsigned char)ibuf[0];
- if (bd.bd_ncells <= 1)
- return -1;
- r = read(bd.bd_fd,ibuf,1);
- if (r != 1)
- return -1;
- if (ibuf[0] == 'V')
- r = read(bd.bd_fd, ibuf, 3);
- else
- r = read(bd.bd_fd, ibuf + 1, 2) + 1;
- if (r != 3)
- return -1;
- ibuf[3] = 0;
- debug1("braille display version %s\n", ibuf);
- bd.bd_version = atof(ibuf);
- return 0;
-}
-
-
-static int
-write_line_tsi (bstr,line_length, cursor_pos)
-char *bstr;
-int line_length, cursor_pos;
-{
- int obp, i;
- bd.bd_obuf[0] = 0xff;
- bd.bd_obuf[1] = 0xff;
- bd.bd_obuf[2] = tsi_line_type;
- bd.bd_obuf[3] = 0x07;
- bd.bd_obuf[4] = cursor_pos;
- bd.bd_obuf[5] = tsi_ctype;
- obp=6;
-
- for (i=0; i < line_length; i++)
- {
- bd.bd_obuf[2*i+obp] = 0;
- bd.bd_obuf[2*i+1+obp] = bd.bd_btable[(int)(unsigned char)bstr[i]];
- }
- for (i=line_length; i < bd.bd_ncells; i++)
- {
- bd.bd_obuf[2*i+obp] = 0;
- bd.bd_obuf[2*i+1+obp] = bd.bd_btable[(int)' '];
- }
-
- bd.bd_obuflen = 2*bd.bd_ncells + obp ;
- return 0;
-}
-
-static struct key2rc keys_navigator_40[] = {
- {0x4000000, RC_STUFF, "-k", "kl"}, /* 1 */
- {0x10000000, RC_STUFF, "-k", "kr"}, /* 3 */
- {0x8000000, RC_STUFF, "-k", "ku"}, /* 2 */
- {0x20000000, RC_STUFF, "-k", "kd"}, /* 4 */
- {0x2000, RC_BD_BC_LEFT, 0, 0}, /* 6 */
- {0x8000, RC_BD_BC_RIGHT, 0, 0}, /* 8 */
- {0x4000, RC_BD_BC_UP, 0, 0}, /* 7 */
- {0x10000, RC_BD_BC_DOWN, 0, 0}, /* 9 */
- {0x6000, RC_BD_UPPER_LEFT, 0, 0}, /* 6, 7 */
- {0xc000, RC_BD_UPPER_RIGHT, 0, 0}, /* 7, 8 */
- {0x12000, RC_BD_LOWER_LEFT, 0, 0}, /* 6, 9 */
- {0x18000, RC_BD_LOWER_RIGHT, 0, 0}, /* 8, 9 */
- {0xa000, RC_BD_INFO, "1032", 0}, /* bc 6, 8 */
- {0x14000000, RC_BD_INFO, "2301", 0}, /* sc 1, 3 */
- {0x4008000, RC_BD_INFO, "3330", 0}, /* bc+sc 1, 8 */
- {0x8010000, RC_BD_BELL, 0, 0}, /* 2, 9 */
- {0x8004000, RC_BD_EIGHTDOT, 0, 0}, /* 2, 7 */
- {0x40000000, RC_STUFF, "\015", 0}, /* 5 */
- {0x20000, RC_BD_LINK, 0, 0}, /* 10 */
- {0x10002000, RC_BD_SCROLL, 0, 0}, /* 3, 6 */
- {0x20010000, RC_BD_NCRC, "+", 0}, /* 4, 9 */
- {0x14000, RC_BD_SKIP, 0, 0}, /* 7, 9*/
- {-1, RC_ILLEGAL, 0, 0}
-};
-
-static struct key2rc keys_powerbraille_40[] = {
- {0x4000000, RC_STUFF, "-k", "kl"}, /* 1 */
- {0x10000000, RC_STUFF, "-k", "kr"}, /* 3 */
- {0x8000000, RC_STUFF, "-k", "ku"}, /* 2 */
- {0x20000000, RC_STUFF, "-k", "kd"}, /* 4 */
- {0x2000, RC_BD_BC_LEFT, 0, 0}, /* 6 */
- {0x8000, RC_BD_BC_RIGHT, 0, 0}, /* 8 */
- {0x4000, RC_BD_BC_UP, 0, 0}, /* 7 */
- {0x10000, RC_BD_BC_DOWN, 0, 0}, /* 9 */
- {0x8002000, RC_BD_UPPER_LEFT, 0, 0}, /* 2, 6 */
- {0xc000, RC_BD_UPPER_RIGHT, 0, 0}, /* 7, 8 */
- {0x20002000, RC_BD_LOWER_LEFT, 0, 0}, /* 3, 6 */
- {0x18000, RC_BD_LOWER_RIGHT, 0, 0}, /* 8, 9 */
- {0x8008000, RC_BD_INFO, "1032", 0}, /* bc 2, 8 */
- {0x6000, RC_BD_INFO, "2301", 0}, /* 6, 7 */
- {0x8004000, RC_BD_INFO, "3330", 0}, /* bc+sc 2, 7 */
- {0x8010000, RC_BD_BELL, 0, 0}, /* 2, 9 */
- {0x20008000, RC_BD_EIGHTDOT, 0, 0}, /* 4, 6 */
- {0x40000000, RC_STUFF, "\015", 0}, /* 5 */
- {0x20000, RC_BD_LINK, 0, 0}, /* 10 */
- {0xa000, RC_BD_SCROLL, 0, 0}, /* 6, 8 */
- {0x20010000, RC_BD_NCRC, "+", 0}, /* 4, 9 */
- {0x20004000, RC_BD_SKIP, 0, 0}, /* 4, 7 */
- {-1, RC_ILLEGAL, 0, 0}
-};
-
-
-static struct key2rc keys_powerbraille_80[] = {
- {0x4000000, RC_STUFF, "-k", "kl"}, /* 1 */
- {0x10000000, RC_STUFF, "-k", "kr"}, /* 3 */
- {0x8000000, RC_STUFF, "-k", "ku"}, /* 2 */
- {0x20000000, RC_STUFF, "-k", "kd"}, /* 4 */
- {0x40000, RC_BD_BC_LEFT, 0, 0}, /* 6 */
- {0x100000, RC_BD_BC_RIGHT, 0, 0}, /* 8 */
- {0x4000, RC_BD_BC_UP, 0, 0}, /* 7 */
- {0x10000, RC_BD_BC_DOWN, 0, 0}, /* 9 */
- {0x44000, RC_BD_UPPER_LEFT, 0, 0}, /* 6, 7 */
- {0x104000, RC_BD_UPPER_RIGHT, 0, 0}, /* 7, 8 */
- {0x50000, RC_BD_LOWER_LEFT, 0, 0}, /* 6, 9 */
- {0x110000, RC_BD_LOWER_RIGHT, 0, 0}, /* 8, 9 */
- {0x8100000, RC_BD_INFO, "1032", 0}, /* 2, 8 */
- {0x8040000, RC_BD_INFO, "2301", 0}, /* 2, 6 */
- {0x140000, RC_BD_INFO, "3330", 0}, /* 6, 8 */
- {0x8010000, RC_BD_BELL, 0, 0}, /* 2, 9 */
- {0x8004000, RC_BD_EIGHTDOT, 0, 0}, /* 2, 7 */
- {0x40000000, RC_STUFF, "\015", 0}, /* 5 */
- {0x20000, RC_BD_LINK, 0, 0}, /* 10 */
- {0x20004000, RC_BD_SCROLL, 0, 0}, /* 4, 7 */
- {0x20010000, RC_BD_NCRC, "+", 0}, /* 4, 9 */
- {0x40010000, RC_BD_SKIP, 0, 0}, /* 5, 9 */
- {-1, RC_ILLEGAL, 0, 0}
-};
-
-static void
-buttonpress_tsi(tab)
-struct key2rc *tab;
-{
- int i, nb;
- int bkeys;
- unsigned char buf[10];
- nb = read(bd.bd_fd, buf, 10);
- debug1("buttonpress_tsi: read %d bytes\n", nb);
- for (i=0, bkeys=0; i < nb; i++)
- {
- switch (buf[i] & 0xE0)
- {
- case 0x00: bkeys += ((int)(buf[i] & 0x1f) ); break;
- case 0x20: bkeys += ((int)(buf[i] & 0x1f) << 5 ); break;
- case 0x40: bkeys += ((int)(buf[i] & 0x1f) << 9 ); break;
- case 0x60: bkeys += ((int)(buf[i] & 0x1f) << 13 ); break;
- case 0xA0: bkeys += ((int)(buf[i] & 0x1f) << 18 ); break;
- case 0xC0: bkeys += ((int)(buf[i] & 0x1f) << 22 ); break;
- case 0xE0: bkeys += ((int)(buf[i] & 0x1f) << 26 ); break;
- default: break;
- }
- }
- debug1("bkeys %x\n", bkeys);
- for (i = 0; tab[i].key != -1; i++)
- if (bkeys == tab[i].key)
- break;
- debug1("bkey index %d\n", i);
- if (tab[i].key != -1 && tab[i].nr != RC_ILLEGAL)
- {
- char *args[3];
- int argl[2];
-
- struct action act;
- args[0] = tab[i].arg1;
- args[1] = tab[i].arg2;
- args[2] = 0;
- argl[0] = args[0] ? strlen(args[0]) : 0;
- argl[1] = args[1] ? strlen(args[1]) : 0;
- act.nr = tab[i].nr;
- act.args = args;
- act.argl = argl;
- display = bd.bd_dpy;
- DoAction(&act, -2);
- }
-}
-
-
-static void
-buttonpress_navigator_40()
-{
- buttonpress_tsi(keys_navigator_40);
-}
-
-static void
-buttonpress_powerbraille_40()
-{
- buttonpress_tsi(keys_powerbraille_40);
-}
-
-static void
-buttonpress_powerbraille_80()
-{
- buttonpress_tsi(keys_powerbraille_80);
-}
-
-#endif /* HAVE_BRAILLE */
-
-
diff --git a/src/comm.c b/src/comm.c
index 696f982..d2493fe 100644
--- a/src/comm.c
+++ b/src/comm.c
@@ -8,14 +8,6 @@
* Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
* Copyright (c) 1987 Oliver Laumann
*
-#ifdef HAVE_BRAILLE
- * Modified by:
- * Authors: Hadi Bargi Rangin bargi@dots.physics.orst.edu
- * Bill Barry barryb@dots.physics.orst.edu
- *
- * Modifications Copyright (c) 1995 by
- * Science Access Project, Oregon State University.
-#endif
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -71,31 +63,6 @@ struct comm comms[RC_LAST + 1] =
#ifdef COLOR
{ "bce", NEED_FORE|ARGS_01 },
#endif
-
-#ifdef HAVE_BRAILLE
-/* keywords for braille display (bd) */
- { "bd_bc_down", ARGS_0 },
- { "bd_bc_left", ARGS_0 },
- { "bd_bc_right", ARGS_0 },
- { "bd_bc_up", ARGS_0 },
- { "bd_bell", ARGS_01 },
- { "bd_braille_table", ARGS_01 },
- { "bd_eightdot", ARGS_01 },
- { "bd_info", ARGS_01 },
- { "bd_link", ARGS_01 },
- { "bd_lower_left", ARGS_0 },
- { "bd_lower_right", ARGS_0 },
- { "bd_ncrc", ARGS_01 },
- { "bd_port", ARGS_01 },
- { "bd_scroll", ARGS_01 },
- { "bd_skip", ARGS_01 },
- { "bd_start_braille", ARGS_01 },
- { "bd_type", ARGS_01 },
- { "bd_upper_left", ARGS_0 },
- { "bd_upper_right", ARGS_0 },
- { "bd_width", ARGS_01 },
-#endif
-
{ "bell", ARGS_01 },
{ "bell_msg", ARGS_01 },
{ "bind", ARGS_1|ARGS_ORMORE },
diff --git a/src/display.c b/src/display.c
index f68ce93..fdc55b0 100644
--- a/src/display.c
+++ b/src/display.c
@@ -36,7 +36,6 @@
#include "config.h"
#include "screen.h"
#include "extern.h"
-#include "braille.h"
#include "canvas.h"
static int CountChars (int);
@@ -359,13 +358,6 @@ FreeDisplay()
#ifdef BLANKER_PRG
evdeq(&D_blankerev);
#endif
-#ifdef HAVE_BRAILLE
- if (bd.bd_dpy == display)
- {
- bd.bd_start_braille = 0;
- StartBraille();
- }
-#endif
#ifdef MULTI
for (dp = &displays; (d = *dp) ; dp = &d->d_next)
@@ -3208,9 +3200,6 @@ disp_writeev_fn(struct event *ev, char *data)
gettimeofday(&D_status_time, NULL);
SetTimeout(&D_statusev, MsgWait);
evenq(&D_statusev);
-#ifdef HAVE_BRAILLE
- RefreshBraille(); /* let user see multiple Msg()s */
-#endif
}
}
if (D_blocked_fuzz)
diff --git a/src/extern.h b/src/extern.h
index bd45d3a..d5e16c7 100644
--- a/src/extern.h
+++ b/src/extern.h
@@ -396,20 +396,6 @@ extern int UserAdd (char *, char *, struct acluser **);
extern int UserDel (char *, struct acluser **);
-/* braile.c */
-#ifdef HAVE_BRAILLE
-extern void InitBraille (void);
-extern void RefreshBraille (void);
-extern void DoBrailleAction (struct action *, int);
-extern void BGotoPos (struct layer *, int, int);
-extern void BPutChar (struct layer *, struct mchar *, int, int);
-extern void BPutStr (struct layer *, char *, int, struct mchar *, int, int);
-extern void BCDisplayLine (struct layer *, struct mline *, int, int, int, int);
-#endif
-
-
-
-
/* layer.c */
extern void LGotoPos (struct layer *, int, int);
extern void LPutChar (struct layer *, struct mchar *, int, int);
diff --git a/src/layer.c b/src/layer.c
index 2d79659..f1fc744 100644
--- a/src/layer.c
+++ b/src/layer.c
@@ -32,7 +32,6 @@
#include "screen.h"
#include "mark.h"
#include "extern.h"
-#include "braille.h"
extern struct display *display, *displays;
@@ -102,10 +101,6 @@ LGotoPos(struct layer *l, int x, int y)
if (l->l_pause.d)
LayPauseUpdateRegion(l, x, x, y, y);
-#ifdef HAVE_BRAILLE
- if (bd.bd_refreshing)
- return;
-#endif
FOR_EACH_UNPAUSED_CANVAS(l,
{
display = cv->c_display;
@@ -304,13 +299,6 @@ LPutChar(struct layer *l, struct mchar *c, int x, int y)
struct canvas *cv;
struct viewport *vp;
int x2, y2;
-#ifdef HAVE_BRAILLE
- if (bd.bd_refreshing)
- {
- BPutChar(l, c, x, y);
- return;
- }
-#endif
if (l->l_pause.d)
LayPauseUpdateRegion(l, x,
@@ -351,13 +339,6 @@ LPutStr(struct layer *l, char *s, int n, struct mchar *r, int x, int y)
if (x + n > l->l_width)
n = l->l_width - x;
-#ifdef HAVE_BRAILLE
- if (bd.bd_refreshing)
- {
- BPutStr(l, s, n, r, x, y);
- return;
- }
-#endif
if (l->l_pause.d)
LayPauseUpdateRegion(l, x, x + n - 1, y, y);
@@ -410,13 +391,6 @@ LPutWinMsg(struct layer *l, char *s, int n, struct mchar *r, int x, int y)
if (x + n > l->l_width)
n = l->l_width - x;
-#ifdef HAVE_BRAILLE
- if (bd.bd_refreshing)
- {
- BPutStr(l, s, n, r, x, y);
- return;
- }
-#endif
if (l->l_pause.d)
LayPauseUpdateRegion(l, x, x + n - 1, y, y);
len = strlen(s);
@@ -499,10 +473,6 @@ LClearArea(struct layer *l, int xs, int ys, int xe, int ye, int bce, int uself)
struct canvas *cv;
struct viewport *vp;
int xs2, ys2, xe2, ye2;
-#ifdef HAVE_BRAILLE
- if (bd.bd_refreshing)
- return;
-#endif
/* Check for zero-height window */
if (ys < 0 || ye < ys)
return;
@@ -566,13 +536,6 @@ LCDisplayLine(struct layer *l, struct mline *ml, int y, int xs, int xe, int isbl
struct canvas *cv;
struct viewport *vp;
int xs2, xe2, y2;
-#ifdef HAVE_BRAILLE
- if (bd.bd_refreshing)
- {
- BCDisplayLine(l, ml, y, xs, xe, isblank);
- return;
- }
-#endif
if (l->l_pause.d)
LayPauseUpdateRegion(l, xs, xe, y, y);
FOR_EACH_UNPAUSED_CANVAS(l,
diff --git a/src/process.c b/src/process.c
index 32e8637..41a41f1 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5667,10 +5667,6 @@ DoAction(struct action *act, int key)
break;
#endif
default:
-#ifdef HAVE_BRAILLE
- /* key == -2: input from braille keybord, msgok always 0 */
- DoBrailleAction(act, key == -2 ? 0 : msgok);
-#endif
break;
}
if (display != odisplay)
diff --git a/src/screen.c b/src/screen.c
index 55664c3..48aa4c0 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -10,16 +10,6 @@
* Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
* Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
* Copyright (c) 1987 Oliver Laumann
-#ifdef HAVE_BRAILLE
- * Modified by:
- * Authors: Hadi Bargi Rangin bargi@dots.physics.orst.edu
- * Bill Barry barryb@dots.physics.orst.edu
- * Randy Lundquist randyl@dots.physics.orst.edu
- *
- * Modifications Copyright (c) 1995 by
- * Science Access Project, Oregon State University.
-#endif
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
@@ -87,9 +77,6 @@
#endif
#include "screen.h"
-#ifdef HAVE_BRAILLE
-# include "braille.h"
-#endif
#include "patchlevel.h"
@@ -479,9 +466,6 @@ main(int argc, char **argv)
MsgWait = MSGWAIT * 1000;
MsgMinWait = MSGMINWAIT * 1000;
SilenceWait = SILENCEWAIT;
-#ifdef HAVE_BRAILLE
- InitBraille();
-#endif
#ifdef ZMODEM
zmodem_sendcmd = SaveStr("!!! sz -vv -b ");
zmodem_recvcmd = SaveStr("!!! rz -vv -b -E");
@@ -551,11 +535,6 @@ main(int argc, char **argv)
}
ap = NULL;
break;
-#ifdef HAVE_BRAILLE
- case 'B':
- bd.bd_start_braille = 1;
- break;
-#endif
case 'c':
if (*++ap)
RcFileName = ap;
@@ -1439,10 +1418,6 @@ main(int argc, char **argv)
MakeWindow(&nwin);
}
-#ifdef HAVE_BRAILLE
- StartBraille();
-#endif
-
if (display && default_startup)
display_copyright();
signal(SIGINT, SigInt);
diff --git a/src/window.h b/src/window.h
index 2036774..3aa872f 100644
--- a/src/window.h
+++ b/src/window.h
@@ -232,9 +232,6 @@ struct win
char w_xtermosc[4][MAXSTR]; /* special xterm/rxvt escapes */
#endif
int w_mouse; /* mouse mode 0,9,1000 */
-#ifdef HAVE_BRAILLE
- int w_bd_x, w_bd_y; /* Braille cursor position */
-#endif
#ifdef COPY_PASTE
int w_slowpaste; /* do careful writes to the window */