annotate lib-src/emacstool.c @ 13677:ad4eada50462

(tputs): Don't let ospeed overrun the speeds array.
author David J. MacKenzie <djm@gnu.org>
date Thu, 30 Nov 1995 20:05:01 +0000
parents ecaa966abd06
children 621a575db6f7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
1 /*
6111
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
2 Copyright (C) 1986, 1988, 1990, 1991 Free Software Foundation, Inc.
6112
ecaa966abd06 *** empty log message ***
David J. MacKenzie <djm@gnu.org>
parents: 6111
diff changeset
3
6111
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
4 This program is free software; you can redistribute it and/or modify
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
5 it under the terms of the GNU General Public License as published by
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
6 the Free Software Foundation; either version 2, or (at your option)
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
7 any later version.
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
8
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
9 This program is distributed in the hope that it will be useful,
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
12 GNU General Public License for more details.
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
13
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
14 You should have received a copy of the GNU General Public License
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
15 along with this program; if not, write to the Free Software
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
17
617c0b6a50c0 Use GPL.
David J. MacKenzie <djm@gnu.org>
parents: 3591
diff changeset
18 /*
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
19 * For Emacs in SunView/Sun-Windows: (supported by Sun Unix v3.2 or greater)
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
20 * Insert a notifier filter-function to convert all useful input
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
21 * to "key" sequences that emacs can understand. See: Emacstool(1).
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
22 *
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
23 * Author: Jeff Peck, Sun Microsystems, Inc. <peck@eng.sun.com>
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
24 *
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
25 * Original Idea: Ian Batten
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
26 * Updated 15-Mar-88, Jeff Peck: set IN_EMACSTOOL, TERM, TERMCAP
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
27 * Updated 10-Sep-88, Jeff Peck: add XVIEW and JLE support
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
28 * Updated 8-Oct-90, Jeff Peck: add Meta-bit for Xview
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
29 * Updated 6-Mar-91, Jeff Peck: Hack to detect -Wt invocation
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
30 * [note, TTYSW limitation means you must Click-To-Type in Openwin]
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
31 * [fixed in OW3 or use local/tty.o]
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
32 * for better results, this should move to using TERMSW.
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
33 * Updated 10-Mar-91, Jeff Peck, et al: support for TERMSW (TTERM)
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
34 * allows point-to-type even in OW2
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
35 *
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
36 * [note: xvetool should be started with the "-nw" flag for emacs!]
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
37 */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
38
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
39 #ifdef XVIEW
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
40 #include <xview/xview.h>
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
41 #include <xview/panel.h>
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
42 #include <xview/attr.h>
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
43 #include <xview/tty.h>
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
44 #include <xview/ttysw.h> /* private defines */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
45 #include <xview/termsw.h> /* -DTTERM */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
46 #include <xview/font.h> /* for testing */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
47 #else
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
48 #include <suntool/sunview.h>
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
49 #include <suntool/tty.h>
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
50 #include <suntool/ttysw.h>
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
51 #endif XVIEW
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
52
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
53 #ifdef JLE
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
54 # include <locale.h>
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
55 #endif JLE
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
56
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
57 #include <stdio.h>
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
58 #include <sys/file.h>
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
59
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
60 #define BUFFER_SIZE 128 /* Size of all the buffers */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
61
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
62 /* define WANT_CAPS_LOCK to make f-key T1 (aka F1) behave as CapsLock */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
63 #define WANT_CAPS_LOCK
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
64 #ifdef WANT_CAPS_LOCK
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 287
diff changeset
65 int caps_lock; /* toggle indicator for f-key T1 caps lock */
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
66 static char *Caps = "[CAPS] "; /* Caps Lock prefix string */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
67 #define CAPS_LEN 7 /* strlen (Caps) */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
68 #endif
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
69
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
70 static char *mouse_prefix = "\030\000"; /* C-x C-@ */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
71 static int m_prefix_length = 2; /* mouse_prefix length */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
72
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
73 static char *key_prefix = "\030*"; /* C-x * */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
74 static int k_prefix_length = 2; /* key_prefix length */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
75
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
76 #ifdef JLE
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
77 static char *emacs_name = "nemacs"; /* default run command */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
78 static char *title = "NEmacstool - "; /* initial title */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
79 #else
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
80 static char *emacs_name = "emacs"; /* default run command */
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
81 static char *title = "Emacstool - "; /* initial title */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
82 #endif JLE
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
83
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
84 static char buffer[BUFFER_SIZE]; /* send to ttysw_input */
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
85 static char *bold_name = 0; /* for -bold option */
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
86
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
87 Frame frame; /* Base frame for system */
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
88
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
89 #ifndef TTERM
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
90 #define SWTYPE TTY
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
91 Tty tty_win; /* Where emacs is reading */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
92 #else
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
93 #define SWTYPE TERMSW
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
94 Termsw tty_win; /* Termsw does follow-mouse */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
95 #endif TTERM
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
96
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
97 #ifdef XVIEW
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
98 Xv_Window tty_view; /* Where the events are in Xview*/
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
99 #else
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
100 Tty tty_view; /* SunView place filler */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
101 #endif XVIEW
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
102
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
103 int font_width, font_height; /* For translating pixels to chars */
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
104 int left_margin = 0; /* default window -- frame offset */
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
105
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
106 int console_fd = 0; /* for debugging: setenv DEBUGEMACSTOOL */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
107 FILE *console; /* for debugging: setenv DEBUGEMACSTOOL */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
108
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
109 Icon frame_icon;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
110 /* make an icon_image for the default frame_icon */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
111 static short default_image[258] =
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
112 {
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
113 #include <images/terminal.icon>
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
114 };
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
115 mpr_static(icon_image, 64, 64, 1, default_image);
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
116
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
117 /*
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
118 * Assign a value to a set of keys
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
119 */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
120 int
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
121 button_value (event)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
122 Event *event;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
123 {
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
124 int retval = 0;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
125 /*
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
126 * Code up the current situation:
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
127 *
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
128 * 1 = MS_LEFT;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
129 * 2 = MS_MIDDLE;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
130 * 4 = MS_RIGHT;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
131 * 8 = SHIFT;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
132 * 16 = CONTROL;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
133 * 32 = META;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
134 * 64 = DOUBLE;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
135 * 128 = UP;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
136 */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
137
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
138 if (MS_LEFT == (event_id (event))) retval = 1;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
139 if (MS_MIDDLE == (event_id (event))) retval = 2;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
140 if (MS_RIGHT == (event_id (event))) retval = 4;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
141
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
142 if (event_shift_is_down (event)) retval += 8;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
143 if (event_ctrl_is_down (event)) retval += 16;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
144 if (event_meta_is_down (event)) retval += 32;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
145 if (event_is_up (event)) retval += 128;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
146 return retval;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
147 }
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
148
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
149 /*
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
150 * Variables to store the time of the previous mouse event that was
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
151 * sent to emacs.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
152 *
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
153 * The theory is that to time double clicks while ignoreing UP buttons,
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
154 * we must keep track of the accumulated time.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
155 *
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
156 * If someone writes a SUN-SET-INPUT-MASK for emacstool,
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
157 * That could be used to selectively disable UP events,
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
158 * and then this cruft wouldn't be necessary.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
159 */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
160 static long prev_event_sec = 0;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
161 static long prev_event_usec = 0;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
162
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
163 /*
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
164 * Give the time difference in milliseconds, where one second
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
165 * is considered infinite.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
166 */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
167 int
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
168 time_delta (now_sec, now_usec, prev_sec, prev_usec)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
169 long now_sec, now_usec, prev_sec, prev_usec;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
170 {
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
171 long sec_delta = now_sec - prev_sec;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
172 long usec_delta = now_usec - prev_usec;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
173
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
174 if (usec_delta < 0) { /* "borrow" a second */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
175 usec_delta += 1000000;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
176 --sec_delta;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
177 }
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
178
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
179 if (sec_delta >= 10)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
180 return (9999); /* Infinity */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
181 else
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
182 return ((sec_delta * 1000) + (usec_delta / 1000));
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
183 }
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
184
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
185
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
186 /*
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
187 * Filter function to translate selected input events for emacs
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
188 * Mouse button events become ^X^@(button x-col y-line time-delta) .
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
189 * Function keys: ESC-*{c}{lrt} l,r,t for Left, Right, Top;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
190 * {c} encodes the keynumber as a character [a-o]
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
191 */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
192 static Notify_value
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
193 input_event_filter_function (window, event, arg, type)
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
194 #ifdef XVIEW
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
195 Xv_Window window;
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
196 #else
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
197 Window window;
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
198 #endif XVIEW
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
199 Event *event;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
200 Notify_arg arg;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
201 Notify_event_type type;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
202 {
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
203 struct timeval time_stamp;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
204
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
205 if (console_fd) fprintf(console, "Event: %d\n", event_id(event));
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
206
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
207 /* UP L1 is the STOP key */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
208 if (event_id(event) == WIN_STOP) {
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
209 ttysw_input(tty_win, "\007\007\007\007\007\007\007", 7);
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
210 return NOTIFY_IGNORED;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
211 }
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
212
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
213 /* UP L5 & L7 is Expose & Open, let them pass to sunview */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
214 if (event_id(event) == KEY_LEFT(5) || event_id(event) == KEY_LEFT(7))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
215 if(event_is_up (event))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
216 return notify_next_event_func (window, event, arg, type);
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
217 else return NOTIFY_IGNORED;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
218
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
219 if (event_is_button (event)) { /* do Mouse Button events */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
220 /* Commented out so that we send mouse up events too.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
221 if (event_is_up (event))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
222 return notify_next_event_func (window, event, arg, type);
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
223 */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
224 time_stamp = event_time (event);
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
225 ttysw_input (tty_win, mouse_prefix, m_prefix_length);
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
226 sprintf (buffer, "(%d %d %d %d)\015",
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
227 button_value (event),
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
228 (event_x (event) - left_margin) / font_width,
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
229 event_y (event) / font_height,
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
230 time_delta (time_stamp.tv_sec, time_stamp.tv_usec,
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
231 prev_event_sec, prev_event_usec)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
232 );
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
233 ttysw_input (tty_win, buffer, strlen(buffer));
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
234 prev_event_sec = time_stamp.tv_sec;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
235 prev_event_usec = time_stamp.tv_usec;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
236 return NOTIFY_IGNORED;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
237 }
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
238
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
239 { /* Do the function key events */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
240 int d;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
241 char c = (char) 0;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
242 if ((event_is_key_left (event)) ?
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
243 ((d = event_id(event) - KEY_LEFT(1) + 'a'), c='l') :
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
244 ((event_is_key_right (event)) ?
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
245 ((d = event_id(event) - KEY_RIGHT(1) + 'a'), c='r') :
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
246 ((event_is_key_top (event)) ?
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
247 ((d = event_id(event) - KEY_TOP(1) + 'a'), c='t') : 0)))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
248 {
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
249 if (event_is_up(event)) return NOTIFY_IGNORED;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
250 if (event_shift_is_down (event)) c = c - 32;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
251 /* this will give a non-{lrt} for unshifted keys */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
252 if (event_ctrl_is_down (event)) c = c - 64;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
253 if (event_meta_is_down (event)) c = c + 128;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
254 #ifdef WANT_CAPS_LOCK
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
255 /* set a toggle and relabel window so T1 can act like caps-lock */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
256 if (event_id(event) == KEY_TOP(1))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
257 {
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
258 /* make a frame label with and without CAPS */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
259 strcpy (buffer, Caps);
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
260 title = &buffer[CAPS_LEN];
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
261 strncpy (title, (char *)window_get (frame, FRAME_LABEL),
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
262 BUFFER_SIZE - CAPS_LEN);
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
263 buffer[BUFFER_SIZE] = (char) 0;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
264 if (strncmp (title, Caps, CAPS_LEN) == 0)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
265 title += CAPS_LEN; /* already Caps */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
266 caps_lock = (caps_lock ? 0 : CAPS_LEN);
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
267 window_set(frame, FRAME_LABEL, (title -= caps_lock), 0);
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
268 return NOTIFY_IGNORED;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
269 }
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
270 #endif
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
271 ttysw_input (tty_win, key_prefix, k_prefix_length);
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
272 sprintf (buffer, "%c%c", d, c);
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
273 ttysw_input(tty_win, buffer, strlen(buffer));
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
274
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
275 return NOTIFY_IGNORED;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
276 }
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
277 }
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
278 if ((event_is_ascii(event) || event_is_meta(event))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
279 && event_is_up(event)) return NOTIFY_IGNORED;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
280 #ifdef WANT_CAPS_LOCK
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
281 /* shift alpha chars to upper case if toggle is set */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
282 if ((caps_lock) && event_is_ascii(event)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
283 && (event_id(event) >= 'a') && (event_id(event) <= 'z'))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
284 event_set_id(event, (event_id(event) - 32));
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
285 /* crufty, but it works for now. is there an UPCASE(event)? */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
286 #endif
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
287 #ifndef NO_META_BIT
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
288 /* under Openwindows/X, the meta bit is not set in the key event,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
289 * emacs expects this so we add it in here:
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
290 */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
291 if (event_is_ascii(event) && event_meta_is_down(event))
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
292 event_set_id(event, 128 | event_id(event));
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
293 #endif
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
294 return notify_next_event_func (window, event, arg, type);
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
295 }
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
296
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
297 main (argc, argv)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
298 int argc;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
299 char **argv;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
300 {
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
301 int error_code; /* Error codes */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
302
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
303 #ifdef JLE
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
304 setlocale(LC_ALL, "");
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
305 #endif JLE
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
306
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
307 if(getenv("DEBUGEMACSTOOL"))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
308 console = fdopen (console_fd = open("/dev/console",O_WRONLY), "w");
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
309
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
310 putenv("IN_EMACSTOOL=t"); /* notify subprocess that it is in emacstool */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
311
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
312 if (putenv("TERM=sun") != 0) /* TTY_WIN will be a TERM=sun window */
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
313 {fprintf (stderr, "%s: Could not set TERM=sun, using `%s'\n",
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
314 argv[0], (char *)getenv("TERM")) ;};
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
315 /*
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
316 * If TERMCAP starts with a slash, it is the pathname of the
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
317 * termcap file, not an entry extracted from it, so KEEP it!
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
318 * Otherwise, it may not relate to the new TERM, so Nuke-It.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
319 * If there is no TERMCAP environment variable, don't make one.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
320 */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
321 {
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
322 char *termcap ; /* Current TERMCAP value */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
323 termcap = (char *)getenv("TERMCAP") ;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
324 if (termcap && (*termcap != '/'))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
325 {
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
326 if (putenv("TERMCAP=") != 0)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
327 {fprintf (stderr, "%s: Could not clear TERMCAP\n", argv[0]) ;} ;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
328 } ;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
329 } ;
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
330
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
331 /* find command to run as subprocess in window */
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
332 if (!(argv[0] = (char *)getenv("EMACSTOOL"))) /* Set emacs command name */
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
333 argv[0] = emacs_name;
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
334 /* Emacstool recognizes two special args: -rc <file> and -bold <bold-name> */
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
335 for (argc = 1; argv[argc]; argc++) /* Use last one on line */
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
336 {
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
337 if(!(strcmp ("-rc", argv[argc]))) /* Override if -rc given */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
338 {int i = argc;
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
339 argv[argc--]=0; /* kill the -rc argument */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
340 if (argv[i+1]) { /* move to argv[0] and squeeze the rest */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
341 argv[0]=argv[i+1];
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
342 for (; argv[i+2]; (argv[i]=argv[i+2],argv[++i]=0));
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
343 }
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
344 }
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
345
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
346 if (!(strcmp ("-bold", argv[argc])))
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
347 {int i = argc;
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
348 argv[argc--]=0; /* kill the -bold argument */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
349 if (argv[i+1]) { /* move to bold_name and squeeze the rest */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
350 bold_name = argv[i+1];
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
351 for (; argv[i+2]; (argv[i]=argv[i+2],argv[++i]=0));
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
352 }
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
353 }
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
354 };
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
355
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
356 strcpy (buffer, title);
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
357 strncat (buffer, argv[0], /* append run command name */
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
358 (BUFFER_SIZE - (strlen (buffer)) - (strlen (argv[0]))) - 1);
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
359
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
360 error_code = interpose_on_window(argc,argv);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
361 if (error_code != 0) { /* Barf */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
362 fprintf (stderr, "notify_interpose_event_func returns %d.\n", error_code);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
363 exit (1);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
364 }
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
365
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
366 #ifdef XVIEW
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
367 xv_main_loop (frame); /* And away we go */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
368 #else
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
369 window_main_loop (frame);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
370 #endif XVIEW
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
371 }
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
372
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
373 #ifdef XVIEW
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
374 int interpose_on_window(argc,argv)
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
375 int argc;
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
376 char **argv;
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
377 {
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
378 #ifndef TTERM
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
379 int i, font_width_adjust = 1; /* hackery, and hueristics */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
380 /* if -Wt is not supplied, then font comes out as lucida-14 (width=8)
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
381 * rather than the screen.r.12 (width=7) typically used
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
382 * this hack attempts to workaround it.
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
383 * could use a env var EMACSTOOL_DEFAULT_FONT_WIDTH instead */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
384 for (i = 1; argv[i]; i++) {
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
385 if (!(strcmp ("-Wt", argv[i])))
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
386 {font_width_adjust = 0;
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
387 if (console_fd) fprintf(console, "-Wt = %d\n", font_width_adjust);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
388 break;}
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
389 }
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
390 #endif TTERM
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
391 /* initialize Xview, and strip window args */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
392 xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, 0);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
393
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
394 /* do this first, so arglist can override it */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
395 frame_icon = icon_create (ICON_LABEL, "Emacstool",
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
396 ICON_IMAGE, &icon_image,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
397 0);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
398
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
399 /* Build a frame to run in */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
400 frame = xv_create ((Xv_Window)NULL, FRAME,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
401 FRAME_LABEL, buffer,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
402 FRAME_ICON, frame_icon,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
403 0);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
404
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
405 /* Create a tty with emacs in it */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
406 tty_win = xv_create (frame, SWTYPE, WIN_IS_CLIENT_PANE,
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
407 TTY_QUIT_ON_CHILD_DEATH, TRUE,
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
408 TTY_BOLDSTYLE, TTYSW_BOLD_INVERT,
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
409 TTY_ARGV, argv,
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
410 0);
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
411
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
412 if (bold_name) {
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
413 (void)xv_set(tty_win, TTY_BOLDSTYLE_NAME, bold_name, 0);
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
414 }
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
415
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
416 {
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
417 Xv_font font; /* declare temp font variable */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
418 font = (Xv_font)xv_get (tty_win, XV_FONT);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
419 font_height = (int)xv_get (font, FONT_DEFAULT_CHAR_HEIGHT);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
420 font_width = (int)xv_get (font, FONT_DEFAULT_CHAR_WIDTH);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
421 }
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
422 if (console_fd) fprintf(console, "Width = %d\n", font_width);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
423
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
424 #ifndef TTERM
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
425 font_width -= font_width_adjust; /* A guess! font bug in ttysw*/
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
426 #else
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
427 /* make the termsw act as a tty */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
428 xv_set(tty_win, TERMSW_MODE, TTYSW_MODE_TYPE, 0);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
429 /* termsw has variable offset depending on scrollbar size/location */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
430 left_margin = (int)xv_get (tty_win, TEXTSW_LEFT_MARGIN);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
431 #endif TTERM
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
432
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
433 tty_view = (Xv_Window) xv_get (tty_win, OPENWIN_NTH_VIEW, 0);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
434 xv_set(tty_view,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
435 WIN_CONSUME_EVENTS,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
436 WIN_MOUSE_BUTTONS, WIN_UP_EVENTS,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
437 ACTION_ADJUST, ACTION_MENU,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
438 WIN_ASCII_EVENTS,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
439 WIN_LEFT_KEYS, WIN_TOP_KEYS, WIN_RIGHT_KEYS,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
440 0,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
441 0);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
442 /* Interpose my event function */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
443 return (int) notify_interpose_event_func
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
444 (tty_view, input_event_filter_function, NOTIFY_SAFE);
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
445 }
287
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
446 #else
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
447 int interpose_on_window (argc, argv)
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
448 int argc;
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
449 char **argv;
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
450 {
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
451 /* do this first, so arglist can override it */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
452 frame_icon = icon_create (ICON_LABEL, "Emacstool",
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
453 ICON_IMAGE, &icon_image,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
454 0);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
455
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
456 /* Build a frame to run in */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
457 frame = window_create ((Window)NULL, FRAME,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
458 FRAME_LABEL, buffer,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
459 FRAME_ICON, frame_icon,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
460 FRAME_ARGC_PTR_ARGV, &argc, argv,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
461 0);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
462
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
463 /* Create a tty with emacs in it */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
464 tty_win = window_create (frame, TTY,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
465 TTY_QUIT_ON_CHILD_DEATH, TRUE,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
466 TTY_BOLDSTYLE, TTYSW_BOLD_INVERT,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
467 TTY_ARGV, argv,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
468 0);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
469
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
470 if (bold_name) {
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
471 (void)window_set(tty_win, TTY_BOLDSTYLE_NAME, bold_name, 0);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
472 }
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
473
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
474 /* ttysw uses pf_default, one must set WIN_FONT explicitly */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
475 window_set (tty_win, WIN_FONT, pf_default(), 0);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
476 font_height = (int)window_get (tty_win, WIN_ROW_HEIGHT);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
477 font_width = (int)window_get (tty_win, WIN_COLUMN_WIDTH);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
478
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
479 tty_view = tty_win;
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
480 window_set(tty_view,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
481 WIN_CONSUME_PICK_EVENTS,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
482 WIN_STOP,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
483 WIN_MOUSE_BUTTONS, WIN_UP_EVENTS,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
484 /* LOC_WINENTER, LOC_WINEXIT, LOC_MOVE, */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
485 0,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
486 WIN_CONSUME_KBD_EVENTS,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
487 WIN_STOP,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
488 WIN_ASCII_EVENTS,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
489 WIN_LEFT_KEYS, WIN_TOP_KEYS, WIN_RIGHT_KEYS,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
490 /* WIN_UP_ASCII_EVENTS, */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
491 0,
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
492 0);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
493 /* Interpose my event function */
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
494 return (int) notify_interpose_event_func
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
495 (tty_view, input_event_filter_function, NOTIFY_SAFE);
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
496 }
1616777eaae5 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 36
diff changeset
497 #endif XVIEW