Mercurial > emacs
annotate src/term.c @ 112317:7df2e30d72ec
Include <unistd.h> unilaterally.
| author | Paul Eggert <eggert@cs.ucla.edu> |
|---|---|
| date | Sun, 09 Jan 2011 00:12:35 -0800 |
| parents | b9616a1b568d |
| children | 17e0028efc29 |
| rev | line source |
|---|---|
|
37959
b53edc686faf
(tty_cursor_hidden): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37499
diff
changeset
|
1 /* Terminal control module for terminals described by TERMCAP |
|
64770
a0d1312ede66
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64084
diff
changeset
|
2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1998, 2000, 2001, |
| 106815 | 3 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
| 79759 | 4 Free Software Foundation, Inc. |
| 253 | 5 |
| 6 This file is part of GNU Emacs. | |
| 7 | |
|
94963
8971ddf55736
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93984
diff
changeset
|
8 GNU Emacs is free software: you can redistribute it and/or modify |
| 253 | 9 it under the terms of the GNU General Public License as published by |
|
94963
8971ddf55736
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93984
diff
changeset
|
10 the Free Software Foundation, either version 3 of the License, or |
|
8971ddf55736
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93984
diff
changeset
|
11 (at your option) any later version. |
| 253 | 12 |
| 13 GNU Emacs is distributed in the hope that it will be useful, | |
| 14 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 GNU General Public License for more details. | |
| 17 | |
| 18 You should have received a copy of the GNU General Public License | |
|
94963
8971ddf55736
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93984
diff
changeset
|
19 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
| 253 | 20 |
|
37959
b53edc686faf
(tty_cursor_hidden): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37499
diff
changeset
|
21 /* New redisplay, TTY faces by Gerd Moellmann <gerd@gnu.org>. */ |
| 253 | 22 |
|
7900
60795e826dad
Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents:
7649
diff
changeset
|
23 #include <config.h> |
| 253 | 24 #include <stdio.h> |
| 25 #include <ctype.h> | |
|
83498
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
26 #include <errno.h> |
|
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
27 #include <sys/file.h> |
|
81811
c10410a3aa36
Include unistd.h for ttyname, used in handle_one_term_event.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81308
diff
changeset
|
28 #include <unistd.h> |
|
83086
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
29 #include <signal.h> |
|
86288
145903731829
* term.c: Include stdarg.h.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85614
diff
changeset
|
30 #include <stdarg.h> |
|
105669
68dd71358159
* alloc.c: Do not define struct catchtag.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105661
diff
changeset
|
31 #include <setjmp.h> |
|
83032
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
32 |
|
53229
33c3c7c16e13
lib-src/emacsclient.c: Implemented --here option (open a new Emacs tty). Needs more work.
Karoly Lorentey <lorentey@elte.hu>
parents:
53227
diff
changeset
|
33 #include "lisp.h" |
| 253 | 34 #include "termchar.h" |
| 35 #include "termopts.h" | |
|
88391
1953d0d56cd7
Include "buffer.h" and "character.h".
Kenichi Handa <handa@m17n.org>
parents:
43073
diff
changeset
|
36 #include "buffer.h" |
|
1953d0d56cd7
Include "buffer.h" and "character.h".
Kenichi Handa <handa@m17n.org>
parents:
43073
diff
changeset
|
37 #include "character.h" |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
38 #include "charset.h" |
|
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
39 #include "coding.h" |
| 90638 | 40 #include "composite.h" |
|
31102
6a0caa788013
Include keyboard.h before frame.h.
Andrew Innes <andrewi@gnu.org>
parents:
30848
diff
changeset
|
41 #include "keyboard.h" |
| 765 | 42 #include "frame.h" |
| 253 | 43 #include "disptab.h" |
| 44 #include "termhooks.h" | |
| 21514 | 45 #include "dispextern.h" |
| 25002 | 46 #include "window.h" |
|
39697
0b986bb45526
Include keymap.h.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39682
diff
changeset
|
47 #include "keymap.h" |
|
76627
c53e7d075f1a
Include blockinput.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
75348
diff
changeset
|
48 #include "blockinput.h" |
|
83086
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
49 #include "syssignal.h" |
|
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
50 #include "systty.h" |
|
81308
16181a4d64bf
Include intervals.h to declare Fget_text_property.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81127
diff
changeset
|
51 #include "intervals.h" |
| 97658 | 52 #ifdef MSDOS |
| 53 #include "msdos.h" | |
| 54 static int been_here = -1; | |
| 55 #endif | |
| 25002 | 56 |
|
33672
a94852aef620
Don't try to include termcap.h; see comment there.
Gerd Moellmann <gerd@gnu.org>
parents:
33006
diff
changeset
|
57 /* For now, don't try to include termcap.h. On some systems, |
|
a94852aef620
Don't try to include termcap.h; see comment there.
Gerd Moellmann <gerd@gnu.org>
parents:
33006
diff
changeset
|
58 configure finds a non-standard termcap.h that the main build |
|
a94852aef620
Don't try to include termcap.h; see comment there.
Gerd Moellmann <gerd@gnu.org>
parents:
33006
diff
changeset
|
59 won't find. */ |
|
109100
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
60 extern void tputs (const char *, int, int (*)(int)); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
61 extern int tgetent (char *, const char *); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
62 extern int tgetflag (char *id); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
63 extern int tgetnum (char *id); |
|
25727
46fe79182b54
(OUTPUT_IF, OUTPUT1_IF): Use do-while.
Gerd Moellmann <gerd@gnu.org>
parents:
25675
diff
changeset
|
64 |
|
111689
b9616a1b568d
Move extern declarations from term.c to lisp.h.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
111651
diff
changeset
|
65 char *tparam (char *, char *, int, int, ...); |
|
b9616a1b568d
Move extern declarations from term.c to lisp.h.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
111651
diff
changeset
|
66 |
|
b9616a1b568d
Move extern declarations from term.c to lisp.h.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
111651
diff
changeset
|
67 extern char *tgetstr (char *, char **); |
|
b9616a1b568d
Move extern declarations from term.c to lisp.h.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
111651
diff
changeset
|
68 |
|
21827
87c7f4bd99da
Include cm.h after dispextern.h to avoid name conflicts
Geoff Voelker <voelker@cs.washington.edu>
parents:
21624
diff
changeset
|
69 #include "cm.h" |
| 21514 | 70 #ifdef HAVE_X_WINDOWS |
| 71 #include "xterm.h" | |
| 72 #endif | |
| 8898 | 73 |
|
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
74 #ifndef O_RDWR |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
75 #define O_RDWR 2 |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
76 #endif |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
77 |
|
83032
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
78 #ifndef O_NOCTTY |
|
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
79 #define O_NOCTTY 0 |
|
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
80 #endif |
|
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
81 |
|
84779
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
82 /* The name of the default console device. */ |
|
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
83 #ifdef WINDOWSNT |
|
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
84 #define DEV_TTY "CONOUT$" |
|
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
85 #else |
|
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
86 #define DEV_TTY "/dev/tty" |
|
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
87 #endif |
|
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
88 |
|
109100
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
89 static void tty_set_scroll_region (struct frame *f, int start, int stop); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
90 static void turn_on_face (struct frame *, int face_id); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
91 static void turn_off_face (struct frame *, int face_id); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
92 static void tty_show_cursor (struct tty_display_info *); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
93 static void tty_hide_cursor (struct tty_display_info *); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
94 static void tty_background_highlight (struct tty_display_info *tty); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
95 static void clear_tty_hooks (struct terminal *terminal); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
96 static void set_tty_hooks (struct terminal *terminal); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
97 static void dissociate_if_controlling_tty (int fd); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
98 static void delete_tty (struct terminal *); |
|
109375
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
99 static void maybe_fatal (int must_succeed, struct terminal *terminal, |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
100 const char *str1, const char *str2, ...) NO_RETURN; |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
101 static void vfatal (const char *str, va_list ap) NO_RETURN; |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
102 |
| 25002 | 103 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
104 #define OUTPUT(tty, a) \ |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
105 emacs_tputs ((tty), a, \ |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
106 (int) (FRAME_LINES (XFRAME (selected_frame)) \ |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
107 - curY (tty)), \ |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
108 cmputc) |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
109 |
|
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
110 #define OUTPUT1(tty, a) emacs_tputs ((tty), a, 1, cmputc) |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
111 #define OUTPUTL(tty, a, lines) emacs_tputs ((tty), a, lines, cmputc) |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
112 |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
113 #define OUTPUT_IF(tty, a) \ |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
114 do { \ |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
115 if (a) \ |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
116 emacs_tputs ((tty), a, \ |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
117 (int) (FRAME_LINES (XFRAME (selected_frame)) \ |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
118 - curY (tty) ), \ |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
119 cmputc); \ |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
120 } while (0) |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
121 |
|
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
122 #define OUTPUT1_IF(tty, a) do { if (a) emacs_tputs ((tty), a, 1, cmputc); } while (0) |
|
15974
61249a8fe735
(Vring_bell_function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
15094
diff
changeset
|
123 |
|
67935
52bbc53dbce1
(visible_cursor): New boolean var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66238
diff
changeset
|
124 /* If true, use "vs", otherwise use "ve" to make the cursor visible. */ |
|
52bbc53dbce1
(visible_cursor): New boolean var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66238
diff
changeset
|
125 |
|
52bbc53dbce1
(visible_cursor): New boolean var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66238
diff
changeset
|
126 static int visible_cursor; |
|
52bbc53dbce1
(visible_cursor): New boolean var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66238
diff
changeset
|
127 |
|
54428
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
128 /* Display space properties */ |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
129 |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
130 /* Functions to call after suspending a tty. */ |
|
83891
dab32bc3edc8
* server.el (server-start, server-unload-hook): Undo previous
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83889
diff
changeset
|
131 Lisp_Object Vsuspend_tty_functions; |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
132 |
|
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
133 /* Functions to call after resuming a tty. */ |
|
83891
dab32bc3edc8
* server.el (server-start, server-unload-hook): Undo previous
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83889
diff
changeset
|
134 Lisp_Object Vresume_tty_functions; |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
135 |
|
83004
7900111db01c
Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
82995
diff
changeset
|
136 /* Chain of all tty device parameters. */ |
|
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
82988
diff
changeset
|
137 struct tty_display_info *tty_list; |
| 253 | 138 |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
139 /* Nonzero means no need to redraw the entire frame on resuming a |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
140 suspended Emacs. This is useful on terminals with multiple |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
141 pages, where one page is used for Emacs and another for all |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
142 else. */ |
| 253 | 143 int no_redraw_on_reenter; |
| 144 | |
|
28465
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
145 /* Meaning of bits in no_color_video. Each bit set means that the |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
146 corresponding attribute cannot be combined with colors. */ |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
147 |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
148 enum no_color_bit |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
149 { |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
150 NC_STANDOUT = 1 << 0, |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
151 NC_UNDERLINE = 1 << 1, |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
152 NC_REVERSE = 1 << 2, |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
153 NC_BLINK = 1 << 3, |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
154 NC_DIM = 1 << 4, |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
155 NC_BOLD = 1 << 5, |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
156 NC_INVIS = 1 << 6, |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
157 NC_PROTECT = 1 << 7, |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
158 NC_ALT_CHARSET = 1 << 8 |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
159 }; |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
160 |
| 253 | 161 /* internal state */ |
| 162 | |
|
10771
d564078d10c6
(calculate_costs): Update max_frame_height, max_frame_width.
Richard M. Stallman <rms@gnu.org>
parents:
10481
diff
changeset
|
163 /* The largest frame width in any call to calculate_costs. */ |
| 25002 | 164 |
|
51212
332134065648
Make (some) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
50227
diff
changeset
|
165 int max_frame_cols; |
| 25002 | 166 |
|
10771
d564078d10c6
(calculate_costs): Update max_frame_height, max_frame_width.
Richard M. Stallman <rms@gnu.org>
parents:
10481
diff
changeset
|
167 /* The largest frame height in any call to calculate_costs. */ |
| 25002 | 168 |
|
51212
332134065648
Make (some) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
50227
diff
changeset
|
169 int max_frame_lines; |
|
10771
d564078d10c6
(calculate_costs): Update max_frame_height, max_frame_width.
Richard M. Stallman <rms@gnu.org>
parents:
10481
diff
changeset
|
170 |
|
83032
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
171 /* Non-zero if we have dropped our controlling tty and therefore |
|
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
172 should not open a frame on stdout. */ |
|
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
173 static int no_controlling_tty; |
| 253 | 174 |
|
6752
f9236145bad7
(system_uses_terminfo): New variable.
Karl Heuer <kwzh@gnu.org>
parents:
6652
diff
changeset
|
175 /* Provided for lisp packages. */ |
| 25002 | 176 |
|
6752
f9236145bad7
(system_uses_terminfo): New variable.
Karl Heuer <kwzh@gnu.org>
parents:
6652
diff
changeset
|
177 static int system_uses_terminfo; |
|
f9236145bad7
(system_uses_terminfo): New variable.
Karl Heuer <kwzh@gnu.org>
parents:
6652
diff
changeset
|
178 |
| 253 | 179 |
|
9797
05d9072c5a38
(term_init) [WINDOWSNT]: Do some Windows-specific
Richard M. Stallman <rms@gnu.org>
parents:
9658
diff
changeset
|
180 |
|
80994
62b6aa7f8c37
Use HAVE_GPM instead of HAVE_GPM_H.
Nick Roberts <nickrob@snap.net.nz>
parents:
80979
diff
changeset
|
181 #ifdef HAVE_GPM |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
182 #include <sys/fcntl.h> |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
183 |
|
84768
53194ec05789
* termhooks.h (term_gpm): Delete. Use gpm_tty's NULLness instead.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84692
diff
changeset
|
184 /* The device for which we have enabled gpm support (or NULL). */ |
|
53194ec05789
* termhooks.h (term_gpm): Delete. Use gpm_tty's NULLness instead.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84692
diff
changeset
|
185 struct tty_display_info *gpm_tty = NULL; |
| 83622 | 186 |
|
111343
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
187 /* Last recorded mouse coordinates. */ |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
188 static int last_mouse_x, last_mouse_y; |
|
80994
62b6aa7f8c37
Use HAVE_GPM instead of HAVE_GPM_H.
Nick Roberts <nickrob@snap.net.nz>
parents:
80979
diff
changeset
|
189 #endif /* HAVE_GPM */ |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
190 |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
191 /* Ring the bell on a tty. */ |
|
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
192 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
193 static void |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
194 tty_ring_bell (struct frame *f) |
| 253 | 195 { |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
196 struct tty_display_info *tty = FRAME_TTY (f); |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
197 |
|
83167
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83161
diff
changeset
|
198 if (tty->output) |
|
15974
61249a8fe735
(Vring_bell_function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
15094
diff
changeset
|
199 { |
|
83167
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83161
diff
changeset
|
200 OUTPUT (tty, (tty->TS_visible_bell && visible_bell |
|
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83161
diff
changeset
|
201 ? tty->TS_visible_bell |
|
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83161
diff
changeset
|
202 : tty->TS_bell)); |
|
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83161
diff
changeset
|
203 fflush (tty->output); |
|
15974
61249a8fe735
(Vring_bell_function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
15094
diff
changeset
|
204 } |
| 253 | 205 } |
| 206 | |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
207 /* Set up termcap modes for Emacs. */ |
| 253 | 208 |
| 21514 | 209 void |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
210 tty_set_terminal_modes (struct terminal *terminal) |
| 253 | 211 { |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
212 struct tty_display_info *tty = terminal->display_info.tty; |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
213 |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
214 if (tty->output) |
| 253 | 215 { |
|
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
216 if (tty->TS_termcap_modes) |
|
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
217 OUTPUT (tty, tty->TS_termcap_modes); |
|
64773
aebbf7125281
(set_terminal_modes): If no TS_termcap_modes string,
Richard M. Stallman <rms@gnu.org>
parents:
64770
diff
changeset
|
218 else |
|
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
219 { |
|
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
220 /* Output enough newlines to scroll all the old screen contents |
|
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
221 off the screen, so it won't be overwritten and lost. */ |
|
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
222 int i; |
|
83382
7a3090aca393
Fix hardcoded stdout usage in term.c. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83370
diff
changeset
|
223 current_tty = tty; |
|
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
224 for (i = 0; i < FRAME_LINES (XFRAME (selected_frame)); i++) |
|
83382
7a3090aca393
Fix hardcoded stdout usage in term.c. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83370
diff
changeset
|
225 cmputc ('\n'); |
|
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
226 } |
|
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
227 |
|
83450
c69d44922688
Merged from miles@gnu.org--gnu-2005 (patch 682)
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
228 OUTPUT_IF (tty, visible_cursor ? tty->TS_cursor_visible : tty->TS_cursor_normal); |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
229 OUTPUT_IF (tty, tty->TS_keypad_mode); |
|
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
230 losecursor (tty); |
|
83330
233c9974025b
Fix the original cause of the "arrow keys don't work on screen" bug.
Karoly Lorentey <lorentey@elte.hu>
parents:
83323
diff
changeset
|
231 fflush (tty->output); |
| 253 | 232 } |
| 233 } | |
| 234 | |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
235 /* Reset termcap modes before exiting Emacs. */ |
| 253 | 236 |
| 21514 | 237 void |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
238 tty_reset_terminal_modes (struct terminal *terminal) |
| 253 | 239 { |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
240 struct tty_display_info *tty = terminal->display_info.tty; |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
241 |
|
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
242 if (tty->output) |
| 253 | 243 { |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
244 tty_turn_off_highlight (tty); |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
245 tty_turn_off_insert (tty); |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
246 OUTPUT_IF (tty, tty->TS_end_keypad_mode); |
|
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
247 OUTPUT_IF (tty, tty->TS_cursor_normal); |
|
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
248 OUTPUT_IF (tty, tty->TS_end_termcap_modes); |
|
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
249 OUTPUT_IF (tty, tty->TS_orig_pair); |
|
37959
b53edc686faf
(tty_cursor_hidden): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37499
diff
changeset
|
250 /* Output raw CR so kernel can track the cursor hpos. */ |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
251 current_tty = tty; |
|
37959
b53edc686faf
(tty_cursor_hidden): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37499
diff
changeset
|
252 cmputc ('\r'); |
|
83330
233c9974025b
Fix the original cause of the "arrow keys don't work on screen" bug.
Karoly Lorentey <lorentey@elte.hu>
parents:
83323
diff
changeset
|
253 fflush (tty->output); |
| 253 | 254 } |
| 255 } | |
| 256 | |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
257 /* Flag the end of a display update on a termcap terminal. */ |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
258 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
259 static void |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
260 tty_update_end (struct frame *f) |
| 253 | 261 { |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
262 struct tty_display_info *tty = FRAME_TTY (f); |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
263 |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
264 if (!XWINDOW (selected_window)->cursor_off_p) |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
265 tty_show_cursor (tty); |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
266 tty_turn_off_insert (tty); |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
267 tty_background_highlight (tty); |
| 253 | 268 } |
| 269 | |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
270 /* The implementation of set_terminal_window for termcap frames. */ |
|
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
271 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
272 static void |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
273 tty_set_terminal_window (struct frame *f, int size) |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
274 { |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
275 struct tty_display_info *tty = FRAME_TTY (f); |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
276 |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
277 tty->specified_window = size ? size : FRAME_LINES (f); |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
278 if (FRAME_SCROLL_REGION_OK (f)) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
279 tty_set_scroll_region (f, 0, tty->specified_window); |
| 253 | 280 } |
| 281 | |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
282 static void |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
283 tty_set_scroll_region (struct frame *f, int start, int stop) |
| 253 | 284 { |
| 285 char *buf; | |
|
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
82988
diff
changeset
|
286 struct tty_display_info *tty = FRAME_TTY (f); |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
287 |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
288 if (tty->TS_set_scroll_region) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
289 buf = tparam (tty->TS_set_scroll_region, 0, 0, start, stop - 1); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
290 else if (tty->TS_set_scroll_region_1) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
291 buf = tparam (tty->TS_set_scroll_region_1, 0, 0, |
|
53227
1595c5e1e9bb
Updating_frame vs. selected_frame in term.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
292 FRAME_LINES (f), start, |
|
1595c5e1e9bb
Updating_frame vs. selected_frame in term.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
293 FRAME_LINES (f) - stop, |
|
1595c5e1e9bb
Updating_frame vs. selected_frame in term.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
294 FRAME_LINES (f)); |
| 253 | 295 else |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
296 buf = tparam (tty->TS_set_window, 0, 0, start, 0, stop, FRAME_COLS (f)); |
|
53227
1595c5e1e9bb
Updating_frame vs. selected_frame in term.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
297 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
298 OUTPUT (tty, buf); |
|
2439
b6c62e4abf59
Put interrupt input blocking in a separate file from xterm.h.
Jim Blandy <jimb@redhat.com>
parents:
2243
diff
changeset
|
299 xfree (buf); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
300 losecursor (tty); |
| 253 | 301 } |
|
37959
b53edc686faf
(tty_cursor_hidden): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37499
diff
changeset
|
302 |
| 253 | 303 |
|
37959
b53edc686faf
(tty_cursor_hidden): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37499
diff
changeset
|
304 static void |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
305 tty_turn_on_insert (struct tty_display_info *tty) |
| 253 | 306 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
307 if (!tty->insert_mode) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
308 OUTPUT (tty, tty->TS_insert_mode); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
309 tty->insert_mode = 1; |
| 253 | 310 } |
| 311 | |
| 21514 | 312 void |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
313 tty_turn_off_insert (struct tty_display_info *tty) |
| 253 | 314 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
315 if (tty->insert_mode) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
316 OUTPUT (tty, tty->TS_end_insert_mode); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
317 tty->insert_mode = 0; |
| 253 | 318 } |
| 319 | |
|
40086
050b19294988
(TN_standout_width, TF_xs, TN_magic_cookie_glitch_ul): Variables removed.
Miles Bader <miles@gnu.org>
parents:
40081
diff
changeset
|
320 /* Handle highlighting. */ |
| 253 | 321 |
| 21514 | 322 void |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
323 tty_turn_off_highlight (struct tty_display_info *tty) |
| 253 | 324 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
325 if (tty->standout_mode) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
326 OUTPUT_IF (tty, tty->TS_end_standout_mode); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
327 tty->standout_mode = 0; |
| 253 | 328 } |
| 329 | |
|
37959
b53edc686faf
(tty_cursor_hidden): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37499
diff
changeset
|
330 static void |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
331 tty_turn_on_highlight (struct tty_display_info *tty) |
| 253 | 332 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
333 if (!tty->standout_mode) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
334 OUTPUT_IF (tty, tty->TS_standout_mode); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
335 tty->standout_mode = 1; |
| 253 | 336 } |
| 337 | |
|
37477
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
338 static void |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
339 tty_toggle_highlight (struct tty_display_info *tty) |
|
37477
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
340 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
341 if (tty->standout_mode) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
342 tty_turn_off_highlight (tty); |
|
37477
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
343 else |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
344 tty_turn_on_highlight (tty); |
|
37477
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
345 } |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
346 |
| 25002 | 347 |
| 348 /* Make cursor invisible. */ | |
| 349 | |
| 350 static void | |
|
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
82988
diff
changeset
|
351 tty_hide_cursor (struct tty_display_info *tty) |
| 25002 | 352 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
353 if (tty->cursor_hidden == 0) |
|
37959
b53edc686faf
(tty_cursor_hidden): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37499
diff
changeset
|
354 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
355 tty->cursor_hidden = 1; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
356 OUTPUT_IF (tty, tty->TS_cursor_invisible); |
|
37959
b53edc686faf
(tty_cursor_hidden): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37499
diff
changeset
|
357 } |
| 25002 | 358 } |
| 359 | |
| 360 | |
| 361 /* Ensure that cursor is visible. */ | |
| 362 | |
| 363 static void | |
|
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
82988
diff
changeset
|
364 tty_show_cursor (struct tty_display_info *tty) |
| 25002 | 365 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
366 if (tty->cursor_hidden) |
|
37959
b53edc686faf
(tty_cursor_hidden): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37499
diff
changeset
|
367 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
368 tty->cursor_hidden = 0; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
369 OUTPUT_IF (tty, tty->TS_cursor_normal); |
|
67935
52bbc53dbce1
(visible_cursor): New boolean var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66238
diff
changeset
|
370 if (visible_cursor) |
|
83450
c69d44922688
Merged from miles@gnu.org--gnu-2005 (patch 682)
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
371 OUTPUT_IF (tty, tty->TS_cursor_visible); |
|
37959
b53edc686faf
(tty_cursor_hidden): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37499
diff
changeset
|
372 } |
| 25002 | 373 } |
| 374 | |
| 375 | |
| 253 | 376 /* Set standout mode to the state it should be in for |
| 377 empty space inside windows. What this is, | |
| 378 depends on the user option inverse-video. */ | |
| 379 | |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
380 static void |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
381 tty_background_highlight (struct tty_display_info *tty) |
| 253 | 382 { |
| 383 if (inverse_video) | |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
384 tty_turn_on_highlight (tty); |
| 253 | 385 else |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
386 tty_turn_off_highlight (tty); |
| 253 | 387 } |
| 388 | |
| 389 /* Set standout mode to the mode specified for the text to be output. */ | |
| 390 | |
| 21514 | 391 static void |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
392 tty_highlight_if_desired (struct tty_display_info *tty) |
| 253 | 393 { |
|
40081
07d7dbf18784
(reassert_line_highlight_hook, change_line_highlight_hook): Variables removed.
Miles Bader <miles@gnu.org>
parents:
39988
diff
changeset
|
394 if (inverse_video) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
395 tty_turn_on_highlight (tty); |
|
40081
07d7dbf18784
(reassert_line_highlight_hook, change_line_highlight_hook): Variables removed.
Miles Bader <miles@gnu.org>
parents:
39988
diff
changeset
|
396 else |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
397 tty_turn_off_highlight (tty); |
| 253 | 398 } |
| 399 | |
| 400 | |
| 25002 | 401 /* Move cursor to row/column position VPOS/HPOS. HPOS/VPOS are |
| 402 frame-relative coordinates. */ | |
| 253 | 403 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
404 static void |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
405 tty_cursor_to (struct frame *f, int vpos, int hpos) |
| 253 | 406 { |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
407 struct tty_display_info *tty = FRAME_TTY (f); |
| 253 | 408 |
|
12071
f85f23c50344
(cursor_to, clear_to_end_of_line_raw):
Karl Heuer <kwzh@gnu.org>
parents:
11530
diff
changeset
|
409 /* Detect the case where we are called from reset_sys_modes |
|
f85f23c50344
(cursor_to, clear_to_end_of_line_raw):
Karl Heuer <kwzh@gnu.org>
parents:
11530
diff
changeset
|
410 and the costs have never been calculated. Do nothing. */ |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
411 if (! tty->costs_set) |
|
12071
f85f23c50344
(cursor_to, clear_to_end_of_line_raw):
Karl Heuer <kwzh@gnu.org>
parents:
11530
diff
changeset
|
412 return; |
|
f85f23c50344
(cursor_to, clear_to_end_of_line_raw):
Karl Heuer <kwzh@gnu.org>
parents:
11530
diff
changeset
|
413 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
414 if (curY (tty) == vpos |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
415 && curX (tty) == hpos) |
| 253 | 416 return; |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
417 if (!tty->TF_standout_motion) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
418 tty_background_highlight (tty); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
419 if (!tty->TF_insmode_motion) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
420 tty_turn_off_insert (tty); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
421 cmgoto (tty, vpos, hpos); |
| 253 | 422 } |
| 423 | |
| 424 /* Similar but don't take any account of the wasted characters. */ | |
| 425 | |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
426 static void |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
427 tty_raw_cursor_to (struct frame *f, int row, int col) |
| 253 | 428 { |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
429 struct tty_display_info *tty = FRAME_TTY (f); |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
430 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
431 if (curY (tty) == row |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
432 && curX (tty) == col) |
| 253 | 433 return; |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
434 if (!tty->TF_standout_motion) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
435 tty_background_highlight (tty); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
436 if (!tty->TF_insmode_motion) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
437 tty_turn_off_insert (tty); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
438 cmgoto (tty, row, col); |
| 253 | 439 } |
| 440 | |
| 441 /* Erase operations */ | |
| 442 | |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
443 /* Clear from cursor to end of frame on a termcap device. */ |
|
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
444 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
445 static void |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
446 tty_clear_to_end (struct frame *f) |
| 253 | 447 { |
| 448 register int i; | |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
449 struct tty_display_info *tty = FRAME_TTY (f); |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
450 |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
451 if (tty->TS_clr_to_bottom) |
| 253 | 452 { |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
453 tty_background_highlight (tty); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
454 OUTPUT (tty, tty->TS_clr_to_bottom); |
| 253 | 455 } |
| 456 else | |
| 457 { | |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
458 for (i = curY (tty); i < FRAME_LINES (f); i++) |
| 253 | 459 { |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
460 cursor_to (f, i, 0); |
|
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
461 clear_end_of_line (f, FRAME_COLS (f)); |
| 253 | 462 } |
| 463 } | |
| 464 } | |
| 465 | |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
466 /* Clear an entire termcap frame. */ |
|
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
467 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
468 static void |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
469 tty_clear_frame (struct frame *f) |
| 253 | 470 { |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
471 struct tty_display_info *tty = FRAME_TTY (f); |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
472 |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
473 if (tty->TS_clr_frame) |
| 253 | 474 { |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
475 tty_background_highlight (tty); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
476 OUTPUT (tty, tty->TS_clr_frame); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
477 cmat (tty, 0, 0); |
| 253 | 478 } |
| 479 else | |
| 480 { | |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
481 cursor_to (f, 0, 0); |
|
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
482 clear_to_end (f); |
| 253 | 483 } |
| 484 } | |
| 485 | |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
486 /* An implementation of clear_end_of_line for termcap frames. |
| 253 | 487 |
| 488 Note that the cursor may be moved, on terminals lacking a `ce' string. */ | |
| 489 | |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
490 static void |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
491 tty_clear_end_of_line (struct frame *f, int first_unused_hpos) |
| 253 | 492 { |
| 493 register int i; | |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
494 struct tty_display_info *tty = FRAME_TTY (f); |
| 253 | 495 |
|
12071
f85f23c50344
(cursor_to, clear_to_end_of_line_raw):
Karl Heuer <kwzh@gnu.org>
parents:
11530
diff
changeset
|
496 /* Detect the case where we are called from reset_sys_modes |
|
f85f23c50344
(cursor_to, clear_to_end_of_line_raw):
Karl Heuer <kwzh@gnu.org>
parents:
11530
diff
changeset
|
497 and the costs have never been calculated. Do nothing. */ |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
498 if (! tty->costs_set) |
|
12071
f85f23c50344
(cursor_to, clear_to_end_of_line_raw):
Karl Heuer <kwzh@gnu.org>
parents:
11530
diff
changeset
|
499 return; |
|
f85f23c50344
(cursor_to, clear_to_end_of_line_raw):
Karl Heuer <kwzh@gnu.org>
parents:
11530
diff
changeset
|
500 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
501 if (curX (tty) >= first_unused_hpos) |
| 253 | 502 return; |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
503 tty_background_highlight (tty); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
504 if (tty->TS_clr_line) |
| 253 | 505 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
506 OUTPUT1 (tty, tty->TS_clr_line); |
| 253 | 507 } |
| 508 else | |
| 509 { /* have to do it the hard way */ | |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
510 tty_turn_off_insert (tty); |
| 253 | 511 |
| 25002 | 512 /* Do not write in last row last col with Auto-wrap on. */ |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
513 if (AutoWrap (tty) |
| 53341 | 514 && curY (tty) == FrameRows (tty) - 1 |
| 515 && first_unused_hpos == FrameCols (tty)) | |
| 253 | 516 first_unused_hpos--; |
| 517 | |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
518 for (i = curX (tty); i < first_unused_hpos; i++) |
| 253 | 519 { |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
520 if (tty->termscript) |
|
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
521 fputc (' ', tty->termscript); |
|
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
522 fputc (' ', tty->output); |
| 253 | 523 } |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
524 cmplus (tty, first_unused_hpos - curX (tty)); |
| 253 | 525 } |
| 526 } | |
| 527 | |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
528 /* Buffers to store the source and result of code conversion for terminal. */ |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
529 static unsigned char *encode_terminal_src; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
530 static unsigned char *encode_terminal_dst; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
531 /* Allocated sizes of the above buffers. */ |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
532 static int encode_terminal_src_size; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
533 static int encode_terminal_dst_size; |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
534 |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
535 /* Encode SRC_LEN glyphs starting at SRC to terminal output codes. |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
536 Set CODING->produced to the byte-length of the resulting byte |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
537 sequence, and return a pointer to that byte sequence. */ |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
538 |
|
58701
24c51e9d8586
(encode_terminal_code): Don't make it "static".
Kenichi Handa <handa@m17n.org>
parents:
58638
diff
changeset
|
539 unsigned char * |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
540 encode_terminal_code (struct glyph *src, int src_len, struct coding_system *coding) |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
541 { |
|
66238
d3f5aa0f18c4
(encode_terminal_code): Remove unused var src_start.
Kim F. Storm <storm@cua.dk>
parents:
65795
diff
changeset
|
542 struct glyph *src_end = src + src_len; |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
543 unsigned char *buf; |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
544 int nchars, nbytes, required; |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
545 register int tlen = GLYPH_TABLE_LENGTH; |
|
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
546 register Lisp_Object *tbase = GLYPH_TABLE_BASE; |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
547 Lisp_Object charset_list; |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
548 |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
549 /* Allocate sufficient size of buffer to store all characters in |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
550 multibyte-form. But, it may be enlarged on demand if |
| 90638 | 551 Vglyph_table contains a string or a composite glyph is |
| 552 encountered. */ | |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
553 required = MAX_MULTIBYTE_LENGTH * src_len; |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
554 if (encode_terminal_src_size < required) |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
555 { |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
556 if (encode_terminal_src) |
|
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
557 encode_terminal_src = xrealloc (encode_terminal_src, required); |
|
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
558 else |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
559 encode_terminal_src = xmalloc (required); |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
560 encode_terminal_src_size = required; |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
561 } |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
562 |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
563 charset_list = coding_charset_list (coding); |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
564 |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
565 buf = encode_terminal_src; |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
566 nchars = 0; |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
567 while (src < src_end) |
|
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
568 { |
| 90638 | 569 if (src->type == COMPOSITE_GLYPH) |
| 570 { | |
|
97830
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
571 struct composition *cmp; |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
572 Lisp_Object gstring; |
| 90638 | 573 int i; |
| 574 | |
| 575 nbytes = buf - encode_terminal_src; | |
|
97830
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
576 if (src->u.cmp.automatic) |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
577 { |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
578 gstring = composition_gstring_from_id (src->u.cmp.id); |
|
110598
ee58b36ab139
Remove restriction on the number of glyphs in one composition.
Kenichi Handa <handa@m17n.org>
parents:
110357
diff
changeset
|
579 required = src->slice.cmp.to + 1 - src->slice.cmp.from; |
|
97830
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
580 } |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
581 else |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
582 { |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
583 cmp = composition_table[src->u.cmp.id]; |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
584 required = MAX_MULTIBYTE_LENGTH * cmp->glyph_len; |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
585 } |
| 90638 | 586 |
| 587 if (encode_terminal_src_size < nbytes + required) | |
| 588 { | |
| 589 encode_terminal_src_size = nbytes + required; | |
| 590 encode_terminal_src = xrealloc (encode_terminal_src, | |
| 591 encode_terminal_src_size); | |
| 592 buf = encode_terminal_src + nbytes; | |
| 593 } | |
| 594 | |
|
97830
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
595 if (src->u.cmp.automatic) |
|
110598
ee58b36ab139
Remove restriction on the number of glyphs in one composition.
Kenichi Handa <handa@m17n.org>
parents:
110357
diff
changeset
|
596 for (i = src->slice.cmp.from; i <= src->slice.cmp.to; i++) |
|
97830
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
597 { |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
598 Lisp_Object g = LGSTRING_GLYPH (gstring, i); |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
599 int c = LGLYPH_CHAR (g); |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
600 |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
601 if (! char_charset (c, charset_list, NULL)) |
|
101774
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
602 c = '?'; |
|
97830
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
603 buf += CHAR_STRING (c, buf); |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
604 nchars++; |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
605 } |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
606 else |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
607 for (i = 0; i < cmp->glyph_len; i++) |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
608 { |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
609 int c = COMPOSITION_GLYPH (cmp, i); |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
610 |
|
101774
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
611 if (c == '\t') |
|
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
612 continue; |
|
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
613 if (char_charset (c, charset_list, NULL)) |
|
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
614 { |
|
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
615 if (CHAR_WIDTH (c) == 0 |
|
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
616 && i > 0 && COMPOSITION_GLYPH (cmp, i - 1) == '\t') |
|
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
617 /* Should be left-padded */ |
|
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
618 { |
|
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
619 buf += CHAR_STRING (' ', buf); |
|
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
620 nchars++; |
|
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
621 } |
|
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
622 } |
|
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
623 else |
|
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
624 c = '?'; |
|
97830
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
625 buf += CHAR_STRING (c, buf); |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
626 nchars++; |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
627 } |
| 90638 | 628 } |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
629 /* We must skip glyphs to be padded for a wide character. */ |
| 90638 | 630 else if (! CHAR_GLYPH_PADDING_P (*src)) |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
631 { |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
632 GLYPH g; |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
633 int c; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
634 Lisp_Object string; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
635 |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
636 string = Qnil; |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
637 SET_GLYPH_FROM_CHAR_GLYPH (g, src[0]); |
|
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
638 |
|
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
639 if (GLYPH_INVALID_P (g) || GLYPH_SIMPLE_P (tbase, tlen, g)) |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
640 { |
|
98367
758774f72111
(encode_terminal_code): Fix a typo in a comment.
Eli Zaretskii <eliz@gnu.org>
parents:
98155
diff
changeset
|
641 /* This glyph doesn't have an entry in Vglyph_table. */ |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
642 c = src->u.ch; |
|
26871
aaf45e665b14
(encode_terminal_code): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents:
26425
diff
changeset
|
643 } |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
644 else |
| 19035 | 645 { |
|
26999
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
646 /* This glyph has an entry in Vglyph_table, |
|
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
647 so process any alias before testing for simpleness. */ |
|
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
648 GLYPH_FOLLOW_ALIASES (tbase, tlen, g); |
|
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
649 |
|
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
650 if (GLYPH_SIMPLE_P (tbase, tlen, g)) |
|
89563
d193de460ec1
(terminal_encode_buffer, terminal_encode_buf_size): New
Kenichi Handa <handa@m17n.org>
parents:
89483
diff
changeset
|
651 /* We set the multi-byte form of a character in G |
|
d193de460ec1
(terminal_encode_buffer, terminal_encode_buf_size): New
Kenichi Handa <handa@m17n.org>
parents:
89483
diff
changeset
|
652 (that should be an ASCII character) at WORKBUF. */ |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
653 c = GLYPH_CHAR (g); |
|
26999
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
654 else |
|
89563
d193de460ec1
(terminal_encode_buffer, terminal_encode_buf_size): New
Kenichi Handa <handa@m17n.org>
parents:
89483
diff
changeset
|
655 /* We have a string in Vglyph_table. */ |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
656 string = tbase[GLYPH_CHAR (g)]; |
| 19035 | 657 } |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
658 |
|
89563
d193de460ec1
(terminal_encode_buffer, terminal_encode_buf_size): New
Kenichi Handa <handa@m17n.org>
parents:
89483
diff
changeset
|
659 if (NILP (string)) |
|
d193de460ec1
(terminal_encode_buffer, terminal_encode_buf_size): New
Kenichi Handa <handa@m17n.org>
parents:
89483
diff
changeset
|
660 { |
| 90638 | 661 nbytes = buf - encode_terminal_src; |
| 662 if (encode_terminal_src_size < nbytes + MAX_MULTIBYTE_LENGTH) | |
|
26999
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
663 { |
| 90638 | 664 encode_terminal_src_size = nbytes + MAX_MULTIBYTE_LENGTH; |
| 665 encode_terminal_src = xrealloc (encode_terminal_src, | |
| 666 encode_terminal_src_size); | |
| 667 buf = encode_terminal_src + nbytes; | |
| 668 } | |
|
110131
cca2a663ef92
Fix handling of 8-bit characters in a display table.
Kenichi Handa <handa@m17n.org>
parents:
110128
diff
changeset
|
669 if (CHAR_BYTE8_P (c) |
|
cca2a663ef92
Fix handling of 8-bit characters in a display table.
Kenichi Handa <handa@m17n.org>
parents:
110128
diff
changeset
|
670 || char_charset (c, charset_list, NULL)) |
|
26999
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
671 { |
|
89566
86c0ff434620
(encode_terminal_code): Don't handle glyph-table. Check
Kenichi Handa <handa@m17n.org>
parents:
89563
diff
changeset
|
672 /* Store the multibyte form of C at BUF. */ |
|
86c0ff434620
(encode_terminal_code): Don't handle glyph-table. Check
Kenichi Handa <handa@m17n.org>
parents:
89563
diff
changeset
|
673 buf += CHAR_STRING (c, buf); |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
674 nchars++; |
|
26999
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
675 } |
|
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
676 else |
|
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
677 { |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
678 /* C is not encodable. */ |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
679 *buf++ = '?'; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
680 nchars++; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
681 while (src + 1 < src_end && CHAR_GLYPH_PADDING_P (src[1])) |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
682 { |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
683 *buf++ = '?'; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
684 nchars++; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
685 src++; |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
686 } |
|
26999
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
687 } |
| 19035 | 688 } |
|
89563
d193de460ec1
(terminal_encode_buffer, terminal_encode_buf_size): New
Kenichi Handa <handa@m17n.org>
parents:
89483
diff
changeset
|
689 else |
|
23338
0a2b76b09162
(encode_terminal_code): Handle raw 8-bit codes correctly.
Kenichi Handa <handa@m17n.org>
parents:
23066
diff
changeset
|
690 { |
|
109559
4325622babca
Remove declarations and unused variables.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109516
diff
changeset
|
691 unsigned char *p = SDATA (string); |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
692 |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
693 if (! STRING_MULTIBYTE (string)) |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
694 string = string_to_multibyte (string); |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
695 nbytes = buf - encode_terminal_src; |
|
90072
cb67264d6096
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-2
Miles Bader <miles@gnu.org>
diff
changeset
|
696 if (encode_terminal_src_size < nbytes + SBYTES (string)) |
|
89563
d193de460ec1
(terminal_encode_buffer, terminal_encode_buf_size): New
Kenichi Handa <handa@m17n.org>
parents:
89483
diff
changeset
|
697 { |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
698 encode_terminal_src_size = nbytes + SBYTES (string); |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
699 encode_terminal_src = xrealloc (encode_terminal_src, |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
700 encode_terminal_src_size); |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
701 buf = encode_terminal_src + nbytes; |
|
89563
d193de460ec1
(terminal_encode_buffer, terminal_encode_buf_size): New
Kenichi Handa <handa@m17n.org>
parents:
89483
diff
changeset
|
702 } |
|
109165
750db9f3e6d8
Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents:
109144
diff
changeset
|
703 memcpy (buf, SDATA (string), SBYTES (string)); |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
704 buf += SBYTES (string); |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
705 nchars += SCHARS (string); |
|
23338
0a2b76b09162
(encode_terminal_code): Handle raw 8-bit codes correctly.
Kenichi Handa <handa@m17n.org>
parents:
23066
diff
changeset
|
706 } |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
707 } |
|
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
708 src++; |
|
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
709 } |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
710 |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
711 if (nchars == 0) |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
712 { |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
713 coding->produced = 0; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
714 return NULL; |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
715 } |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
716 |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
717 nbytes = buf - encode_terminal_src; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
718 coding->source = encode_terminal_src; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
719 if (encode_terminal_dst_size == 0) |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
720 { |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
721 encode_terminal_dst_size = encode_terminal_src_size; |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
722 if (encode_terminal_dst) |
|
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
723 encode_terminal_dst = xrealloc (encode_terminal_dst, |
|
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
724 encode_terminal_dst_size); |
|
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
725 else |
|
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
726 encode_terminal_dst = xmalloc (encode_terminal_dst_size); |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
727 } |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
728 coding->destination = encode_terminal_dst; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
729 coding->dst_bytes = encode_terminal_dst_size; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
730 encode_coding_object (coding, Qnil, 0, 0, nchars, nbytes, Qnil); |
|
89566
86c0ff434620
(encode_terminal_code): Don't handle glyph-table. Check
Kenichi Handa <handa@m17n.org>
parents:
89563
diff
changeset
|
731 /* coding->destination may have been reallocated. */ |
|
90059
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
732 encode_terminal_dst = coding->destination; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
733 encode_terminal_dst_size = coding->dst_bytes; |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
734 |
|
9b0bfaaaec9c
Sync to the change in HEAD on 2004-11-30.
Kenichi Handa <handa@m17n.org>
parents:
90054
diff
changeset
|
735 return (encode_terminal_dst); |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
736 } |
|
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
737 |
| 253 | 738 |
| 91041 | 739 |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
740 /* An implementation of write_glyphs for termcap frames. */ |
|
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
741 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
742 static void |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
743 tty_write_glyphs (struct frame *f, struct glyph *string, int len) |
| 253 | 744 { |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
745 unsigned char *conversion_buffer; |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
746 struct coding_system *coding; |
| 253 | 747 |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
748 struct tty_display_info *tty = FRAME_TTY (f); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
749 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
750 tty_turn_off_insert (tty); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
751 tty_hide_cursor (tty); |
| 253 | 752 |
| 25002 | 753 /* Don't dare write in last column of bottom line, if Auto-Wrap, |
| 765 | 754 since that would scroll the whole frame on some terminals. */ |
| 253 | 755 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
756 if (AutoWrap (tty) |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
757 && curY (tty) + 1 == FRAME_LINES (f) |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
758 && (curX (tty) + len) == FRAME_COLS (f)) |
| 253 | 759 len --; |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
760 if (len <= 0) |
|
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
761 return; |
| 253 | 762 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
763 cmplus (tty, len); |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
764 |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
765 /* If terminal_coding does any conversion, use it, otherwise use |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
766 safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
767 because it always return 1 if the member src_multibyte is 1. */ |
| 83231 | 768 coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK |
| 769 ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding); | |
|
20711
9ab8e061c0bf
(encode_terminal_code): Adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
20223
diff
changeset
|
770 /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at |
|
9ab8e061c0bf
(encode_terminal_code): Adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
20223
diff
changeset
|
771 the tail. */ |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
772 coding->mode &= ~CODING_MODE_LAST_BLOCK; |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
773 |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
774 while (len > 0) |
| 253 | 775 { |
| 25002 | 776 /* Identify a run of glyphs with the same face. */ |
|
26999
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
777 int face_id = string->face_id; |
| 25002 | 778 int n; |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
779 |
| 25002 | 780 for (n = 1; n < len; ++n) |
|
26999
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
781 if (string[n].face_id != face_id) |
| 25002 | 782 break; |
| 783 | |
| 784 /* Turn appearance modes of the face of the run on. */ | |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
785 tty_highlight_if_desired (tty); |
| 25002 | 786 turn_on_face (f, face_id); |
| 787 | |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
788 if (n == len) |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
789 /* This is the last run. */ |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
790 coding->mode |= CODING_MODE_LAST_BLOCK; |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
791 conversion_buffer = encode_terminal_code (string, n, coding); |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
792 if (coding->produced > 0) |
| 253 | 793 { |
|
76627
c53e7d075f1a
Include blockinput.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
75348
diff
changeset
|
794 BLOCK_INPUT; |
| 83231 | 795 fwrite (conversion_buffer, 1, coding->produced, tty->output); |
| 796 if (ferror (tty->output)) | |
| 797 clearerr (tty->output); | |
| 798 if (tty->termscript) | |
| 799 fwrite (conversion_buffer, 1, coding->produced, tty->termscript); | |
|
76627
c53e7d075f1a
Include blockinput.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
75348
diff
changeset
|
800 UNBLOCK_INPUT; |
| 253 | 801 } |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
802 len -= n; |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
803 string += n; |
| 25002 | 804 |
| 805 /* Turn appearance modes off. */ | |
| 806 turn_off_face (f, face_id); | |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
807 tty_turn_off_highlight (tty); |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
808 } |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
809 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
810 cmcheckmagic (tty); |
| 253 | 811 } |
| 812 | |
|
84981
a35153116cd0
(term_clear_mouse_face, term_mouse_highlight)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84969
diff
changeset
|
813 #ifdef HAVE_GPM /* Only used by GPM code. */ |
|
a35153116cd0
(term_clear_mouse_face, term_mouse_highlight)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84969
diff
changeset
|
814 |
| 83622 | 815 static void |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
816 tty_write_glyphs_with_face (register struct frame *f, register struct glyph *string, |
|
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
817 register int len, register int face_id) |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
818 { |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
819 unsigned char *conversion_buffer; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
820 struct coding_system *coding; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
821 |
| 83622 | 822 struct tty_display_info *tty = FRAME_TTY (f); |
| 823 | |
| 824 tty_turn_off_insert (tty); | |
| 825 tty_hide_cursor (tty); | |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
826 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
827 /* Don't dare write in last column of bottom line, if Auto-Wrap, |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
828 since that would scroll the whole frame on some terminals. */ |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
829 |
| 83622 | 830 if (AutoWrap (tty) |
| 831 && curY (tty) + 1 == FRAME_LINES (f) | |
| 832 && (curX (tty) + len) == FRAME_COLS (f)) | |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
833 len --; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
834 if (len <= 0) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
835 return; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
836 |
| 83622 | 837 cmplus (tty, len); |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
838 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
839 /* If terminal_coding does any conversion, use it, otherwise use |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
840 safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
841 because it always return 1 if the member src_multibyte is 1. */ |
| 83622 | 842 coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK |
| 843 ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding); | |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
844 /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
845 the tail. */ |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
846 coding->mode &= ~CODING_MODE_LAST_BLOCK; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
847 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
848 /* Turn appearance modes of the face. */ |
| 83622 | 849 tty_highlight_if_desired (tty); |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
850 turn_on_face (f, face_id); |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
851 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
852 coding->mode |= CODING_MODE_LAST_BLOCK; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
853 conversion_buffer = encode_terminal_code (string, len, coding); |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
854 if (coding->produced > 0) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
855 { |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
856 BLOCK_INPUT; |
| 83622 | 857 fwrite (conversion_buffer, 1, coding->produced, tty->output); |
| 858 if (ferror (tty->output)) | |
| 859 clearerr (tty->output); | |
| 860 if (tty->termscript) | |
| 861 fwrite (conversion_buffer, 1, coding->produced, tty->termscript); | |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
862 UNBLOCK_INPUT; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
863 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
864 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
865 /* Turn appearance modes off. */ |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
866 turn_off_face (f, face_id); |
| 83622 | 867 tty_turn_off_highlight (tty); |
| 868 | |
| 869 cmcheckmagic (tty); | |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
870 } |
|
84981
a35153116cd0
(term_clear_mouse_face, term_mouse_highlight)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84969
diff
changeset
|
871 #endif |
| 83622 | 872 |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
873 /* An implementation of insert_glyphs for termcap frames. */ |
|
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
874 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
875 static void |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
876 tty_insert_glyphs (struct frame *f, struct glyph *start, int len) |
| 253 | 877 { |
| 878 char *buf; | |
|
31829
43566b0aec59
Avoid some more compiler warnings.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
879 struct glyph *glyph = NULL; |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
880 unsigned char *conversion_buffer; |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
881 unsigned char space[1]; |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
882 struct coding_system *coding; |
| 253 | 883 |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
884 struct tty_display_info *tty = FRAME_TTY (f); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
885 |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
886 if (tty->TS_ins_multi_chars) |
| 253 | 887 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
888 buf = tparam (tty->TS_ins_multi_chars, 0, 0, len); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
889 OUTPUT1 (tty, buf); |
|
2439
b6c62e4abf59
Put interrupt input blocking in a separate file from xterm.h.
Jim Blandy <jimb@redhat.com>
parents:
2243
diff
changeset
|
890 xfree (buf); |
| 253 | 891 if (start) |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
892 write_glyphs (f, start, len); |
| 253 | 893 return; |
| 894 } | |
| 25002 | 895 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
896 tty_turn_on_insert (tty); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
897 cmplus (tty, len); |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
898 |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
899 if (! start) |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
900 space[0] = SPACEGLYPH; |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
901 |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
902 /* If terminal_coding does any conversion, use it, otherwise use |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
903 safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
904 because it always return 1 if the member src_multibyte is 1. */ |
| 83231 | 905 coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK |
| 906 ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding); | |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
907 /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
908 the tail. */ |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
909 coding->mode &= ~CODING_MODE_LAST_BLOCK; |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
910 |
|
17191
36caec9c2e52
(insert_glyphs): Fix a bug which turns up when
Kenichi Handa <handa@m17n.org>
parents:
17180
diff
changeset
|
911 while (len-- > 0) |
| 253 | 912 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
913 OUTPUT1_IF (tty, tty->TS_ins_char); |
| 253 | 914 if (!start) |
|
26999
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
915 { |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
916 conversion_buffer = space; |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
917 coding->produced = 1; |
|
26999
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
918 } |
| 253 | 919 else |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
920 { |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
921 tty_highlight_if_desired (tty); |
|
26999
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
922 turn_on_face (f, start->face_id); |
|
27085
59913a531d4e
(insert_glyphs): Pass glyph, not &glyph, to
Eli Zaretskii <eliz@gnu.org>
parents:
26999
diff
changeset
|
923 glyph = start; |
| 25002 | 924 ++start; |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
925 /* We must open sufficient space for a character which |
|
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
926 occupies more than one column. */ |
| 25002 | 927 while (len && CHAR_GLYPH_PADDING_P (*start)) |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
928 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
929 OUTPUT1_IF (tty, tty->TS_ins_char); |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
930 start++, len--; |
|
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
931 } |
|
26999
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
932 |
|
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
933 if (len <= 0) |
|
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
934 /* This is the last glyph. */ |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
935 coding->mode |= CODING_MODE_LAST_BLOCK; |
|
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
936 |
| 83231 | 937 conversion_buffer = encode_terminal_code (glyph, 1, coding); |
|
17046
84b0e9794a87
Include charset.h and coding.h.
Karl Heuer <kwzh@gnu.org>
parents:
16894
diff
changeset
|
938 } |
| 253 | 939 |
|
58638
67bea14002c3
(encode_terminal_buf, encode_terminal_bufsize): New
Kenichi Handa <handa@m17n.org>
parents:
54428
diff
changeset
|
940 if (coding->produced > 0) |
| 253 | 941 { |
|
76627
c53e7d075f1a
Include blockinput.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
75348
diff
changeset
|
942 BLOCK_INPUT; |
| 83231 | 943 fwrite (conversion_buffer, 1, coding->produced, tty->output); |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
944 if (ferror (tty->output)) |
|
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
945 clearerr (tty->output); |
|
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
946 if (tty->termscript) |
| 83231 | 947 fwrite (conversion_buffer, 1, coding->produced, tty->termscript); |
|
76627
c53e7d075f1a
Include blockinput.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
75348
diff
changeset
|
948 UNBLOCK_INPUT; |
| 253 | 949 } |
| 950 | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
951 OUTPUT1_IF (tty, tty->TS_pad_inserted_char); |
|
26999
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
952 if (start) |
|
30848
fc80dcfc32cd
(write_glyphs): Also turn off inverse video after turning
Gerd Moellmann <gerd@gnu.org>
parents:
30836
diff
changeset
|
953 { |
|
fc80dcfc32cd
(write_glyphs): Also turn off inverse video after turning
Gerd Moellmann <gerd@gnu.org>
parents:
30836
diff
changeset
|
954 turn_off_face (f, glyph->face_id); |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
955 tty_turn_off_highlight (tty); |
|
30848
fc80dcfc32cd
(write_glyphs): Also turn off inverse video after turning
Gerd Moellmann <gerd@gnu.org>
parents:
30836
diff
changeset
|
956 } |
|
10439
1fcbeb4410f6
(write_glyphs, insert_glyphs): Call checkmagic.
Karl Heuer <kwzh@gnu.org>
parents:
10332
diff
changeset
|
957 } |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
958 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
959 cmcheckmagic (tty); |
| 253 | 960 } |
| 961 | |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
962 /* An implementation of delete_glyphs for termcap frames. */ |
|
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
963 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
964 static void |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
965 tty_delete_glyphs (struct frame *f, int n) |
| 253 | 966 { |
| 967 char *buf; | |
| 968 register int i; | |
| 969 | |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
970 struct tty_display_info *tty = FRAME_TTY (f); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
971 |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
972 if (tty->delete_in_insert_mode) |
| 253 | 973 { |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
974 tty_turn_on_insert (tty); |
| 253 | 975 } |
| 976 else | |
| 977 { | |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
978 tty_turn_off_insert (tty); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
979 OUTPUT_IF (tty, tty->TS_delete_mode); |
| 253 | 980 } |
| 981 | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
982 if (tty->TS_del_multi_chars) |
| 253 | 983 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
984 buf = tparam (tty->TS_del_multi_chars, 0, 0, n); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
985 OUTPUT1 (tty, buf); |
|
2439
b6c62e4abf59
Put interrupt input blocking in a separate file from xterm.h.
Jim Blandy <jimb@redhat.com>
parents:
2243
diff
changeset
|
986 xfree (buf); |
| 253 | 987 } |
| 988 else | |
| 989 for (i = 0; i < n; i++) | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
990 OUTPUT1 (tty, tty->TS_del_char); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
991 if (!tty->delete_in_insert_mode) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
992 OUTPUT_IF (tty, tty->TS_end_delete_mode); |
| 253 | 993 } |
| 994 | |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
995 /* An implementation of ins_del_lines for termcap frames. */ |
|
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
996 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
997 static void |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
998 tty_ins_del_lines (struct frame *f, int vpos, int n) |
| 253 | 999 { |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1000 struct tty_display_info *tty = FRAME_TTY (f); |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1001 char *multi = n > 0 ? tty->TS_ins_multi_lines : tty->TS_del_multi_lines; |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1002 char *single = n > 0 ? tty->TS_ins_line : tty->TS_del_line; |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1003 char *scroll = n > 0 ? tty->TS_rev_scroll : tty->TS_fwd_scroll; |
| 253 | 1004 |
| 1005 register int i = n > 0 ? n : -n; | |
| 1006 register char *buf; | |
| 1007 | |
| 1008 /* If the lines below the insertion are being pushed | |
| 1009 into the end of the window, this is the same as clearing; | |
| 1010 and we know the lines are already clear, since the matching | |
| 1011 deletion has already been done. So can ignore this. */ | |
| 1012 /* If the lines below the deletion are blank lines coming | |
| 1013 out of the end of the window, don't bother, | |
| 1014 as there will be a matching inslines later that will flush them. */ | |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1015 if (FRAME_SCROLL_REGION_OK (f) |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1016 && vpos + i >= tty->specified_window) |
| 253 | 1017 return; |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1018 if (!FRAME_MEMORY_BELOW_FRAME (f) |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1019 && vpos + i >= FRAME_LINES (f)) |
| 253 | 1020 return; |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
1021 |
| 253 | 1022 if (multi) |
| 1023 { | |
|
83102
a330cf2446ad
Fix segfault in term.c (reported by lukhas@free.fr).
Karoly Lorentey <lorentey@elte.hu>
parents:
83100
diff
changeset
|
1024 raw_cursor_to (f, vpos, 0); |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
1025 tty_background_highlight (tty); |
| 253 | 1026 buf = tparam (multi, 0, 0, i); |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1027 OUTPUT (tty, buf); |
|
2439
b6c62e4abf59
Put interrupt input blocking in a separate file from xterm.h.
Jim Blandy <jimb@redhat.com>
parents:
2243
diff
changeset
|
1028 xfree (buf); |
| 253 | 1029 } |
| 1030 else if (single) | |
| 1031 { | |
|
83102
a330cf2446ad
Fix segfault in term.c (reported by lukhas@free.fr).
Karoly Lorentey <lorentey@elte.hu>
parents:
83100
diff
changeset
|
1032 raw_cursor_to (f, vpos, 0); |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
1033 tty_background_highlight (tty); |
| 253 | 1034 while (--i >= 0) |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1035 OUTPUT (tty, single); |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1036 if (tty->TF_teleray) |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1037 curX (tty) = 0; |
| 253 | 1038 } |
| 1039 else | |
| 1040 { | |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
1041 tty_set_scroll_region (f, vpos, tty->specified_window); |
| 253 | 1042 if (n < 0) |
|
83102
a330cf2446ad
Fix segfault in term.c (reported by lukhas@free.fr).
Karoly Lorentey <lorentey@elte.hu>
parents:
83100
diff
changeset
|
1043 raw_cursor_to (f, tty->specified_window - 1, 0); |
| 253 | 1044 else |
|
83102
a330cf2446ad
Fix segfault in term.c (reported by lukhas@free.fr).
Karoly Lorentey <lorentey@elte.hu>
parents:
83100
diff
changeset
|
1045 raw_cursor_to (f, vpos, 0); |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
1046 tty_background_highlight (tty); |
| 253 | 1047 while (--i >= 0) |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1048 OUTPUTL (tty, scroll, tty->specified_window - vpos); |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
1049 tty_set_scroll_region (f, 0, tty->specified_window); |
| 253 | 1050 } |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
1051 |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1052 if (!FRAME_SCROLL_REGION_OK (f) |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1053 && FRAME_MEMORY_BELOW_FRAME (f) |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1054 && n < 0) |
| 253 | 1055 { |
|
83100
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
1056 cursor_to (f, FRAME_LINES (f) + n, 0); |
|
4970ad4995f5
Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents:
83095
diff
changeset
|
1057 clear_to_end (f); |
| 253 | 1058 } |
| 1059 } | |
| 1060 | |
| 1061 /* Compute cost of sending "str", in characters, | |
| 1062 not counting any line-dependent padding. */ | |
| 1063 | |
| 1064 int | |
|
109726
64732fa6188a
Use const char* instead of char*.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109664
diff
changeset
|
1065 string_cost (const char *str) |
| 253 | 1066 { |
| 1067 cost = 0; | |
| 1068 if (str) | |
| 1069 tputs (str, 0, evalcost); | |
| 1070 return cost; | |
| 1071 } | |
| 1072 | |
| 1073 /* Compute cost of sending "str", in characters, | |
| 1074 counting any line-dependent padding at one line. */ | |
| 1075 | |
| 1076 static int | |
|
109726
64732fa6188a
Use const char* instead of char*.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109664
diff
changeset
|
1077 string_cost_one_line (const char *str) |
| 253 | 1078 { |
| 1079 cost = 0; | |
| 1080 if (str) | |
| 1081 tputs (str, 1, evalcost); | |
| 1082 return cost; | |
| 1083 } | |
| 1084 | |
| 1085 /* Compute per line amount of line-dependent padding, | |
| 1086 in tenths of characters. */ | |
| 1087 | |
| 1088 int | |
|
109726
64732fa6188a
Use const char* instead of char*.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109664
diff
changeset
|
1089 per_line_cost (const char *str) |
| 253 | 1090 { |
| 1091 cost = 0; | |
| 1092 if (str) | |
| 1093 tputs (str, 0, evalcost); | |
| 1094 cost = - cost; | |
| 1095 if (str) | |
| 1096 tputs (str, 10, evalcost); | |
| 1097 return cost; | |
| 1098 } | |
| 1099 | |
| 1100 /* char_ins_del_cost[n] is cost of inserting N characters. | |
|
10771
d564078d10c6
(calculate_costs): Update max_frame_height, max_frame_width.
Richard M. Stallman <rms@gnu.org>
parents:
10481
diff
changeset
|
1101 char_ins_del_cost[-n] is cost of deleting N characters. |
|
51212
332134065648
Make (some) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
50227
diff
changeset
|
1102 The length of this vector is based on max_frame_cols. */ |
| 253 | 1103 |
| 1104 int *char_ins_del_vector; | |
| 1105 | |
|
51212
332134065648
Make (some) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
50227
diff
changeset
|
1106 #define char_ins_del_cost(f) (&char_ins_del_vector[FRAME_COLS ((f))]) |
| 253 | 1107 |
| 1108 /* ARGSUSED */ | |
| 1109 static void | |
|
83102
a330cf2446ad
Fix segfault in term.c (reported by lukhas@free.fr).
Karoly Lorentey <lorentey@elte.hu>
parents:
83100
diff
changeset
|
1110 calculate_ins_del_char_costs (struct frame *f) |
| 253 | 1111 { |
|
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
82988
diff
changeset
|
1112 struct tty_display_info *tty = FRAME_TTY (f); |
| 253 | 1113 int ins_startup_cost, del_startup_cost; |
| 1114 int ins_cost_per_char, del_cost_per_char; | |
| 1115 register int i; | |
| 1116 register int *p; | |
| 1117 | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1118 if (tty->TS_ins_multi_chars) |
| 253 | 1119 { |
| 1120 ins_cost_per_char = 0; | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1121 ins_startup_cost = string_cost_one_line (tty->TS_ins_multi_chars); |
| 253 | 1122 } |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1123 else if (tty->TS_ins_char || tty->TS_pad_inserted_char |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1124 || (tty->TS_insert_mode && tty->TS_end_insert_mode)) |
| 253 | 1125 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1126 ins_startup_cost = (30 * (string_cost (tty->TS_insert_mode) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1127 + string_cost (tty->TS_end_insert_mode))) / 100; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1128 ins_cost_per_char = (string_cost_one_line (tty->TS_ins_char) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1129 + string_cost_one_line (tty->TS_pad_inserted_char)); |
| 253 | 1130 } |
| 1131 else | |
| 1132 { | |
| 1133 ins_startup_cost = 9999; | |
| 1134 ins_cost_per_char = 0; | |
| 1135 } | |
| 1136 | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1137 if (tty->TS_del_multi_chars) |
| 253 | 1138 { |
| 1139 del_cost_per_char = 0; | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1140 del_startup_cost = string_cost_one_line (tty->TS_del_multi_chars); |
| 253 | 1141 } |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1142 else if (tty->TS_del_char) |
| 253 | 1143 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1144 del_startup_cost = (string_cost (tty->TS_delete_mode) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1145 + string_cost (tty->TS_end_delete_mode)); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1146 if (tty->delete_in_insert_mode) |
| 253 | 1147 del_startup_cost /= 2; |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1148 del_cost_per_char = string_cost_one_line (tty->TS_del_char); |
| 253 | 1149 } |
| 1150 else | |
| 1151 { | |
| 1152 del_startup_cost = 9999; | |
| 1153 del_cost_per_char = 0; | |
| 1154 } | |
| 1155 | |
| 1156 /* Delete costs are at negative offsets */ | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1157 p = &char_ins_del_cost (f)[0]; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1158 for (i = FRAME_COLS (f); --i >= 0;) |
| 253 | 1159 *--p = (del_startup_cost += del_cost_per_char); |
| 1160 | |
| 1161 /* Doing nothing is free */ | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1162 p = &char_ins_del_cost (f)[0]; |
| 253 | 1163 *p++ = 0; |
| 1164 | |
| 1165 /* Insert costs are at positive offsets */ | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
1166 for (i = FRAME_COLS (f); --i >= 0;) |
| 253 | 1167 *p++ = (ins_startup_cost += ins_cost_per_char); |
| 1168 } | |
| 1169 | |
| 21514 | 1170 void |
|
83102
a330cf2446ad
Fix segfault in term.c (reported by lukhas@free.fr).
Karoly Lorentey <lorentey@elte.hu>
parents:
83100
diff
changeset
|
1171 calculate_costs (struct frame *frame) |
| 253 | 1172 { |
|
10121
3f9f77a9488d
(calculate_costs): Set FRAME_COST_BAUD_RATE.
Richard M. Stallman <rms@gnu.org>
parents:
9797
diff
changeset
|
1173 FRAME_COST_BAUD_RATE (frame) = baud_rate; |
| 253 | 1174 |
|
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
1175 if (FRAME_TERMCAP_P (frame)) |
|
82990
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1176 { |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1177 struct tty_display_info *tty = FRAME_TTY (frame); |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1178 register char *f = (tty->TS_set_scroll_region |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1179 ? tty->TS_set_scroll_region |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1180 : tty->TS_set_scroll_region_1); |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1181 |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1182 FRAME_SCROLL_REGION_COST (frame) = string_cost (f); |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1183 |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1184 tty->costs_set = 1; |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1185 |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1186 /* These variables are only used for terminal stuff. They are |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1187 allocated once for the terminal frame of X-windows emacs, but not |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1188 used afterwards. |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1189 |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1190 char_ins_del_vector (i.e., char_ins_del_cost) isn't used because |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1191 X turns off char_ins_del_ok. */ |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1192 |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1193 max_frame_lines = max (max_frame_lines, FRAME_LINES (frame)); |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1194 max_frame_cols = max (max_frame_cols, FRAME_COLS (frame)); |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1195 |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1196 if (char_ins_del_vector != 0) |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1197 char_ins_del_vector |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1198 = (int *) xrealloc (char_ins_del_vector, |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1199 (sizeof (int) |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1200 + 2 * max_frame_cols * sizeof (int))); |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1201 else |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1202 char_ins_del_vector |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1203 = (int *) xmalloc (sizeof (int) |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1204 + 2 * max_frame_cols * sizeof (int)); |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1205 |
|
109165
750db9f3e6d8
Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents:
109144
diff
changeset
|
1206 memset (char_ins_del_vector, 0, |
|
750db9f3e6d8
Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents:
109144
diff
changeset
|
1207 (sizeof (int) + 2 * max_frame_cols * sizeof (int))); |
|
82990
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1208 |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1209 |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1210 if (f && (!tty->TS_ins_line && !tty->TS_del_line)) |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1211 do_line_insertion_deletion_costs (frame, |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1212 tty->TS_rev_scroll, tty->TS_ins_multi_lines, |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1213 tty->TS_fwd_scroll, tty->TS_del_multi_lines, |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1214 f, f, 1); |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1215 else |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1216 do_line_insertion_deletion_costs (frame, |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1217 tty->TS_ins_line, tty->TS_ins_multi_lines, |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1218 tty->TS_del_line, tty->TS_del_multi_lines, |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1219 0, 0, 1); |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1220 |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1221 calculate_ins_del_char_costs (frame); |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1222 |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1223 /* Don't use TS_repeat if its padding is worse than sending the chars */ |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1224 if (tty->TS_repeat && per_line_cost (tty->TS_repeat) * baud_rate < 9000) |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1225 tty->RPov = string_cost (tty->TS_repeat); |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1226 else |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1227 tty->RPov = FRAME_COLS (frame) * 2; |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1228 |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1229 cmcostinit (FRAME_TTY (frame)); /* set up cursor motion costs */ |
|
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
1230 } |
| 253 | 1231 } |
| 1232 | |
|
1015
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1233 struct fkey_table { |
|
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1234 char *cap, *name; |
|
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1235 }; |
|
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1236 |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1237 /* Termcap capability names that correspond directly to X keysyms. |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1238 Some of these (marked "terminfo") aren't supplied by old-style |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1239 (Berkeley) termcap entries. They're listed in X keysym order; |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1240 except we put the keypad keys first, so that if they clash with |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1241 other keys (as on the IBM PC keyboard) they get overridden. |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1242 */ |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1243 |
|
109664
b6bdd59e60ff
Use const for some arrays and functions.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109653
diff
changeset
|
1244 static const struct fkey_table keys[] = |
| 25002 | 1245 { |
|
42122
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1246 {"kh", "home"}, /* termcap */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1247 {"kl", "left"}, /* termcap */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1248 {"ku", "up"}, /* termcap */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1249 {"kr", "right"}, /* termcap */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1250 {"kd", "down"}, /* termcap */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1251 {"%8", "prior"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1252 {"%5", "next"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1253 {"@7", "end"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1254 {"@1", "begin"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1255 {"*6", "select"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1256 {"%9", "print"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1257 {"@4", "execute"}, /* terminfo --- actually the `command' key */ |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1258 /* |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1259 * "insert" --- see below |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1260 */ |
|
42122
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1261 {"&8", "undo"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1262 {"%0", "redo"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1263 {"%7", "menu"}, /* terminfo --- actually the `options' key */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1264 {"@0", "find"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1265 {"@2", "cancel"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1266 {"%1", "help"}, /* terminfo */ |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1267 /* |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1268 * "break" goes here, but can't be reliably intercepted with termcap |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1269 */ |
|
42122
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1270 {"&4", "reset"}, /* terminfo --- actually `restart' */ |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1271 /* |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1272 * "system" and "user" --- no termcaps |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1273 */ |
|
42122
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1274 {"kE", "clearline"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1275 {"kA", "insertline"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1276 {"kL", "deleteline"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1277 {"kI", "insertchar"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1278 {"kD", "deletechar"}, /* terminfo */ |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1279 {"kB", "backtab"}, /* terminfo */ |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1280 /* |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1281 * "kp_backtab", "kp-space", "kp-tab" --- no termcaps |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1282 */ |
|
42122
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1283 {"@8", "kp-enter"}, /* terminfo */ |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1284 /* |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1285 * "kp-f1", "kp-f2", "kp-f3" "kp-f4", |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1286 * "kp-multiply", "kp-add", "kp-separator", |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1287 * "kp-subtract", "kp-decimal", "kp-divide", "kp-0"; |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1288 * --- no termcaps for any of these. |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1289 */ |
|
42122
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1290 {"K4", "kp-1"}, /* terminfo */ |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1291 /* |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1292 * "kp-2" --- no termcap |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1293 */ |
|
42122
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1294 {"K5", "kp-3"}, /* terminfo */ |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1295 /* |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1296 * "kp-4" --- no termcap |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1297 */ |
|
42122
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1298 {"K2", "kp-5"}, /* terminfo */ |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1299 /* |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1300 * "kp-6" --- no termcap |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1301 */ |
|
42122
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1302 {"K1", "kp-7"}, /* terminfo */ |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1303 /* |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1304 * "kp-8" --- no termcap |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1305 */ |
|
42122
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1306 {"K3", "kp-9"}, /* terminfo */ |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1307 /* |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1308 * "kp-equal" --- no termcap |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1309 */ |
|
42122
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1310 {"k1", "f1"}, |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1311 {"k2", "f2"}, |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1312 {"k3", "f3"}, |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1313 {"k4", "f4"}, |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1314 {"k5", "f5"}, |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1315 {"k6", "f6"}, |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1316 {"k7", "f7"}, |
|
706558f91b28
(keys): Add missing braces around initializer.
Pavel Jan?k <Pavel@Janik.cz>
parents:
40086
diff
changeset
|
1317 {"k8", "f8"}, |
|
61591
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1318 {"k9", "f9"}, |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1319 |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1320 {"&0", "S-cancel"}, /*shifted cancel key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1321 {"&9", "S-begin"}, /*shifted begin key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1322 {"*0", "S-find"}, /*shifted find key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1323 {"*1", "S-execute"}, /*shifted execute? actually shifted command key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1324 {"*4", "S-delete"}, /*shifted delete-character key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1325 {"*7", "S-end"}, /*shifted end key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1326 {"*8", "S-clearline"}, /*shifted clear-to end-of-line key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1327 {"#1", "S-help"}, /*shifted help key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1328 {"#2", "S-home"}, /*shifted home key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1329 {"#3", "S-insert"}, /*shifted insert-character key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1330 {"#4", "S-left"}, /*shifted left-arrow key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1331 {"%d", "S-menu"}, /*shifted menu? actually shifted options key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1332 {"%c", "S-next"}, /*shifted next key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1333 {"%e", "S-prior"}, /*shifted previous key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1334 {"%f", "S-print"}, /*shifted print key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1335 {"%g", "S-redo"}, /*shifted redo key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1336 {"%i", "S-right"}, /*shifted right-arrow key*/ |
|
b015e12637bc
(struct keys): Add support for shifted keys.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
59382
diff
changeset
|
1337 {"!3", "S-undo"} /*shifted undo key*/ |
|
1015
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1338 }; |
|
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1339 |
|
109516
68ca98ae70fb
Make building under stricter warning flags somewhat cleaner.
Juanma Barranquero <lekktu@gmail.com>
parents:
109376
diff
changeset
|
1340 #ifndef DOS_NT |
|
83317
e235da12dd03
Make sure the terminfo function key sequences are set up in the correct function-key-map.
Karoly Lorentey <lorentey@elte.hu>
parents:
83315
diff
changeset
|
1341 static char **term_get_fkeys_address; |
|
e235da12dd03
Make sure the terminfo function key sequences are set up in the correct function-key-map.
Karoly Lorentey <lorentey@elte.hu>
parents:
83315
diff
changeset
|
1342 static KBOARD *term_get_fkeys_kboard; |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
1343 static Lisp_Object term_get_fkeys_1 (void); |
|
4543
929e4c850e76
(term_get_fkeys_define_1, term_get_fkeys_define): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
4499
diff
changeset
|
1344 |
|
85106
fd282fb888de
Add new `input-decode-map' keymap and use it for temrinal
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84981
diff
changeset
|
1345 /* Find the escape codes sent by the function keys for Vinput_decode_map. |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
1346 This function scans the termcap function key sequence entries, and |
|
85106
fd282fb888de
Add new `input-decode-map' keymap and use it for temrinal
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84981
diff
changeset
|
1347 adds entries to Vinput_decode_map for each function key it finds. */ |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1348 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
1349 static void |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
1350 term_get_fkeys (char **address, KBOARD *kboard) |
| 533 | 1351 { |
|
6248
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1352 /* We run the body of the function (term_get_fkeys_1) and ignore all Lisp |
|
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1353 errors during the call. The only errors should be from Fdefine_key |
|
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1354 when given a key sequence containing an invalid prefix key. If the |
|
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1355 termcap defines function keys which use a prefix that is already bound |
|
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1356 to a command by the default bindings, we should silently ignore that |
|
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1357 function key specification, rather than giving the user an error and |
|
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1358 refusing to run at all on such a terminal. */ |
|
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1359 |
|
83317
e235da12dd03
Make sure the terminfo function key sequences are set up in the correct function-key-map.
Karoly Lorentey <lorentey@elte.hu>
parents:
83315
diff
changeset
|
1360 term_get_fkeys_address = address; |
|
e235da12dd03
Make sure the terminfo function key sequences are set up in the correct function-key-map.
Karoly Lorentey <lorentey@elte.hu>
parents:
83315
diff
changeset
|
1361 term_get_fkeys_kboard = kboard; |
|
6248
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1362 internal_condition_case (term_get_fkeys_1, Qerror, Fidentity); |
|
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1363 } |
|
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1364 |
|
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1365 static Lisp_Object |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
1366 term_get_fkeys_1 (void) |
|
6248
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1367 { |
| 533 | 1368 int i; |
| 1369 | |
|
83317
e235da12dd03
Make sure the terminfo function key sequences are set up in the correct function-key-map.
Karoly Lorentey <lorentey@elte.hu>
parents:
83315
diff
changeset
|
1370 char **address = term_get_fkeys_address; |
|
e235da12dd03
Make sure the terminfo function key sequences are set up in the correct function-key-map.
Karoly Lorentey <lorentey@elte.hu>
parents:
83315
diff
changeset
|
1371 KBOARD *kboard = term_get_fkeys_kboard; |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
1372 |
|
3359
ef29e2a4fc46
(term_get_fkeys): If not initialized, init Vfunction_key_map.
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1373 /* This can happen if CANNOT_DUMP or with strange options. */ |
|
85106
fd282fb888de
Add new `input-decode-map' keymap and use it for temrinal
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84981
diff
changeset
|
1374 if (!KEYMAPP (kboard->Vinput_decode_map)) |
|
fd282fb888de
Add new `input-decode-map' keymap and use it for temrinal
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84981
diff
changeset
|
1375 kboard->Vinput_decode_map = Fmake_sparse_keymap (Qnil); |
|
3359
ef29e2a4fc46
(term_get_fkeys): If not initialized, init Vfunction_key_map.
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1376 |
| 533 | 1377 for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++) |
| 1378 { | |
| 1379 char *sequence = tgetstr (keys[i].cap, address); | |
| 1380 if (sequence) | |
|
85106
fd282fb888de
Add new `input-decode-map' keymap and use it for temrinal
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84981
diff
changeset
|
1381 Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), |
|
6248
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1382 Fmake_vector (make_number (1), |
|
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1383 intern (keys[i].name))); |
| 533 | 1384 } |
|
1015
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1385 |
|
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1386 /* The uses of the "k0" capability are inconsistent; sometimes it |
|
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1387 describes F10, whereas othertimes it describes F0 and "k;" describes F10. |
|
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3489
diff
changeset
|
1388 We will attempt to politely accommodate both systems by testing for |
|
1015
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1389 "k;", and if it is present, assuming that "k0" denotes F0, otherwise F10. |
|
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1390 */ |
|
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1391 { |
|
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1392 char *k_semi = tgetstr ("k;", address); |
|
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1393 char *k0 = tgetstr ("k0", address); |
|
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1394 char *k0_name = "f10"; |
|
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1395 |
|
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1396 if (k_semi) |
|
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1397 { |
|
43073
c9baf4b00820
(term_get_fkeys_1): If `k0' and `k;' are both specified and
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42959
diff
changeset
|
1398 if (k0) |
|
c9baf4b00820
(term_get_fkeys_1): If `k0' and `k;' are both specified and
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42959
diff
changeset
|
1399 /* Define f0 first, so that f10 takes precedence in case the |
|
c9baf4b00820
(term_get_fkeys_1): If `k0' and `k;' are both specified and
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42959
diff
changeset
|
1400 key sequences happens to be the same. */ |
|
85106
fd282fb888de
Add new `input-decode-map' keymap and use it for temrinal
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84981
diff
changeset
|
1401 Fdefine_key (kboard->Vinput_decode_map, build_string (k0), |
|
43073
c9baf4b00820
(term_get_fkeys_1): If `k0' and `k;' are both specified and
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42959
diff
changeset
|
1402 Fmake_vector (make_number (1), intern ("f0"))); |
|
85106
fd282fb888de
Add new `input-decode-map' keymap and use it for temrinal
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84981
diff
changeset
|
1403 Fdefine_key (kboard->Vinput_decode_map, build_string (k_semi), |
|
6248
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1404 Fmake_vector (make_number (1), intern ("f10"))); |
|
1015
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1405 } |
|
43073
c9baf4b00820
(term_get_fkeys_1): If `k0' and `k;' are both specified and
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
42959
diff
changeset
|
1406 else if (k0) |
|
85106
fd282fb888de
Add new `input-decode-map' keymap and use it for temrinal
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84981
diff
changeset
|
1407 Fdefine_key (kboard->Vinput_decode_map, build_string (k0), |
|
6248
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1408 Fmake_vector (make_number (1), intern (k0_name))); |
|
1015
58c373be762c
* term.c (term_get_fkeys): Some systems define `static' to be the
Jim Blandy <jimb@redhat.com>
parents:
969
diff
changeset
|
1409 } |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1410 |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1411 /* Set up cookies for numbered function keys above f10. */ |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1412 { |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1413 char fcap[3], fkey[4]; |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1414 |
|
3489
5c2b4797aab2
(term_get_fkeys): Use correct names for F10 and up.
Richard M. Stallman <rms@gnu.org>
parents:
3359
diff
changeset
|
1415 fcap[0] = 'F'; fcap[2] = '\0'; |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1416 for (i = 11; i < 64; i++) |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1417 { |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1418 if (i <= 19) |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1419 fcap[1] = '1' + i - 11; |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1420 else if (i <= 45) |
|
10481
24756aef26e3
(term_get_fkeys_1): Bug fix for function key above f19.
Richard M. Stallman <rms@gnu.org>
parents:
10439
diff
changeset
|
1421 fcap[1] = 'A' + i - 20; |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1422 else |
|
10481
24756aef26e3
(term_get_fkeys_1): Bug fix for function key above f19.
Richard M. Stallman <rms@gnu.org>
parents:
10439
diff
changeset
|
1423 fcap[1] = 'a' + i - 46; |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1424 |
|
3489
5c2b4797aab2
(term_get_fkeys): Use correct names for F10 and up.
Richard M. Stallman <rms@gnu.org>
parents:
3359
diff
changeset
|
1425 { |
|
5c2b4797aab2
(term_get_fkeys): Use correct names for F10 and up.
Richard M. Stallman <rms@gnu.org>
parents:
3359
diff
changeset
|
1426 char *sequence = tgetstr (fcap, address); |
|
5c2b4797aab2
(term_get_fkeys): Use correct names for F10 and up.
Richard M. Stallman <rms@gnu.org>
parents:
3359
diff
changeset
|
1427 if (sequence) |
|
5c2b4797aab2
(term_get_fkeys): Use correct names for F10 and up.
Richard M. Stallman <rms@gnu.org>
parents:
3359
diff
changeset
|
1428 { |
|
4543
929e4c850e76
(term_get_fkeys_define_1, term_get_fkeys_define): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
4499
diff
changeset
|
1429 sprintf (fkey, "f%d", i); |
|
85106
fd282fb888de
Add new `input-decode-map' keymap and use it for temrinal
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84981
diff
changeset
|
1430 Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), |
|
6248
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1431 Fmake_vector (make_number (1), |
|
0e4319197d29
(term_get_fkeys_data): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
5933
diff
changeset
|
1432 intern (fkey))); |
|
3489
5c2b4797aab2
(term_get_fkeys): Use correct names for F10 and up.
Richard M. Stallman <rms@gnu.org>
parents:
3359
diff
changeset
|
1433 } |
|
5c2b4797aab2
(term_get_fkeys): Use correct names for F10 and up.
Richard M. Stallman <rms@gnu.org>
parents:
3359
diff
changeset
|
1434 } |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1435 } |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1436 } |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1437 |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1438 /* |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1439 * Various mappings to try and get a better fit. |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1440 */ |
|
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1441 { |
|
3489
5c2b4797aab2
(term_get_fkeys): Use correct names for F10 and up.
Richard M. Stallman <rms@gnu.org>
parents:
3359
diff
changeset
|
1442 #define CONDITIONAL_REASSIGN(cap1, cap2, sym) \ |
|
5c2b4797aab2
(term_get_fkeys): Use correct names for F10 and up.
Richard M. Stallman <rms@gnu.org>
parents:
3359
diff
changeset
|
1443 if (!tgetstr (cap1, address)) \ |
|
5c2b4797aab2
(term_get_fkeys): Use correct names for F10 and up.
Richard M. Stallman <rms@gnu.org>
parents:
3359
diff
changeset
|
1444 { \ |
|
5c2b4797aab2
(term_get_fkeys): Use correct names for F10 and up.
Richard M. Stallman <rms@gnu.org>
parents:
3359
diff
changeset
|
1445 char *sequence = tgetstr (cap2, address); \ |
|
83317
e235da12dd03
Make sure the terminfo function key sequences are set up in the correct function-key-map.
Karoly Lorentey <lorentey@elte.hu>
parents:
83315
diff
changeset
|
1446 if (sequence) \ |
|
85106
fd282fb888de
Add new `input-decode-map' keymap and use it for temrinal
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84981
diff
changeset
|
1447 Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), \ |
|
83317
e235da12dd03
Make sure the terminfo function key sequences are set up in the correct function-key-map.
Karoly Lorentey <lorentey@elte.hu>
parents:
83315
diff
changeset
|
1448 Fmake_vector (make_number (1), \ |
|
e235da12dd03
Make sure the terminfo function key sequences are set up in the correct function-key-map.
Karoly Lorentey <lorentey@elte.hu>
parents:
83315
diff
changeset
|
1449 intern (sym))); \ |
|
3489
5c2b4797aab2
(term_get_fkeys): Use correct names for F10 and up.
Richard M. Stallman <rms@gnu.org>
parents:
3359
diff
changeset
|
1450 } |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
1451 |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1452 /* if there's no key_next keycap, map key_npage to `next' keysym */ |
|
2243
23228edebc59
Fix spacing conventions.
Richard M. Stallman <rms@gnu.org>
parents:
2239
diff
changeset
|
1453 CONDITIONAL_REASSIGN ("%5", "kN", "next"); |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1454 /* if there's no key_prev keycap, map key_ppage to `previous' keysym */ |
|
3706
5a563b062c0d
(term_get_fkeys): Use `prior', not `previous', for %8/kP.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1455 CONDITIONAL_REASSIGN ("%8", "kP", "prior"); |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1456 /* if there's no key_dc keycap, map key_ic to `insert' keysym */ |
|
2243
23228edebc59
Fix spacing conventions.
Richard M. Stallman <rms@gnu.org>
parents:
2239
diff
changeset
|
1457 CONDITIONAL_REASSIGN ("kD", "kI", "insert"); |
|
19385
8f58b5d12021
(term_get_fkeys_1): Use kH as alternate for move-to-last-line.
Richard M. Stallman <rms@gnu.org>
parents:
19277
diff
changeset
|
1458 /* if there's no key_end keycap, map key_ll to 'end' keysym */ |
|
8f58b5d12021
(term_get_fkeys_1): Use kH as alternate for move-to-last-line.
Richard M. Stallman <rms@gnu.org>
parents:
19277
diff
changeset
|
1459 CONDITIONAL_REASSIGN ("@7", "kH", "end"); |
|
9524
f42e5fd15f6f
(term_get_fkeys_1): Workaround for IBM's dialect of terminfo.
Karl Heuer <kwzh@gnu.org>
parents:
8898
diff
changeset
|
1460 |
|
f42e5fd15f6f
(term_get_fkeys_1): Workaround for IBM's dialect of terminfo.
Karl Heuer <kwzh@gnu.org>
parents:
8898
diff
changeset
|
1461 /* IBM has their own non-standard dialect of terminfo. |
|
f42e5fd15f6f
(term_get_fkeys_1): Workaround for IBM's dialect of terminfo.
Karl Heuer <kwzh@gnu.org>
parents:
8898
diff
changeset
|
1462 If the standard name isn't found, try the IBM name. */ |
|
f42e5fd15f6f
(term_get_fkeys_1): Workaround for IBM's dialect of terminfo.
Karl Heuer <kwzh@gnu.org>
parents:
8898
diff
changeset
|
1463 CONDITIONAL_REASSIGN ("kB", "KO", "backtab"); |
|
f42e5fd15f6f
(term_get_fkeys_1): Workaround for IBM's dialect of terminfo.
Karl Heuer <kwzh@gnu.org>
parents:
8898
diff
changeset
|
1464 CONDITIONAL_REASSIGN ("@4", "kJ", "execute"); /* actually "action" */ |
|
f42e5fd15f6f
(term_get_fkeys_1): Workaround for IBM's dialect of terminfo.
Karl Heuer <kwzh@gnu.org>
parents:
8898
diff
changeset
|
1465 CONDITIONAL_REASSIGN ("@4", "kc", "execute"); /* actually "command" */ |
|
f42e5fd15f6f
(term_get_fkeys_1): Workaround for IBM's dialect of terminfo.
Karl Heuer <kwzh@gnu.org>
parents:
8898
diff
changeset
|
1466 CONDITIONAL_REASSIGN ("%7", "ki", "menu"); |
|
f42e5fd15f6f
(term_get_fkeys_1): Workaround for IBM's dialect of terminfo.
Karl Heuer <kwzh@gnu.org>
parents:
8898
diff
changeset
|
1467 CONDITIONAL_REASSIGN ("@7", "kw", "end"); |
|
f42e5fd15f6f
(term_get_fkeys_1): Workaround for IBM's dialect of terminfo.
Karl Heuer <kwzh@gnu.org>
parents:
8898
diff
changeset
|
1468 CONDITIONAL_REASSIGN ("F1", "k<", "f11"); |
|
f42e5fd15f6f
(term_get_fkeys_1): Workaround for IBM's dialect of terminfo.
Karl Heuer <kwzh@gnu.org>
parents:
8898
diff
changeset
|
1469 CONDITIONAL_REASSIGN ("F2", "k>", "f12"); |
|
f42e5fd15f6f
(term_get_fkeys_1): Workaround for IBM's dialect of terminfo.
Karl Heuer <kwzh@gnu.org>
parents:
8898
diff
changeset
|
1470 CONDITIONAL_REASSIGN ("%1", "kq", "help"); |
|
f42e5fd15f6f
(term_get_fkeys_1): Workaround for IBM's dialect of terminfo.
Karl Heuer <kwzh@gnu.org>
parents:
8898
diff
changeset
|
1471 CONDITIONAL_REASSIGN ("*6", "kU", "select"); |
|
2224
49bda4cf498c
Supply second arg for tgetstr() calls.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2179
diff
changeset
|
1472 #undef CONDITIONAL_REASSIGN |
|
2137
8e4d2d1e7c66
Added lots more cookies to fkey_table[], and code to do even more.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1994
diff
changeset
|
1473 } |
| 25002 | 1474 |
| 1475 return Qnil; | |
| 533 | 1476 } |
|
109516
68ca98ae70fb
Make building under stricter warning flags somewhat cleaner.
Juanma Barranquero <lekktu@gmail.com>
parents:
109376
diff
changeset
|
1477 #endif /* not DOS_NT */ |
| 533 | 1478 |
| 1479 | |
| 25002 | 1480 /*********************************************************************** |
| 1481 Character Display Information | |
| 1482 ***********************************************************************/ | |
|
109100
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
1483 static void append_glyph (struct it *); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
1484 static void produce_stretch_glyph (struct it *); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
1485 static void append_composite_glyph (struct it *); |
|
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108235
diff
changeset
|
1486 static void produce_composite_glyph (struct it *); |
|
111237
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1487 static void append_glyphless_glyph (struct it *, int, char *); |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1488 static void produce_glyphless_glyph (struct it *, int, Lisp_Object); |
| 25002 | 1489 |
| 1490 /* Append glyphs to IT's glyph_row. Called from produce_glyphs for | |
|
68661
4e22dd401a52
(append_glyph): Refer to it->char_to_display instead of
Kenichi Handa <handa@m17n.org>
parents:
68651
diff
changeset
|
1491 terminal frames if IT->glyph_row != NULL. IT->char_to_display is |
|
4e22dd401a52
(append_glyph): Refer to it->char_to_display instead of
Kenichi Handa <handa@m17n.org>
parents:
68651
diff
changeset
|
1492 the character for which to produce glyphs; IT->face_id contains the |
|
4e22dd401a52
(append_glyph): Refer to it->char_to_display instead of
Kenichi Handa <handa@m17n.org>
parents:
68651
diff
changeset
|
1493 character's face. Padding glyphs are appended if IT->c has a |
|
4e22dd401a52
(append_glyph): Refer to it->char_to_display instead of
Kenichi Handa <handa@m17n.org>
parents:
68651
diff
changeset
|
1494 IT->pixel_width > 1. */ |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
1495 |
| 25002 | 1496 static void |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
1497 append_glyph (struct it *it) |
| 25002 | 1498 { |
| 1499 struct glyph *glyph, *end; | |
| 1500 int i; | |
| 1501 | |
| 1502 xassert (it->glyph_row); | |
| 1503 glyph = (it->glyph_row->glyphs[it->area] | |
| 1504 + it->glyph_row->used[it->area]); | |
| 1505 end = it->glyph_row->glyphs[1 + it->area]; | |
| 1506 | |
|
107598
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1507 /* If the glyph row is reversed, we need to prepend the glyph rather |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1508 than append it. */ |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1509 if (it->glyph_row->reversed_p && it->area == TEXT_AREA) |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1510 { |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1511 struct glyph *g; |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1512 int move_by = it->pixel_width; |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1513 |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1514 /* Make room for the new glyphs. */ |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1515 if (move_by > end - glyph) /* don't overstep end of this area */ |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1516 move_by = end - glyph; |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1517 for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--) |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1518 g[move_by] = *g; |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1519 glyph = it->glyph_row->glyphs[it->area]; |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1520 end = glyph + move_by; |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1521 } |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1522 |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1523 /* BIDI Note: we put the glyphs of a "multi-pixel" character left to |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1524 right, even in the REVERSED_P case, since (a) all of its u.ch are |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1525 identical, and (b) the PADDING_P flag needs to be set for the |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1526 leftmost one, because we write to the terminal left-to-right. */ |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
1527 for (i = 0; |
|
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
1528 i < it->pixel_width && glyph < end; |
| 25002 | 1529 ++i) |
| 1530 { | |
| 1531 glyph->type = CHAR_GLYPH; | |
|
29462
3306af2e4f3d
(append_glyph): Revert change of 2000-06-06.
Gerd Moellmann <gerd@gnu.org>
parents:
29448
diff
changeset
|
1532 glyph->pixel_width = 1; |
|
68661
4e22dd401a52
(append_glyph): Refer to it->char_to_display instead of
Kenichi Handa <handa@m17n.org>
parents:
68651
diff
changeset
|
1533 glyph->u.ch = it->char_to_display; |
|
26999
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
1534 glyph->face_id = it->face_id; |
|
5d0057e6170e
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
26902
diff
changeset
|
1535 glyph->padding_p = i > 0; |
| 25002 | 1536 glyph->charpos = CHARPOS (it->position); |
| 1537 glyph->object = it->object; | |
|
107598
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1538 if (it->bidi_p) |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1539 { |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1540 glyph->resolved_level = it->bidi_it.resolved_level; |
|
107606
297c59e52ecf
Retrospective commit from 2009-12-26.
Eli Zaretskii <eliz@gnu.org>
parents:
107598
diff
changeset
|
1541 if ((it->bidi_it.type & 7) != it->bidi_it.type) |
|
297c59e52ecf
Retrospective commit from 2009-12-26.
Eli Zaretskii <eliz@gnu.org>
parents:
107598
diff
changeset
|
1542 abort (); |
|
107598
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1543 glyph->bidi_type = it->bidi_it.type; |
|
4bad2c6338cc
Retrospective commit from 2009-10-17.
Eli Zaretskii <eliz@gnu.org>
parents:
106244
diff
changeset
|
1544 } |
|
107606
297c59e52ecf
Retrospective commit from 2009-12-26.
Eli Zaretskii <eliz@gnu.org>
parents:
107598
diff
changeset
|
1545 else |
|
297c59e52ecf
Retrospective commit from 2009-12-26.
Eli Zaretskii <eliz@gnu.org>
parents:
107598
diff
changeset
|
1546 { |
|
297c59e52ecf
Retrospective commit from 2009-12-26.
Eli Zaretskii <eliz@gnu.org>
parents:
107598
diff
changeset
|
1547 glyph->resolved_level = 0; |
|
297c59e52ecf
Retrospective commit from 2009-12-26.
Eli Zaretskii <eliz@gnu.org>
parents:
107598
diff
changeset
|
1548 glyph->bidi_type = UNKNOWN_BT; |
|
297c59e52ecf
Retrospective commit from 2009-12-26.
Eli Zaretskii <eliz@gnu.org>
parents:
107598
diff
changeset
|
1549 } |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
1550 |
| 25002 | 1551 ++it->glyph_row->used[it->area]; |
| 1552 ++glyph; | |
| 1553 } | |
| 1554 } | |
| 1555 | |
| 44372 | 1556 /* Produce glyphs for the display element described by IT. *IT |
| 1557 specifies what we want to produce a glyph for (character, image, ...), | |
| 1558 and where in the glyph matrix we currently are (glyph row and hpos). | |
| 1559 produce_glyphs fills in output fields of *IT with information such as the | |
| 1560 pixel width and height of a character, and maybe output actual glyphs at | |
|
107198
f32d789c9aab
term.c, dispextern.h: Fix stale comments.
Eli Zaretskii <eliz@gnu.org>
parents:
107191
diff
changeset
|
1561 the same time if IT->glyph_row is non-null. For an overview, see |
|
f32d789c9aab
term.c, dispextern.h: Fix stale comments.
Eli Zaretskii <eliz@gnu.org>
parents:
107191
diff
changeset
|
1562 the explanation in dispextern.h, before the definition of the |
|
f32d789c9aab
term.c, dispextern.h: Fix stale comments.
Eli Zaretskii <eliz@gnu.org>
parents:
107191
diff
changeset
|
1563 display_element_type enumeration. |
| 44372 | 1564 |
| 1565 produce_glyphs also stores the result of glyph width, ascent | |
| 1566 etc. computations in *IT. | |
| 1567 | |
| 1568 IT->glyph_row may be null, in which case produce_glyphs does not | |
| 1569 actually fill in the glyphs. This is used in the move_* functions | |
| 1570 in xdisp.c for text width and height computations. | |
| 1571 | |
| 1572 Callers usually don't call produce_glyphs directly; | |
| 1573 instead they use the macro PRODUCE_GLYPHS. */ | |
| 25002 | 1574 |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
1575 void |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
1576 produce_glyphs (struct it *it) |
| 25002 | 1577 { |
| 1578 /* If a hook is installed, let it do the work. */ | |
| 90638 | 1579 |
| 1580 /* Nothing but characters are supported on terminal frames. */ | |
| 25002 | 1581 xassert (it->what == IT_CHARACTER |
|
26871
aaf45e665b14
(encode_terminal_code): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents:
26425
diff
changeset
|
1582 || it->what == IT_COMPOSITION |
| 25002 | 1583 || it->what == IT_STRETCH); |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
1584 |
|
54428
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1585 if (it->what == IT_STRETCH) |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1586 { |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1587 produce_stretch_glyph (it); |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1588 goto done; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1589 } |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1590 |
| 90638 | 1591 if (it->what == IT_COMPOSITION) |
| 1592 { | |
| 1593 produce_composite_glyph (it); | |
| 1594 goto done; | |
| 1595 } | |
| 25002 | 1596 |
|
111237
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1597 if (it->what == IT_GLYPHLESS) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1598 { |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1599 produce_glyphless_glyph (it, 0, Qnil); |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1600 goto done; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1601 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1602 |
|
110131
cca2a663ef92
Fix handling of 8-bit characters in a display table.
Kenichi Handa <handa@m17n.org>
parents:
110128
diff
changeset
|
1603 if (it->char_to_display >= 040 && it->char_to_display < 0177) |
| 25002 | 1604 { |
| 1605 it->pixel_width = it->nglyphs = 1; | |
| 1606 if (it->glyph_row) | |
| 1607 append_glyph (it); | |
| 1608 } | |
|
110131
cca2a663ef92
Fix handling of 8-bit characters in a display table.
Kenichi Handa <handa@m17n.org>
parents:
110128
diff
changeset
|
1609 else if (it->char_to_display == '\n') |
| 25002 | 1610 it->pixel_width = it->nglyphs = 0; |
|
110131
cca2a663ef92
Fix handling of 8-bit characters in a display table.
Kenichi Handa <handa@m17n.org>
parents:
110128
diff
changeset
|
1611 else if (it->char_to_display == '\t') |
| 25002 | 1612 { |
|
28685
b4310b6f3b5e
(produce_glyphs): Remove reference to struct it's prompt_width.
Gerd Moellmann <gerd@gnu.org>
parents:
28507
diff
changeset
|
1613 int absolute_x = (it->current_x |
| 25002 | 1614 + it->continuation_lines_width); |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
1615 int next_tab_x |
|
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
1616 = (((1 + absolute_x + it->tab_width - 1) |
| 25002 | 1617 / it->tab_width) |
| 1618 * it->tab_width); | |
| 1619 int nspaces; | |
| 1620 | |
| 1621 /* If part of the TAB has been displayed on the previous line | |
| 1622 which is continued now, continuation_lines_width will have | |
| 1623 been incremented already by the part that fitted on the | |
| 1624 continued line. So, we will get the right number of spaces | |
| 1625 here. */ | |
| 1626 nspaces = next_tab_x - absolute_x; | |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
1627 |
| 25002 | 1628 if (it->glyph_row) |
| 1629 { | |
| 1630 int n = nspaces; | |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
1631 |
|
68661
4e22dd401a52
(append_glyph): Refer to it->char_to_display instead of
Kenichi Handa <handa@m17n.org>
parents:
68651
diff
changeset
|
1632 it->char_to_display = ' '; |
| 25002 | 1633 it->pixel_width = it->len = 1; |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
1634 |
| 25002 | 1635 while (n--) |
| 1636 append_glyph (it); | |
| 1637 } | |
| 1638 | |
| 1639 it->pixel_width = nspaces; | |
| 1640 it->nglyphs = nspaces; | |
| 1641 } | |
|
110131
cca2a663ef92
Fix handling of 8-bit characters in a display table.
Kenichi Handa <handa@m17n.org>
parents:
110128
diff
changeset
|
1642 else if (CHAR_BYTE8_P (it->char_to_display)) |
|
29262
b7059c9f98ac
(produce_glyphs): Don't treat eight-bit-* charsets as multibyte.
Eli Zaretskii <eliz@gnu.org>
parents:
29097
diff
changeset
|
1643 { |
|
110131
cca2a663ef92
Fix handling of 8-bit characters in a display table.
Kenichi Handa <handa@m17n.org>
parents:
110128
diff
changeset
|
1644 /* Coming here means that we must send the raw 8-bit byte as is |
|
cca2a663ef92
Fix handling of 8-bit characters in a display table.
Kenichi Handa <handa@m17n.org>
parents:
110128
diff
changeset
|
1645 to the terminal. Although there's no way to know how many |
|
cca2a663ef92
Fix handling of 8-bit characters in a display table.
Kenichi Handa <handa@m17n.org>
parents:
110128
diff
changeset
|
1646 columns it occupies on a screen, it is a good assumption that |
|
cca2a663ef92
Fix handling of 8-bit characters in a display table.
Kenichi Handa <handa@m17n.org>
parents:
110128
diff
changeset
|
1647 a single byte code has 1-column width. */ |
|
cca2a663ef92
Fix handling of 8-bit characters in a display table.
Kenichi Handa <handa@m17n.org>
parents:
110128
diff
changeset
|
1648 it->pixel_width = it->nglyphs = 1; |
|
cca2a663ef92
Fix handling of 8-bit characters in a display table.
Kenichi Handa <handa@m17n.org>
parents:
110128
diff
changeset
|
1649 if (it->glyph_row) |
|
cca2a663ef92
Fix handling of 8-bit characters in a display table.
Kenichi Handa <handa@m17n.org>
parents:
110128
diff
changeset
|
1650 append_glyph (it); |
|
29262
b7059c9f98ac
(produce_glyphs): Don't treat eight-bit-* charsets as multibyte.
Eli Zaretskii <eliz@gnu.org>
parents:
29097
diff
changeset
|
1651 } |
| 25002 | 1652 else |
| 1653 { | |
|
111237
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1654 Lisp_Object charset_list = FRAME_TERMINAL (it->f)->charset_list; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1655 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1656 if (char_charset (it->char_to_display, charset_list, NULL)) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1657 { |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1658 it->pixel_width = CHAR_WIDTH (it->char_to_display); |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1659 it->nglyphs = it->pixel_width; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1660 if (it->glyph_row) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1661 append_glyph (it); |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1662 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1663 else |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1664 { |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1665 Lisp_Object acronym = lookup_glyphless_char_display (-1, it); |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1666 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1667 xassert (it->what == IT_GLYPHLESS); |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1668 produce_glyphless_glyph (it, 1, acronym); |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1669 } |
| 25002 | 1670 } |
| 1671 | |
|
54428
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1672 done: |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
1673 /* Advance current_x by the pixel width as a convenience for |
| 25002 | 1674 the caller. */ |
| 1675 if (it->area == TEXT_AREA) | |
| 1676 it->current_x += it->pixel_width; | |
|
25187
39feb68ed3c7
(produce_glyphs): Set iterator's physical height
Gerd Moellmann <gerd@gnu.org>
parents:
25002
diff
changeset
|
1677 it->ascent = it->max_ascent = it->phys_ascent = it->max_phys_ascent = 0; |
|
39feb68ed3c7
(produce_glyphs): Set iterator's physical height
Gerd Moellmann <gerd@gnu.org>
parents:
25002
diff
changeset
|
1678 it->descent = it->max_descent = it->phys_descent = it->max_phys_descent = 1; |
| 25002 | 1679 } |
| 1680 | |
| 1681 | |
|
54428
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1682 /* Produce a stretch glyph for iterator IT. IT->object is the value |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1683 of the glyph property displayed. The value must be a list |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1684 `(space KEYWORD VALUE ...)' with the following KEYWORD/VALUE pairs |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1685 being recognized: |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1686 |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1687 1. `:width WIDTH' specifies that the space should be WIDTH * |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1688 canonical char width wide. WIDTH may be an integer or floating |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1689 point number. |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1690 |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1691 2. `:align-to HPOS' specifies that the space should be wide enough |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1692 to reach HPOS, a value in canonical character units. */ |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1693 |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1694 static void |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
1695 produce_stretch_glyph (struct it *it) |
|
54428
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1696 { |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1697 /* (space :width WIDTH ...) */ |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1698 Lisp_Object prop, plist; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1699 int width = 0, align_to = -1; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1700 int zero_width_ok_p = 0; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1701 double tem; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1702 |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1703 /* List should start with `space'. */ |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1704 xassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace)); |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1705 plist = XCDR (it->object); |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1706 |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1707 /* Compute the width of the stretch. */ |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1708 if ((prop = Fplist_get (plist, QCwidth), !NILP (prop)) |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1709 && calc_pixel_width_or_height (&tem, it, prop, 0, 1, 0)) |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1710 { |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1711 /* Absolute width `:width WIDTH' specified and valid. */ |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1712 zero_width_ok_p = 1; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1713 width = (int)(tem + 0.5); |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1714 } |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1715 else if ((prop = Fplist_get (plist, QCalign_to), !NILP (prop)) |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1716 && calc_pixel_width_or_height (&tem, it, prop, 0, 1, &align_to)) |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1717 { |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1718 if (it->glyph_row == NULL || !it->glyph_row->mode_line_p) |
|
66238
d3f5aa0f18c4
(encode_terminal_code): Remove unused var src_start.
Kim F. Storm <storm@cua.dk>
parents:
65795
diff
changeset
|
1719 align_to = (align_to < 0 |
|
54428
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1720 ? 0 |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1721 : align_to - window_box_left_offset (it->w, TEXT_AREA)); |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1722 else if (align_to < 0) |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1723 align_to = window_box_left_offset (it->w, TEXT_AREA); |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1724 width = max (0, (int)(tem + 0.5) + align_to - it->current_x); |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1725 zero_width_ok_p = 1; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1726 } |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1727 else |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1728 /* Nothing specified -> width defaults to canonical char width. */ |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1729 width = FRAME_COLUMN_WIDTH (it->f); |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1730 |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1731 if (width <= 0 && (width < 0 || !zero_width_ok_p)) |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1732 width = 1; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1733 |
|
102831
1f0beb33697b
* term.c (produce_stretch_glyph): Reduce width of stretch glyphs
Chong Yidong <cyd@stupidchicken.com>
parents:
102744
diff
changeset
|
1734 if (width > 0 && it->line_wrap != TRUNCATE |
|
1f0beb33697b
* term.c (produce_stretch_glyph): Reduce width of stretch glyphs
Chong Yidong <cyd@stupidchicken.com>
parents:
102744
diff
changeset
|
1735 && it->current_x + width > it->last_visible_x) |
|
1f0beb33697b
* term.c (produce_stretch_glyph): Reduce width of stretch glyphs
Chong Yidong <cyd@stupidchicken.com>
parents:
102744
diff
changeset
|
1736 width = it->last_visible_x - it->current_x - 1; |
|
1f0beb33697b
* term.c (produce_stretch_glyph): Reduce width of stretch glyphs
Chong Yidong <cyd@stupidchicken.com>
parents:
102744
diff
changeset
|
1737 |
|
54428
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1738 if (width > 0 && it->glyph_row) |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1739 { |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1740 Lisp_Object o_object = it->object; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1741 Lisp_Object object = it->stack[it->sp - 1].string; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1742 int n = width; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1743 |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1744 if (!STRINGP (object)) |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1745 object = it->w->buffer; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1746 it->object = object; |
|
68661
4e22dd401a52
(append_glyph): Refer to it->char_to_display instead of
Kenichi Handa <handa@m17n.org>
parents:
68651
diff
changeset
|
1747 it->char_to_display = ' '; |
|
54428
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1748 it->pixel_width = it->len = 1; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1749 while (n--) |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1750 append_glyph (it); |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1751 it->object = o_object; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1752 } |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1753 it->pixel_width = width; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1754 it->nglyphs = width; |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1755 } |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1756 |
|
3a86bc69c0e3
(produce_glyphs): Handle IT_STRETCH.
Kim F. Storm <storm@cua.dk>
parents:
54167
diff
changeset
|
1757 |
| 90638 | 1758 /* Append glyphs to IT's glyph_row for the composition IT->cmp_id. |
| 1759 Called from produce_composite_glyph for terminal frames if | |
| 1760 IT->glyph_row != NULL. IT->face_id contains the character's | |
| 1761 face. */ | |
| 1762 | |
| 1763 static void | |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
1764 append_composite_glyph (struct it *it) |
| 90638 | 1765 { |
| 1766 struct glyph *glyph; | |
| 1767 | |
| 1768 xassert (it->glyph_row); | |
| 1769 glyph = it->glyph_row->glyphs[it->area] + it->glyph_row->used[it->area]; | |
| 1770 if (glyph < it->glyph_row->glyphs[1 + it->area]) | |
| 1771 { | |
|
107996
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1772 /* If the glyph row is reversed, we need to prepend the glyph |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1773 rather than append it. */ |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1774 if (it->glyph_row->reversed_p && it->area == TEXT_AREA) |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1775 { |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1776 struct glyph *g; |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1777 |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1778 /* Make room for the new glyph. */ |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1779 for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--) |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1780 g[1] = *g; |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1781 glyph = it->glyph_row->glyphs[it->area]; |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1782 } |
| 90638 | 1783 glyph->type = COMPOSITE_GLYPH; |
| 1784 glyph->pixel_width = it->pixel_width; | |
|
97830
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1785 glyph->u.cmp.id = it->cmp_it.id; |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1786 if (it->cmp_it.ch < 0) |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1787 { |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1788 glyph->u.cmp.automatic = 0; |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1789 glyph->u.cmp.id = it->cmp_it.id; |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1790 } |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1791 else |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1792 { |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1793 glyph->u.cmp.automatic = 1; |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1794 glyph->u.cmp.id = it->cmp_it.id; |
|
110598
ee58b36ab139
Remove restriction on the number of glyphs in one composition.
Kenichi Handa <handa@m17n.org>
parents:
110357
diff
changeset
|
1795 glyph->slice.cmp.from = it->cmp_it.from; |
|
ee58b36ab139
Remove restriction on the number of glyphs in one composition.
Kenichi Handa <handa@m17n.org>
parents:
110357
diff
changeset
|
1796 glyph->slice.cmp.to = it->cmp_it.to - 1; |
|
97830
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1797 } |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1798 |
| 90638 | 1799 glyph->face_id = it->face_id; |
| 1800 glyph->padding_p = 0; | |
| 1801 glyph->charpos = CHARPOS (it->position); | |
| 1802 glyph->object = it->object; | |
|
107996
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1803 if (it->bidi_p) |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1804 { |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1805 glyph->resolved_level = it->bidi_it.resolved_level; |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1806 if ((it->bidi_it.type & 7) != it->bidi_it.type) |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1807 abort (); |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1808 glyph->bidi_type = it->bidi_it.type; |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1809 } |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1810 else |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1811 { |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1812 glyph->resolved_level = 0; |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1813 glyph->bidi_type = UNKNOWN_BT; |
|
8ef8b6523597
Fix R2L paragraph display on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107994
diff
changeset
|
1814 } |
| 90638 | 1815 |
| 1816 ++it->glyph_row->used[it->area]; | |
| 1817 ++glyph; | |
| 1818 } | |
| 1819 } | |
| 1820 | |
| 1821 | |
| 1822 /* Produce a composite glyph for iterator IT. IT->cmp_id is the ID of | |
| 1823 the composition. We simply produces components of the composition | |
|
105426
d0a6d64c3cfc
Fix typos in comments.
Juanma Barranquero <lekktu@gmail.com>
parents:
103711
diff
changeset
|
1824 assuming that the terminal has a capability to layout/render it |
|
d0a6d64c3cfc
Fix typos in comments.
Juanma Barranquero <lekktu@gmail.com>
parents:
103711
diff
changeset
|
1825 correctly. */ |
| 90638 | 1826 |
| 1827 static void | |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
1828 produce_composite_glyph (struct it *it) |
| 90638 | 1829 { |
|
97830
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1830 if (it->cmp_it.ch < 0) |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1831 { |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1832 struct composition *cmp = composition_table[it->cmp_it.id]; |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1833 |
|
101774
d4f9e4244d5a
(encode_terminal_code): Fix handling of composition.
Kenichi Handa <handa@m17n.org>
parents:
101690
diff
changeset
|
1834 it->pixel_width = cmp->width; |
|
97830
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1835 } |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1836 else |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1837 { |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1838 Lisp_Object gstring = composition_gstring_from_id (it->cmp_it.id); |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1839 |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1840 it->pixel_width = composition_gstring_width (gstring, it->cmp_it.from, |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1841 it->cmp_it.to, NULL); |
|
62a07e57ef40
(encode_terminal_code): Adjusted for the change of struct
Kenichi Handa <handa@m17n.org>
parents:
97720
diff
changeset
|
1842 } |
| 90638 | 1843 it->nglyphs = 1; |
| 1844 if (it->glyph_row) | |
| 1845 append_composite_glyph (it); | |
| 1846 } | |
| 1847 | |
| 1848 | |
|
111237
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1849 /* Append a glyph for a glyphless character to IT->glyph_row. FACE_ID |
|
111526
5c986eef8f0d
Fix and document display of glyphless characters.
Eli Zaretskii <eliz@gnu.org>
parents:
111413
diff
changeset
|
1850 is a face ID to be used for the glyph. What is actually appended |
|
5c986eef8f0d
Fix and document display of glyphless characters.
Eli Zaretskii <eliz@gnu.org>
parents:
111413
diff
changeset
|
1851 are glyphs of type CHAR_GLYPH whose characters are in STR (which |
|
5c986eef8f0d
Fix and document display of glyphless characters.
Eli Zaretskii <eliz@gnu.org>
parents:
111413
diff
changeset
|
1852 comes from it->nglyphs bytes). */ |
|
111237
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1853 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1854 static void |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1855 append_glyphless_glyph (struct it *it, int face_id, char *str) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1856 { |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1857 struct glyph *glyph, *end; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1858 int i; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1859 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1860 xassert (it->glyph_row); |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1861 glyph = it->glyph_row->glyphs[it->area] + it->glyph_row->used[it->area]; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1862 end = it->glyph_row->glyphs[1 + it->area]; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1863 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1864 /* If the glyph row is reversed, we need to prepend the glyph rather |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1865 than append it. */ |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1866 if (it->glyph_row->reversed_p && it->area == TEXT_AREA) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1867 { |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1868 struct glyph *g; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1869 int move_by = it->pixel_width; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1870 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1871 /* Make room for the new glyphs. */ |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1872 if (move_by > end - glyph) /* don't overstep end of this area */ |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1873 move_by = end - glyph; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1874 for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1875 g[move_by] = *g; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1876 glyph = it->glyph_row->glyphs[it->area]; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1877 end = glyph + move_by; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1878 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1879 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1880 if (glyph >= end) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1881 return; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1882 glyph->type = CHAR_GLYPH; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1883 glyph->pixel_width = 1; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1884 glyph->face_id = face_id; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1885 glyph->padding_p = 0; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1886 glyph->charpos = CHARPOS (it->position); |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1887 glyph->object = it->object; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1888 if (it->bidi_p) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1889 { |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1890 glyph->resolved_level = it->bidi_it.resolved_level; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1891 if ((it->bidi_it.type & 7) != it->bidi_it.type) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1892 abort (); |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1893 glyph->bidi_type = it->bidi_it.type; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1894 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1895 else |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1896 { |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1897 glyph->resolved_level = 0; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1898 glyph->bidi_type = UNKNOWN_BT; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1899 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1900 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1901 /* BIDI Note: we put the glyphs of characters left to right, even in |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1902 the REVERSED_P case because we write to the terminal |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1903 left-to-right. */ |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1904 for (i = 0; i < it->nglyphs && glyph < end; ++i) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1905 { |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1906 if (i > 0) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1907 glyph[0] = glyph[-1]; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1908 glyph->u.ch = str[i]; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1909 ++it->glyph_row->used[it->area]; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1910 ++glyph; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1911 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1912 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1913 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1914 /* Produce glyphs for a glyphless character for iterator IT. |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1915 IT->glyphless_method specifies which method to use for displaying |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1916 the character. See the description of enum |
|
111526
5c986eef8f0d
Fix and document display of glyphless characters.
Eli Zaretskii <eliz@gnu.org>
parents:
111413
diff
changeset
|
1917 glyphless_display_method in dispextern.h for the details. |
|
111237
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1918 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1919 FOR_NO_FONT is nonzero if and only if this is for a character that |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1920 is not supproted by the coding system of the terminal. ACRONYM, if |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1921 non-nil, is an acronym string for the character. |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1922 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1923 The glyphs actually produced are of type CHAR_GLYPH. */ |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1924 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1925 static void |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1926 produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1927 { |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1928 int face_id; |
|
111526
5c986eef8f0d
Fix and document display of glyphless characters.
Eli Zaretskii <eliz@gnu.org>
parents:
111413
diff
changeset
|
1929 int len; |
|
111651
dbffbd2b89b9
Use \uNNNN, \UNNNNNN, or \xNNNNNN for hex-code display on a TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
111544
diff
changeset
|
1930 char buf[9], *str = " "; |
|
111237
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1931 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1932 /* Get a face ID for the glyph by utilizing a cache (the same way as |
|
111526
5c986eef8f0d
Fix and document display of glyphless characters.
Eli Zaretskii <eliz@gnu.org>
parents:
111413
diff
changeset
|
1933 done for `escape-glyph' in get_next_display_element). */ |
|
111237
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1934 if (it->f == last_glyphless_glyph_frame |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1935 && it->face_id == last_glyphless_glyph_face_id) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1936 { |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1937 face_id = last_glyphless_glyph_merged_face_id; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1938 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1939 else |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1940 { |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1941 /* Merge the `glyphless-char' face into the current face. */ |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1942 face_id = merge_faces (it->f, Qglyphless_char, 0, it->face_id); |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1943 last_glyphless_glyph_frame = it->f; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1944 last_glyphless_glyph_face_id = it->face_id; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1945 last_glyphless_glyph_merged_face_id = face_id; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1946 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1947 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1948 if (it->glyphless_method == GLYPHLESS_DISPLAY_THIN_SPACE) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1949 { |
|
111526
5c986eef8f0d
Fix and document display of glyphless characters.
Eli Zaretskii <eliz@gnu.org>
parents:
111413
diff
changeset
|
1950 /* As there's no way to produce a thin space, we produce a space |
|
5c986eef8f0d
Fix and document display of glyphless characters.
Eli Zaretskii <eliz@gnu.org>
parents:
111413
diff
changeset
|
1951 of canonical width. */ |
|
111237
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1952 len = 1; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1953 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1954 else if (it->glyphless_method == GLYPHLESS_DISPLAY_EMPTY_BOX) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1955 { |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1956 len = CHAR_WIDTH (it->c); |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1957 if (len == 0) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1958 len = 1; |
|
111526
5c986eef8f0d
Fix and document display of glyphless characters.
Eli Zaretskii <eliz@gnu.org>
parents:
111413
diff
changeset
|
1959 else if (len > 4) |
|
111237
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1960 len = 4; |
|
111526
5c986eef8f0d
Fix and document display of glyphless characters.
Eli Zaretskii <eliz@gnu.org>
parents:
111413
diff
changeset
|
1961 sprintf (buf, "[%.*s]", len, str); |
|
5c986eef8f0d
Fix and document display of glyphless characters.
Eli Zaretskii <eliz@gnu.org>
parents:
111413
diff
changeset
|
1962 len += 2; |
|
5c986eef8f0d
Fix and document display of glyphless characters.
Eli Zaretskii <eliz@gnu.org>
parents:
111413
diff
changeset
|
1963 str = buf; |
|
111237
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1964 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1965 else |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1966 { |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1967 if (it->glyphless_method == GLYPHLESS_DISPLAY_ACRONYM) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1968 { |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1969 if (! STRINGP (acronym) && CHAR_TABLE_P (Vglyphless_char_display)) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1970 acronym = CHAR_TABLE_REF (Vglyphless_char_display, it->c); |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1971 buf[0] = '['; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1972 str = STRINGP (acronym) ? (char *) SDATA (acronym) : ""; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1973 for (len = 0; len < 6 && str[len] && ASCII_BYTE_P (str[len]); len++) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1974 buf[1 + len] = str[len]; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1975 buf[1 + len] = ']'; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1976 len += 2; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1977 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1978 else |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1979 { |
|
111526
5c986eef8f0d
Fix and document display of glyphless characters.
Eli Zaretskii <eliz@gnu.org>
parents:
111413
diff
changeset
|
1980 xassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE); |
|
111651
dbffbd2b89b9
Use \uNNNN, \UNNNNNN, or \xNNNNNN for hex-code display on a TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
111544
diff
changeset
|
1981 len = (it->c < 0x10000 ? sprintf (buf, "\\u%04X", it->c) |
|
dbffbd2b89b9
Use \uNNNN, \UNNNNNN, or \xNNNNNN for hex-code display on a TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
111544
diff
changeset
|
1982 : it->c <= MAX_UNICODE_CHAR ? sprintf (buf, "\\U%06X", it->c) |
|
dbffbd2b89b9
Use \uNNNN, \UNNNNNN, or \xNNNNNN for hex-code display on a TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
111544
diff
changeset
|
1983 : sprintf (buf, "\\x%06X", it->c)); |
|
111237
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1984 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1985 str = buf; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1986 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1987 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1988 it->pixel_width = len; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1989 it->nglyphs = len; |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1990 if (len > 0 && it->glyph_row) |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1991 append_glyphless_glyph (it, face_id, str); |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1992 } |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1993 |
|
6788b08ca420
Handle glyphless characters on tty.
Kenichi Handa <handa@m17n.org>
parents:
110688
diff
changeset
|
1994 |
| 25002 | 1995 /* Get information about special display element WHAT in an |
| 1996 environment described by IT. WHAT is one of IT_TRUNCATION or | |
| 1997 IT_CONTINUATION. Maybe produce glyphs for WHAT if IT has a | |
| 1998 non-null glyph_row member. This function ensures that fields like | |
| 1999 face_id, c, len of IT are left untouched. */ | |
| 2000 | |
| 2001 void | |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
2002 produce_special_glyphs (struct it *it, enum display_element_type what) |
| 25002 | 2003 { |
| 2004 struct it temp_it; | |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2005 Lisp_Object gc; |
|
63549
bda22724fc82
(produce_special_glyphs): Use spec_glyph_lookup_face.
Richard M. Stallman <rms@gnu.org>
parents:
61591
diff
changeset
|
2006 GLYPH glyph; |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
2007 |
| 25002 | 2008 temp_it = *it; |
| 2009 temp_it.dp = NULL; | |
| 2010 temp_it.what = IT_CHARACTER; | |
| 2011 temp_it.len = 1; | |
|
28507
b6f06a755c7d
make_number/XINT/XUINT conversions; EQ/== fixes; ==Qnil -> NILP
Ken Raeburn <raeburn@raeburn.org>
parents:
28465
diff
changeset
|
2012 temp_it.object = make_number (0); |
|
109165
750db9f3e6d8
Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents:
109144
diff
changeset
|
2013 memset (&temp_it.current, 0, sizeof temp_it.current); |
| 25002 | 2014 |
| 2015 if (what == IT_CONTINUATION) | |
| 2016 { | |
|
107994
5dc04900cbd7
Mirror continuation indicators for R2L lines; fix face extension on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107640
diff
changeset
|
2017 /* Continuation glyph. For R2L lines, we mirror it by hand. */ |
|
5dc04900cbd7
Mirror continuation indicators for R2L lines; fix face extension on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107640
diff
changeset
|
2018 if (it->bidi_it.paragraph_dir == R2L) |
|
5dc04900cbd7
Mirror continuation indicators for R2L lines; fix face extension on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107640
diff
changeset
|
2019 SET_GLYPH_FROM_CHAR (glyph, '/'); |
|
5dc04900cbd7
Mirror continuation indicators for R2L lines; fix face extension on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107640
diff
changeset
|
2020 else |
|
5dc04900cbd7
Mirror continuation indicators for R2L lines; fix face extension on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107640
diff
changeset
|
2021 SET_GLYPH_FROM_CHAR (glyph, '\\'); |
| 25002 | 2022 if (it->dp |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2023 && (gc = DISP_CONTINUE_GLYPH (it->dp), GLYPH_CODE_P (gc)) |
|
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2024 && GLYPH_CODE_CHAR_VALID_P (gc)) |
| 25002 | 2025 { |
|
107994
5dc04900cbd7
Mirror continuation indicators for R2L lines; fix face extension on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107640
diff
changeset
|
2026 /* FIXME: Should we mirror GC for R2L lines? */ |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2027 SET_GLYPH_FROM_GLYPH_CODE (glyph, gc); |
|
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2028 spec_glyph_lookup_face (XWINDOW (it->window), &glyph); |
| 25002 | 2029 } |
| 2030 } | |
| 2031 else if (what == IT_TRUNCATION) | |
| 2032 { | |
| 2033 /* Truncation glyph. */ | |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2034 SET_GLYPH_FROM_CHAR (glyph, '$'); |
| 25002 | 2035 if (it->dp |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2036 && (gc = DISP_TRUNC_GLYPH (it->dp), GLYPH_CODE_P (gc)) |
|
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2037 && GLYPH_CODE_CHAR_VALID_P (gc)) |
| 25002 | 2038 { |
|
107994
5dc04900cbd7
Mirror continuation indicators for R2L lines; fix face extension on TTY.
Eli Zaretskii <eliz@gnu.org>
parents:
107640
diff
changeset
|
2039 /* FIXME: Should we mirror GC for R2L lines? */ |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2040 SET_GLYPH_FROM_GLYPH_CODE (glyph, gc); |
|
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2041 spec_glyph_lookup_face (XWINDOW (it->window), &glyph); |
| 25002 | 2042 } |
| 2043 } | |
| 2044 else | |
| 2045 abort (); | |
|
63549
bda22724fc82
(produce_special_glyphs): Use spec_glyph_lookup_face.
Richard M. Stallman <rms@gnu.org>
parents:
61591
diff
changeset
|
2046 |
|
110131
cca2a663ef92
Fix handling of 8-bit characters in a display table.
Kenichi Handa <handa@m17n.org>
parents:
110128
diff
changeset
|
2047 temp_it.c = temp_it.char_to_display = GLYPH_CHAR (glyph); |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2048 temp_it.face_id = GLYPH_FACE (glyph); |
|
63549
bda22724fc82
(produce_special_glyphs): Use spec_glyph_lookup_face.
Richard M. Stallman <rms@gnu.org>
parents:
61591
diff
changeset
|
2049 temp_it.len = CHAR_BYTES (temp_it.c); |
|
bda22724fc82
(produce_special_glyphs): Use spec_glyph_lookup_face.
Richard M. Stallman <rms@gnu.org>
parents:
61591
diff
changeset
|
2050 |
|
bda22724fc82
(produce_special_glyphs): Use spec_glyph_lookup_face.
Richard M. Stallman <rms@gnu.org>
parents:
61591
diff
changeset
|
2051 produce_glyphs (&temp_it); |
|
bda22724fc82
(produce_special_glyphs): Use spec_glyph_lookup_face.
Richard M. Stallman <rms@gnu.org>
parents:
61591
diff
changeset
|
2052 it->pixel_width = temp_it.pixel_width; |
|
bda22724fc82
(produce_special_glyphs): Use spec_glyph_lookup_face.
Richard M. Stallman <rms@gnu.org>
parents:
61591
diff
changeset
|
2053 it->nglyphs = temp_it.pixel_width; |
| 25002 | 2054 } |
| 2055 | |
| 2056 | |
| 2057 | |
| 2058 /*********************************************************************** | |
| 2059 Faces | |
| 2060 ***********************************************************************/ | |
| 2061 | |
|
28465
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
2062 /* Value is non-zero if attribute ATTR may be used. ATTR should be |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
2063 one of the enumerators from enum no_color_bit, or a bit set built |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
2064 from them. Some display attributes may not be used together with |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
2065 color; the termcap capability `NC' specifies which ones. */ |
|
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
2066 |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2067 #define MAY_USE_WITH_COLORS_P(tty, ATTR) \ |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2068 (tty->TN_max_colors > 0 \ |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2069 ? (tty->TN_no_color_video & (ATTR)) == 0 \ |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2070 : 1) |
| 25002 | 2071 |
|
63549
bda22724fc82
(produce_special_glyphs): Use spec_glyph_lookup_face.
Richard M. Stallman <rms@gnu.org>
parents:
61591
diff
changeset
|
2072 /* Turn appearances of face FACE_ID on tty frame F on. |
|
bda22724fc82
(produce_special_glyphs): Use spec_glyph_lookup_face.
Richard M. Stallman <rms@gnu.org>
parents:
61591
diff
changeset
|
2073 FACE_ID is a realized face ID number, in the face cache. */ |
| 25002 | 2074 |
| 2075 static void | |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
2076 turn_on_face (struct frame *f, int face_id) |
| 25002 | 2077 { |
| 2078 struct face *face = FACE_FROM_ID (f, face_id); | |
|
37477
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2079 long fg = face->foreground; |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2080 long bg = face->background; |
|
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
82988
diff
changeset
|
2081 struct tty_display_info *tty = FRAME_TTY (f); |
| 25002 | 2082 |
|
37477
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2083 /* Do this first because TS_end_standout_mode may be the same |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2084 as TS_exit_attribute_mode, which turns all appearances off. */ |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2085 if (MAY_USE_WITH_COLORS_P (tty, NC_REVERSE)) |
|
37477
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2086 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2087 if (tty->TN_max_colors > 0) |
|
37477
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2088 { |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2089 if (fg >= 0 && bg >= 0) |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2090 { |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2091 /* If the terminal supports colors, we can set them |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2092 below without using reverse video. The face's fg |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2093 and bg colors are set as they should appear on |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2094 the screen, i.e. they take the inverse-video'ness |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2095 of the face already into account. */ |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2096 } |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2097 else if (inverse_video) |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2098 { |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2099 if (fg == FACE_TTY_DEFAULT_FG_COLOR |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2100 || bg == FACE_TTY_DEFAULT_BG_COLOR) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2101 tty_toggle_highlight (tty); |
|
37477
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2102 } |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2103 else |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2104 { |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2105 if (fg == FACE_TTY_DEFAULT_BG_COLOR |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2106 || bg == FACE_TTY_DEFAULT_FG_COLOR) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2107 tty_toggle_highlight (tty); |
|
37477
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2108 } |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2109 } |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2110 else |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2111 { |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2112 /* If we can't display colors, use reverse video |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2113 if the face specifies that. */ |
|
37499
b8ff92361366
(turn_on_face): Fix reverse video handling on terminals
Gerd Moellmann <gerd@gnu.org>
parents:
37477
diff
changeset
|
2114 if (inverse_video) |
|
b8ff92361366
(turn_on_face): Fix reverse video handling on terminals
Gerd Moellmann <gerd@gnu.org>
parents:
37477
diff
changeset
|
2115 { |
|
b8ff92361366
(turn_on_face): Fix reverse video handling on terminals
Gerd Moellmann <gerd@gnu.org>
parents:
37477
diff
changeset
|
2116 if (fg == FACE_TTY_DEFAULT_FG_COLOR |
|
b8ff92361366
(turn_on_face): Fix reverse video handling on terminals
Gerd Moellmann <gerd@gnu.org>
parents:
37477
diff
changeset
|
2117 || bg == FACE_TTY_DEFAULT_BG_COLOR) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2118 tty_toggle_highlight (tty); |
|
37499
b8ff92361366
(turn_on_face): Fix reverse video handling on terminals
Gerd Moellmann <gerd@gnu.org>
parents:
37477
diff
changeset
|
2119 } |
|
b8ff92361366
(turn_on_face): Fix reverse video handling on terminals
Gerd Moellmann <gerd@gnu.org>
parents:
37477
diff
changeset
|
2120 else |
|
b8ff92361366
(turn_on_face): Fix reverse video handling on terminals
Gerd Moellmann <gerd@gnu.org>
parents:
37477
diff
changeset
|
2121 { |
|
b8ff92361366
(turn_on_face): Fix reverse video handling on terminals
Gerd Moellmann <gerd@gnu.org>
parents:
37477
diff
changeset
|
2122 if (fg == FACE_TTY_DEFAULT_BG_COLOR |
|
b8ff92361366
(turn_on_face): Fix reverse video handling on terminals
Gerd Moellmann <gerd@gnu.org>
parents:
37477
diff
changeset
|
2123 || bg == FACE_TTY_DEFAULT_FG_COLOR) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2124 tty_toggle_highlight (tty); |
|
37499
b8ff92361366
(turn_on_face): Fix reverse video handling on terminals
Gerd Moellmann <gerd@gnu.org>
parents:
37477
diff
changeset
|
2125 } |
|
37477
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2126 } |
|
6a7ab4d2c7b3
(toggle_highlight): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
35448
diff
changeset
|
2127 } |
| 25002 | 2128 |
|
103605
d6ac90c70d24
* term.c (turn_on_face): Allow simultaneously bold and dim
Chong Yidong <cyd@stupidchicken.com>
parents:
103114
diff
changeset
|
2129 if (face->tty_bold_p && MAY_USE_WITH_COLORS_P (tty, NC_BOLD)) |
|
d6ac90c70d24
* term.c (turn_on_face): Allow simultaneously bold and dim
Chong Yidong <cyd@stupidchicken.com>
parents:
103114
diff
changeset
|
2130 OUTPUT1_IF (tty, tty->TS_enter_bold_mode); |
|
d6ac90c70d24
* term.c (turn_on_face): Allow simultaneously bold and dim
Chong Yidong <cyd@stupidchicken.com>
parents:
103114
diff
changeset
|
2131 |
|
d6ac90c70d24
* term.c (turn_on_face): Allow simultaneously bold and dim
Chong Yidong <cyd@stupidchicken.com>
parents:
103114
diff
changeset
|
2132 if (face->tty_dim_p && MAY_USE_WITH_COLORS_P (tty, NC_DIM)) |
|
d6ac90c70d24
* term.c (turn_on_face): Allow simultaneously bold and dim
Chong Yidong <cyd@stupidchicken.com>
parents:
103114
diff
changeset
|
2133 OUTPUT1_IF (tty, tty->TS_enter_dim_mode); |
| 25002 | 2134 |
| 2135 /* Alternate charset and blinking not yet used. */ | |
|
28465
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
2136 if (face->tty_alt_charset_p |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2137 && MAY_USE_WITH_COLORS_P (tty, NC_ALT_CHARSET)) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2138 OUTPUT1_IF (tty, tty->TS_enter_alt_charset_mode); |
| 25002 | 2139 |
|
28465
113efc964095
(TN_no_color_video): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
28200
diff
changeset
|
2140 if (face->tty_blinking_p |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2141 && MAY_USE_WITH_COLORS_P (tty, NC_BLINK)) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2142 OUTPUT1_IF (tty, tty->TS_enter_blink_mode); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2143 |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2144 if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE)) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2145 OUTPUT1_IF (tty, tty->TS_enter_underline_mode); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2146 |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2147 if (tty->TN_max_colors > 0) |
| 25002 | 2148 { |
|
65072
462eb3df5c58
(turn_on_face): Check for TS_set_foreground and
Juri Linkov <juri@jurta.org>
parents:
64773
diff
changeset
|
2149 char *ts, *p; |
|
462eb3df5c58
(turn_on_face): Check for TS_set_foreground and
Juri Linkov <juri@jurta.org>
parents:
64773
diff
changeset
|
2150 |
|
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
2151 ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground; |
|
65072
462eb3df5c58
(turn_on_face): Check for TS_set_foreground and
Juri Linkov <juri@jurta.org>
parents:
64773
diff
changeset
|
2152 if (fg >= 0 && ts) |
| 25002 | 2153 { |
|
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
2154 p = tparam (ts, NULL, 0, (int) fg); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
2155 OUTPUT (tty, p); |
| 25002 | 2156 xfree (p); |
| 2157 } | |
| 2158 | |
|
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
2159 ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background; |
|
65072
462eb3df5c58
(turn_on_face): Check for TS_set_foreground and
Juri Linkov <juri@jurta.org>
parents:
64773
diff
changeset
|
2160 if (bg >= 0 && ts) |
| 25002 | 2161 { |
|
83353
532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
2162 p = tparam (ts, NULL, 0, (int) bg); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
2163 OUTPUT (tty, p); |
| 25002 | 2164 xfree (p); |
| 2165 } | |
| 2166 } | |
| 2167 } | |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
2168 |
| 25002 | 2169 |
| 2170 /* Turn off appearances of face FACE_ID on tty frame F. */ | |
| 2171 | |
| 2172 static void | |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
2173 turn_off_face (struct frame *f, int face_id) |
| 25002 | 2174 { |
| 2175 struct face *face = FACE_FROM_ID (f, face_id); | |
|
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
82988
diff
changeset
|
2176 struct tty_display_info *tty = FRAME_TTY (f); |
| 25002 | 2177 |
| 2178 xassert (face != NULL); | |
| 2179 | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2180 if (tty->TS_exit_attribute_mode) |
| 25002 | 2181 { |
| 2182 /* Capability "me" will turn off appearance modes double-bright, | |
| 2183 half-bright, reverse-video, standout, underline. It may or | |
| 2184 may not turn off alt-char-mode. */ | |
| 2185 if (face->tty_bold_p | |
| 2186 || face->tty_dim_p | |
| 2187 || face->tty_reverse_p | |
| 2188 || face->tty_alt_charset_p | |
| 2189 || face->tty_blinking_p | |
| 2190 || face->tty_underline_p) | |
|
30848
fc80dcfc32cd
(write_glyphs): Also turn off inverse video after turning
Gerd Moellmann <gerd@gnu.org>
parents:
30836
diff
changeset
|
2191 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2192 OUTPUT1_IF (tty, tty->TS_exit_attribute_mode); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2193 if (strcmp (tty->TS_exit_attribute_mode, tty->TS_end_standout_mode) == 0) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2194 tty->standout_mode = 0; |
|
30848
fc80dcfc32cd
(write_glyphs): Also turn off inverse video after turning
Gerd Moellmann <gerd@gnu.org>
parents:
30836
diff
changeset
|
2195 } |
| 25002 | 2196 |
| 2197 if (face->tty_alt_charset_p) | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2198 OUTPUT_IF (tty, tty->TS_exit_alt_charset_mode); |
| 25002 | 2199 } |
| 2200 else | |
| 2201 { | |
| 2202 /* If we don't have "me" we can only have those appearances | |
| 2203 that have exit sequences defined. */ | |
| 2204 if (face->tty_alt_charset_p) | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2205 OUTPUT_IF (tty, tty->TS_exit_alt_charset_mode); |
| 25002 | 2206 |
|
40086
050b19294988
(TN_standout_width, TF_xs, TN_magic_cookie_glitch_ul): Variables removed.
Miles Bader <miles@gnu.org>
parents:
40081
diff
changeset
|
2207 if (face->tty_underline_p) |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2208 OUTPUT_IF (tty, tty->TS_exit_underline_mode); |
| 25002 | 2209 } |
| 2210 | |
| 2211 /* Switch back to default colors. */ | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2212 if (tty->TN_max_colors > 0 |
|
26902
264b83a3a688
Changes for separate unspecified foreground and background colors
Eli Zaretskii <eliz@gnu.org>
parents:
26871
diff
changeset
|
2213 && ((face->foreground != FACE_TTY_DEFAULT_COLOR |
|
264b83a3a688
Changes for separate unspecified foreground and background colors
Eli Zaretskii <eliz@gnu.org>
parents:
26871
diff
changeset
|
2214 && face->foreground != FACE_TTY_DEFAULT_FG_COLOR) |
|
264b83a3a688
Changes for separate unspecified foreground and background colors
Eli Zaretskii <eliz@gnu.org>
parents:
26871
diff
changeset
|
2215 || (face->background != FACE_TTY_DEFAULT_COLOR |
|
264b83a3a688
Changes for separate unspecified foreground and background colors
Eli Zaretskii <eliz@gnu.org>
parents:
26871
diff
changeset
|
2216 && face->background != FACE_TTY_DEFAULT_BG_COLOR))) |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2217 OUTPUT1_IF (tty, tty->TS_orig_pair); |
| 25002 | 2218 } |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
2219 |
|
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
2220 |
|
45522
1513f6afe56f
(tty_capable_p): New function.
Miles Bader <miles@gnu.org>
parents:
44890
diff
changeset
|
2221 /* Return non-zero if the terminal on frame F supports all of the |
|
1513f6afe56f
(tty_capable_p): New function.
Miles Bader <miles@gnu.org>
parents:
44890
diff
changeset
|
2222 capabilities in CAPS simultaneously, with foreground and background |
|
1513f6afe56f
(tty_capable_p): New function.
Miles Bader <miles@gnu.org>
parents:
44890
diff
changeset
|
2223 colors FG and BG. */ |
|
1513f6afe56f
(tty_capable_p): New function.
Miles Bader <miles@gnu.org>
parents:
44890
diff
changeset
|
2224 |
| 45548 | 2225 int |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
2226 tty_capable_p (struct tty_display_info *tty, unsigned int caps, |
|
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
2227 unsigned long fg, unsigned long bg) |
|
45522
1513f6afe56f
(tty_capable_p): New function.
Miles Bader <miles@gnu.org>
parents:
44890
diff
changeset
|
2228 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2229 #define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \ |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2230 if ((caps & (cap)) && (!(TS) || !MAY_USE_WITH_COLORS_P(tty, NC_bit))) \ |
|
45522
1513f6afe56f
(tty_capable_p): New function.
Miles Bader <miles@gnu.org>
parents:
44890
diff
changeset
|
2231 return 0; |
|
1513f6afe56f
(tty_capable_p): New function.
Miles Bader <miles@gnu.org>
parents:
44890
diff
changeset
|
2232 |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2233 TTY_CAPABLE_P_TRY (tty, TTY_CAP_INVERSE, tty->TS_standout_mode, NC_REVERSE); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2234 TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE, tty->TS_enter_underline_mode, NC_UNDERLINE); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2235 TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD, tty->TS_enter_bold_mode, NC_BOLD); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2236 TTY_CAPABLE_P_TRY (tty, TTY_CAP_DIM, tty->TS_enter_dim_mode, NC_DIM); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2237 TTY_CAPABLE_P_TRY (tty, TTY_CAP_BLINK, tty->TS_enter_blink_mode, NC_BLINK); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2238 TTY_CAPABLE_P_TRY (tty, TTY_CAP_ALT_CHARSET, tty->TS_enter_alt_charset_mode, NC_ALT_CHARSET); |
|
45522
1513f6afe56f
(tty_capable_p): New function.
Miles Bader <miles@gnu.org>
parents:
44890
diff
changeset
|
2239 |
|
1513f6afe56f
(tty_capable_p): New function.
Miles Bader <miles@gnu.org>
parents:
44890
diff
changeset
|
2240 /* We can do it! */ |
|
1513f6afe56f
(tty_capable_p): New function.
Miles Bader <miles@gnu.org>
parents:
44890
diff
changeset
|
2241 return 1; |
|
1513f6afe56f
(tty_capable_p): New function.
Miles Bader <miles@gnu.org>
parents:
44890
diff
changeset
|
2242 } |
|
1513f6afe56f
(tty_capable_p): New function.
Miles Bader <miles@gnu.org>
parents:
44890
diff
changeset
|
2243 |
| 25002 | 2244 /* Return non-zero if the terminal is capable to display colors. */ |
| 2245 | |
| 2246 DEFUN ("tty-display-color-p", Ftty_display_color_p, Stty_display_color_p, | |
|
27087
8de2d17323c2
(Ftty_display_color_p): Accept an optional argument FRAME.
Eli Zaretskii <eliz@gnu.org>
parents:
27085
diff
changeset
|
2247 0, 1, 0, |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2248 doc: /* Return non-nil if the tty device TERMINAL can display colors. |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2249 |
|
103047
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2250 TERMINAL can be a terminal object, a frame, or nil (meaning the |
|
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2251 selected frame's terminal). This function always returns nil if |
|
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2252 TERMINAL does not refer to a text-only terminal. */) |
|
109179
8cfee7d2955f
Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109165
diff
changeset
|
2253 (Lisp_Object terminal) |
| 25002 | 2254 { |
|
83512
5d328dadd0f4
Make `tty-display-color-p' follow its doc string. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83502
diff
changeset
|
2255 struct terminal *t = get_tty_terminal (terminal, 0); |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2256 if (!t) |
|
83004
7900111db01c
Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
82995
diff
changeset
|
2257 return Qnil; |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
2258 else |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2259 return t->display_info.tty->TN_max_colors > 0 ? Qt : Qnil; |
| 25002 | 2260 } |
| 2261 | |
|
42954
e514d4931d6f
(Ftty_display_color_cells): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
42808
diff
changeset
|
2262 /* Return the number of supported colors. */ |
|
e514d4931d6f
(Ftty_display_color_cells): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
42808
diff
changeset
|
2263 DEFUN ("tty-display-color-cells", Ftty_display_color_cells, |
|
e514d4931d6f
(Ftty_display_color_cells): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
42808
diff
changeset
|
2264 Stty_display_color_cells, 0, 1, 0, |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2265 doc: /* Return the number of colors supported by the tty device TERMINAL. |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2266 |
|
103047
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2267 TERMINAL can be a terminal object, a frame, or nil (meaning the |
|
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2268 selected frame's terminal). This function always returns 0 if |
|
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2269 TERMINAL does not refer to a text-only terminal. */) |
|
109179
8cfee7d2955f
Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109165
diff
changeset
|
2270 (Lisp_Object terminal) |
|
42954
e514d4931d6f
(Ftty_display_color_cells): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
42808
diff
changeset
|
2271 { |
|
83512
5d328dadd0f4
Make `tty-display-color-p' follow its doc string. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83502
diff
changeset
|
2272 struct terminal *t = get_tty_terminal (terminal, 0); |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2273 if (!t) |
|
83161
8d62eda26760
Fix byte-compile errors during bootstrap. (Reported by Juraj Kubelka.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83158
diff
changeset
|
2274 return make_number (0); |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
2275 else |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2276 return make_number (t->display_info.tty->TN_max_colors); |
|
42954
e514d4931d6f
(Ftty_display_color_cells): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
42808
diff
changeset
|
2277 } |
|
e514d4931d6f
(Ftty_display_color_cells): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
42808
diff
changeset
|
2278 |
| 97658 | 2279 #ifndef DOS_NT |
| 25002 | 2280 |
|
78566
a23949b99eb1
Tweak previous change (don't init statics).
Glenn Morris <rgm@gnu.org>
parents:
78563
diff
changeset
|
2281 /* Declare here rather than in the function, as in the rest of Emacs, |
|
a23949b99eb1
Tweak previous change (don't init statics).
Glenn Morris <rgm@gnu.org>
parents:
78563
diff
changeset
|
2282 to work around an HPUX compiler bug (?). See |
| 78562 | 2283 http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00410.html */ |
|
78566
a23949b99eb1
Tweak previous change (don't init statics).
Glenn Morris <rgm@gnu.org>
parents:
78563
diff
changeset
|
2284 static int default_max_colors; |
|
a23949b99eb1
Tweak previous change (don't init statics).
Glenn Morris <rgm@gnu.org>
parents:
78563
diff
changeset
|
2285 static int default_max_pairs; |
|
a23949b99eb1
Tweak previous change (don't init statics).
Glenn Morris <rgm@gnu.org>
parents:
78563
diff
changeset
|
2286 static int default_no_color_video; |
|
a23949b99eb1
Tweak previous change (don't init statics).
Glenn Morris <rgm@gnu.org>
parents:
78563
diff
changeset
|
2287 static char *default_orig_pair; |
|
a23949b99eb1
Tweak previous change (don't init statics).
Glenn Morris <rgm@gnu.org>
parents:
78563
diff
changeset
|
2288 static char *default_set_foreground; |
|
a23949b99eb1
Tweak previous change (don't init statics).
Glenn Morris <rgm@gnu.org>
parents:
78563
diff
changeset
|
2289 static char *default_set_background; |
|
78560
44134c35ea57
Philippe Waroquiers <philippe.waroquiers at eurocontrol.int>
Glenn Morris <rgm@gnu.org>
parents:
78260
diff
changeset
|
2290 |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2291 /* Save or restore the default color-related capabilities of this |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2292 terminal. */ |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2293 static void |
|
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
82988
diff
changeset
|
2294 tty_default_color_capabilities (struct tty_display_info *tty, int save) |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2295 { |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2296 |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2297 if (save) |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2298 { |
|
95481
4390d64d3328
Make "xfree (NULL)" a no-op; remove useless if-before-xfree.
Jim Meyering <jim@meyering.net>
parents:
94963
diff
changeset
|
2299 xfree (default_orig_pair); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2300 default_orig_pair = tty->TS_orig_pair ? xstrdup (tty->TS_orig_pair) : NULL; |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2301 |
|
95481
4390d64d3328
Make "xfree (NULL)" a no-op; remove useless if-before-xfree.
Jim Meyering <jim@meyering.net>
parents:
94963
diff
changeset
|
2302 xfree (default_set_foreground); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2303 default_set_foreground = tty->TS_set_foreground ? xstrdup (tty->TS_set_foreground) |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2304 : NULL; |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2305 |
|
95481
4390d64d3328
Make "xfree (NULL)" a no-op; remove useless if-before-xfree.
Jim Meyering <jim@meyering.net>
parents:
94963
diff
changeset
|
2306 xfree (default_set_background); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2307 default_set_background = tty->TS_set_background ? xstrdup (tty->TS_set_background) |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2308 : NULL; |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2309 |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2310 default_max_colors = tty->TN_max_colors; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2311 default_max_pairs = tty->TN_max_pairs; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2312 default_no_color_video = tty->TN_no_color_video; |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2313 } |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2314 else |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2315 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2316 tty->TS_orig_pair = default_orig_pair; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2317 tty->TS_set_foreground = default_set_foreground; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2318 tty->TS_set_background = default_set_background; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2319 tty->TN_max_colors = default_max_colors; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2320 tty->TN_max_pairs = default_max_pairs; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2321 tty->TN_no_color_video = default_no_color_video; |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2322 } |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2323 } |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2324 |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2325 /* Setup one of the standard tty color schemes according to MODE. |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2326 MODE's value is generally the number of colors which we want to |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2327 support; zero means set up for the default capabilities, the ones |
|
83341
76e51706154e
Rename term_init to init_tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83338
diff
changeset
|
2328 we saw at init_tty time; -1 means turn off color support. */ |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2329 static void |
|
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
82988
diff
changeset
|
2330 tty_setup_colors (struct tty_display_info *tty, int mode) |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2331 { |
|
52652
31a3a92c1a03
(tty_setup_colors): Treat any negative argument as -1.
Eli Zaretskii <eliz@gnu.org>
parents:
52579
diff
changeset
|
2332 /* Canonicalize all negative values of MODE. */ |
|
31a3a92c1a03
(tty_setup_colors): Treat any negative argument as -1.
Eli Zaretskii <eliz@gnu.org>
parents:
52579
diff
changeset
|
2333 if (mode < -1) |
|
31a3a92c1a03
(tty_setup_colors): Treat any negative argument as -1.
Eli Zaretskii <eliz@gnu.org>
parents:
52579
diff
changeset
|
2334 mode = -1; |
|
31a3a92c1a03
(tty_setup_colors): Treat any negative argument as -1.
Eli Zaretskii <eliz@gnu.org>
parents:
52579
diff
changeset
|
2335 |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2336 switch (mode) |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2337 { |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2338 case -1: /* no colors at all */ |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2339 tty->TN_max_colors = 0; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2340 tty->TN_max_pairs = 0; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2341 tty->TN_no_color_video = 0; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2342 tty->TS_set_foreground = tty->TS_set_background = tty->TS_orig_pair = NULL; |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2343 break; |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2344 case 0: /* default colors, if any */ |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2345 default: |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2346 tty_default_color_capabilities (tty, 0); |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2347 break; |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2348 case 8: /* 8 standard ANSI colors */ |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2349 tty->TS_orig_pair = "\033[0m"; |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2350 #ifdef TERMINFO |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2351 tty->TS_set_foreground = "\033[3%p1%dm"; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2352 tty->TS_set_background = "\033[4%p1%dm"; |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2353 #else |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2354 tty->TS_set_foreground = "\033[3%dm"; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2355 tty->TS_set_background = "\033[4%dm"; |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2356 #endif |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2357 tty->TN_max_colors = 8; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2358 tty->TN_max_pairs = 64; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
2359 tty->TN_no_color_video = 0; |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2360 break; |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2361 } |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2362 } |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2363 |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2364 void |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
2365 set_tty_color_mode (struct tty_display_info *tty, struct frame *f) |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2366 { |
|
107984
bef5d1738c0b
Make variable forwarding explicit rather the using special values.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
107847
diff
changeset
|
2367 Lisp_Object tem, val; |
|
93883
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2368 Lisp_Object color_mode; |
|
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2369 int mode; |
|
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2370 Lisp_Object tty_color_mode_alist |
|
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2371 = Fintern_soft (build_string ("tty-color-mode-alist"), Qnil); |
|
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2372 |
|
93984
ddcecf318c8a
(set_tty_color_mode): Left over typo.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93883
diff
changeset
|
2373 tem = assq_no_quit (Qtty_color_mode, f->param_alist); |
|
93883
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2374 val = CONSP (tem) ? XCDR (tem) : Qnil; |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2375 |
|
52579
611336925095
(set_tty_color_mode): Use INTEGERP to test whether a
Eli Zaretskii <eliz@gnu.org>
parents:
52401
diff
changeset
|
2376 if (INTEGERP (val)) |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2377 color_mode = val; |
|
107984
bef5d1738c0b
Make variable forwarding explicit rather the using special values.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
107847
diff
changeset
|
2378 else if (SYMBOLP (tty_color_mode_alist)) |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2379 { |
|
107984
bef5d1738c0b
Make variable forwarding explicit rather the using special values.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
107847
diff
changeset
|
2380 tem = Fassq (val, Fsymbol_value (tty_color_mode_alist)); |
|
93883
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2381 color_mode = CONSP (tem) ? XCDR (tem) : Qnil; |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2382 } |
|
107984
bef5d1738c0b
Make variable forwarding explicit rather the using special values.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
107847
diff
changeset
|
2383 else |
|
bef5d1738c0b
Make variable forwarding explicit rather the using special values.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
107847
diff
changeset
|
2384 color_mode = Qnil; |
|
52681
2036a4307b6c
(set_tty_color_mode): Calculate current_mode_spec regardless of value of VAL.
Richard M. Stallman <rms@gnu.org>
parents:
52652
diff
changeset
|
2385 |
|
93883
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2386 mode = INTEGERP (color_mode) ? XINT (color_mode) : 0; |
|
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2387 |
|
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2388 if (mode != tty->previous_color_mode) |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2389 { |
|
93883
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2390 Lisp_Object funsym = intern ("tty-set-up-initial-frame-faces"); |
|
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2391 tty->previous_color_mode = mode; |
|
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2392 tty_setup_colors (tty , mode); |
|
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2393 /* This recomputes all the faces given the new color definitions. */ |
|
722fdbc7a012
* xdisp.c (redisplay_internal): Reset tty's color_mode when switching
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92281
diff
changeset
|
2394 safe_call (1, &funsym); |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2395 } |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2396 } |
|
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
2397 |
| 97658 | 2398 #endif /* !DOS_NT */ |
| 25002 | 2399 |
| 2400 | |
|
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
2401 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2402 /* Return the tty display object specified by TERMINAL. */ |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2403 |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2404 struct terminal * |
|
83512
5d328dadd0f4
Make `tty-display-color-p' follow its doc string. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83502
diff
changeset
|
2405 get_tty_terminal (Lisp_Object terminal, int throw) |
|
83167
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83161
diff
changeset
|
2406 { |
|
83512
5d328dadd0f4
Make `tty-display-color-p' follow its doc string. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83502
diff
changeset
|
2407 struct terminal *t = get_terminal (terminal, throw); |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2408 |
| 97658 | 2409 if (t && t->type != output_termcap && t->type != output_msdos_raw) |
|
83512
5d328dadd0f4
Make `tty-display-color-p' follow its doc string. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83502
diff
changeset
|
2410 { |
|
5d328dadd0f4
Make `tty-display-color-p' follow its doc string. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83502
diff
changeset
|
2411 if (throw) |
|
5d328dadd0f4
Make `tty-display-color-p' follow its doc string. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83502
diff
changeset
|
2412 error ("Device %d is not a termcap terminal device", t->id); |
|
5d328dadd0f4
Make `tty-display-color-p' follow its doc string. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83502
diff
changeset
|
2413 else |
|
5d328dadd0f4
Make `tty-display-color-p' follow its doc string. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83502
diff
changeset
|
2414 return NULL; |
|
5d328dadd0f4
Make `tty-display-color-p' follow its doc string. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83502
diff
changeset
|
2415 } |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2416 |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2417 return t; |
|
83167
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83161
diff
changeset
|
2418 } |
|
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83161
diff
changeset
|
2419 |
|
83525
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
2420 /* Return an active termcap device that uses the tty device with the |
|
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
2421 given name. |
|
83167
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83161
diff
changeset
|
2422 |
|
83342
9216636c02fc
Rename `struct display' to `struct device'. Update function, parameter and variable names accordingly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83341
diff
changeset
|
2423 This function ignores suspended devices. |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
2424 |
|
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
2425 Returns NULL if the named terminal device is not opened. */ |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2426 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2427 struct terminal * |
|
109726
64732fa6188a
Use const char* instead of char*.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109664
diff
changeset
|
2428 get_named_tty (const char *name) |
|
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
2429 { |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2430 struct terminal *t; |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2431 |
|
83525
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
2432 if (!name) |
|
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
2433 abort (); |
|
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
2434 |
|
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
2435 for (t = terminal_list; t; t = t->next_terminal) |
|
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
2436 { |
|
97720
b2594691f8f2
(get_named_tty): Fix last change.
Eli Zaretskii <eliz@gnu.org>
parents:
97658
diff
changeset
|
2437 if ((t->type == output_termcap || t->type == output_msdos_raw) |
|
83525
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
2438 && !strcmp (t->display_info.tty->name, name) |
|
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
2439 && TERMINAL_ACTIVE_P (t)) |
|
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
2440 return t; |
|
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
2441 } |
|
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
2442 |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
2443 return 0; |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
2444 } |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
2445 |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
2446 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2447 DEFUN ("tty-type", Ftty_type, Stty_type, 0, 1, 0, |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2448 doc: /* Return the type of the tty device that TERMINAL uses. |
|
83525
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
2449 Returns nil if TERMINAL is not on a tty device. |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2450 |
|
103047
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2451 TERMINAL can be a terminal object, a frame, or nil (meaning the |
|
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2452 selected frame's terminal). */) |
|
109179
8cfee7d2955f
Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109165
diff
changeset
|
2453 (Lisp_Object terminal) |
|
82988
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
2454 { |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2455 struct terminal *t = get_terminal (terminal, 1); |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2456 |
| 97658 | 2457 if (t->type != output_termcap && t->type != output_msdos_raw) |
|
83525
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
2458 return Qnil; |
|
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
2459 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2460 if (t->display_info.tty->type) |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2461 return build_string (t->display_info.tty->type); |
|
82988
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
2462 else |
|
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
2463 return Qnil; |
|
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
2464 } |
|
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
2465 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2466 DEFUN ("controlling-tty-p", Fcontrolling_tty_p, Scontrolling_tty_p, 0, 1, 0, |
| 97658 | 2467 doc: /* Return non-nil if TERMINAL is the controlling tty of the Emacs process. |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2468 |
|
103047
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2469 TERMINAL can be a terminal object, a frame, or nil (meaning the |
|
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2470 selected frame's terminal). This function always returns nil if |
|
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2471 TERMINAL is not on a tty device. */) |
|
109179
8cfee7d2955f
Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109165
diff
changeset
|
2472 (Lisp_Object terminal) |
|
83173
6b4b299e2cd5
Fix suspend-frame on the controlling tty (reported by Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83168
diff
changeset
|
2473 { |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2474 struct terminal *t = get_terminal (terminal, 1); |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2475 |
| 97658 | 2476 if ((t->type != output_termcap && t->type != output_msdos_raw) |
| 2477 || strcmp (t->display_info.tty->name, DEV_TTY) != 0) | |
|
83173
6b4b299e2cd5
Fix suspend-frame on the controlling tty (reported by Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83168
diff
changeset
|
2478 return Qnil; |
|
6b4b299e2cd5
Fix suspend-frame on the controlling tty (reported by Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83168
diff
changeset
|
2479 else |
|
6b4b299e2cd5
Fix suspend-frame on the controlling tty (reported by Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83168
diff
changeset
|
2480 return Qt; |
|
6b4b299e2cd5
Fix suspend-frame on the controlling tty (reported by Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83168
diff
changeset
|
2481 } |
|
6b4b299e2cd5
Fix suspend-frame on the controlling tty (reported by Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83168
diff
changeset
|
2482 |
|
83311
c016d82bf02b
Merged from miles@gnu.org--gnu-2005 (patch 423-434)
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
2483 DEFUN ("tty-no-underline", Ftty_no_underline, Stty_no_underline, 0, 1, 0, |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2484 doc: /* Declare that the tty used by TERMINAL does not handle underlining. |
|
83311
c016d82bf02b
Merged from miles@gnu.org--gnu-2005 (patch 423-434)
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
2485 This is used to override the terminfo data, for certain terminals that |
|
c016d82bf02b
Merged from miles@gnu.org--gnu-2005 (patch 423-434)
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
2486 do not really do underlining, but say that they do. This function has |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2487 no effect if used on a non-tty terminal. |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2488 |
|
103047
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2489 TERMINAL can be a terminal object, a frame or nil (meaning the |
|
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2490 selected frame's terminal). This function always returns nil if |
|
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2491 TERMINAL does not refer to a text-only terminal. */) |
|
109179
8cfee7d2955f
Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109165
diff
changeset
|
2492 (Lisp_Object terminal) |
|
83311
c016d82bf02b
Merged from miles@gnu.org--gnu-2005 (patch 423-434)
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
2493 { |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2494 struct terminal *t = get_terminal (terminal, 1); |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2495 |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2496 if (t->type == output_termcap) |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2497 t->display_info.tty->TS_enter_underline_mode = 0; |
|
83311
c016d82bf02b
Merged from miles@gnu.org--gnu-2005 (patch 423-434)
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
2498 return Qnil; |
|
c016d82bf02b
Merged from miles@gnu.org--gnu-2005 (patch 423-434)
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
2499 } |
|
c016d82bf02b
Merged from miles@gnu.org--gnu-2005 (patch 423-434)
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
2500 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2501 |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2502 |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2503 DEFUN ("suspend-tty", Fsuspend_tty, Ssuspend_tty, 0, 1, 0, |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2504 doc: /* Suspend the terminal device TTY. |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2505 |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2506 The device is restored to its default state, and Emacs ceases all |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2507 access to the tty device. Frames that use the device are not deleted, |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2508 but input is not read from them and if they change, their display is |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2509 not updated. |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2510 |
|
103047
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2511 TTY may be a terminal object, a frame, or nil for the terminal device |
|
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2512 of the currently selected frame. |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2513 |
|
83891
dab32bc3edc8
* server.el (server-start, server-unload-hook): Undo previous
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83889
diff
changeset
|
2514 This function runs `suspend-tty-functions' after suspending the |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2515 device. The functions are run with one arg, the id of the suspended |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2516 terminal device. |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2517 |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2518 `suspend-tty' does nothing if it is called on a device that is already |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2519 suspended. |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2520 |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2521 A suspended tty may be resumed by calling `resume-tty' on it. */) |
|
109179
8cfee7d2955f
Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109165
diff
changeset
|
2522 (Lisp_Object tty) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2523 { |
|
83512
5d328dadd0f4
Make `tty-display-color-p' follow its doc string. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83502
diff
changeset
|
2524 struct terminal *t = get_tty_terminal (tty, 1); |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2525 FILE *f; |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2526 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2527 if (!t) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2528 error ("Unknown tty device"); |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2529 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2530 f = t->display_info.tty->input; |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2531 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2532 if (f) |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2533 { |
|
84769
cbcb89640ef2
* xt-mouse.el (xterm-mouse-mode): Re-enable suspend-tty-functions.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84768
diff
changeset
|
2534 /* First run `suspend-tty-functions' and then clean up the tty |
|
cbcb89640ef2
* xt-mouse.el (xterm-mouse-mode): Re-enable suspend-tty-functions.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84768
diff
changeset
|
2535 state because `suspend-tty-functions' might need to change |
|
cbcb89640ef2
* xt-mouse.el (xterm-mouse-mode): Re-enable suspend-tty-functions.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84768
diff
changeset
|
2536 the tty state. */ |
|
cbcb89640ef2
* xt-mouse.el (xterm-mouse-mode): Re-enable suspend-tty-functions.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84768
diff
changeset
|
2537 if (!NILP (Vrun_hooks)) |
|
cbcb89640ef2
* xt-mouse.el (xterm-mouse-mode): Re-enable suspend-tty-functions.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84768
diff
changeset
|
2538 { |
|
cbcb89640ef2
* xt-mouse.el (xterm-mouse-mode): Re-enable suspend-tty-functions.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84768
diff
changeset
|
2539 Lisp_Object args[2]; |
|
cbcb89640ef2
* xt-mouse.el (xterm-mouse-mode): Re-enable suspend-tty-functions.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84768
diff
changeset
|
2540 args[0] = intern ("suspend-tty-functions"); |
|
cbcb89640ef2
* xt-mouse.el (xterm-mouse-mode): Re-enable suspend-tty-functions.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84768
diff
changeset
|
2541 XSETTERMINAL (args[1], t); |
|
cbcb89640ef2
* xt-mouse.el (xterm-mouse-mode): Re-enable suspend-tty-functions.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84768
diff
changeset
|
2542 Frun_hook_with_args (2, args); |
|
cbcb89640ef2
* xt-mouse.el (xterm-mouse-mode): Re-enable suspend-tty-functions.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84768
diff
changeset
|
2543 } |
|
cbcb89640ef2
* xt-mouse.el (xterm-mouse-mode): Re-enable suspend-tty-functions.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84768
diff
changeset
|
2544 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2545 reset_sys_modes (t->display_info.tty); |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2546 delete_keyboard_wait_descriptor (fileno (f)); |
| 97658 | 2547 |
| 2548 #ifndef MSDOS | |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2549 fclose (f); |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2550 if (f != t->display_info.tty->output) |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2551 fclose (t->display_info.tty->output); |
| 97658 | 2552 #endif |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2553 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2554 t->display_info.tty->input = 0; |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2555 t->display_info.tty->output = 0; |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2556 |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2557 if (FRAMEP (t->display_info.tty->top_frame)) |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2558 FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 0); |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2559 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2560 } |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2561 |
|
83521
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
2562 /* Clear display hooks to prevent further output. */ |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
2563 clear_tty_hooks (t); |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
2564 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2565 return Qnil; |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2566 } |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2567 |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2568 DEFUN ("resume-tty", Fresume_tty, Sresume_tty, 0, 1, 0, |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2569 doc: /* Resume the previously suspended terminal device TTY. |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2570 The terminal is opened and reinitialized. Frames that are on the |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2571 suspended terminal are revived. |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2572 |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2573 It is an error to resume a terminal while another terminal is active |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2574 on the same device. |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2575 |
|
83891
dab32bc3edc8
* server.el (server-start, server-unload-hook): Undo previous
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83889
diff
changeset
|
2576 This function runs `resume-tty-functions' after resuming the terminal. |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2577 The functions are run with one arg, the id of the resumed terminal |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2578 device. |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2579 |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2580 `resume-tty' does nothing if it is called on a device that is not |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2581 suspended. |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2582 |
|
103047
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2583 TTY may be a terminal object, a frame, or nil (meaning the selected |
|
997f1f1cac08
* term.c (Ftty_display_color_p, Ftty_display_color_cells)
Chong Yidong <cyd@stupidchicken.com>
parents:
102831
diff
changeset
|
2584 frame's terminal). */) |
|
109179
8cfee7d2955f
Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109165
diff
changeset
|
2585 (Lisp_Object tty) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2586 { |
|
83512
5d328dadd0f4
Make `tty-display-color-p' follow its doc string. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83502
diff
changeset
|
2587 struct terminal *t = get_tty_terminal (tty, 1); |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2588 int fd; |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2589 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2590 if (!t) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2591 error ("Unknown tty device"); |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2592 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2593 if (!t->display_info.tty->input) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2594 { |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2595 if (get_named_tty (t->display_info.tty->name)) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2596 error ("Cannot resume display while another display is active on the same device"); |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2597 |
| 97658 | 2598 #ifdef MSDOS |
| 2599 t->display_info.tty->output = stdout; | |
| 2600 t->display_info.tty->input = stdin; | |
| 2601 #else /* !MSDOS */ | |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2602 fd = emacs_open (t->display_info.tty->name, O_RDWR | O_NOCTTY, 0); |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2603 |
|
83498
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
2604 if (fd == -1) |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
2605 error ("Can not reopen tty device %s: %s", t->display_info.tty->name, strerror (errno)); |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
2606 |
|
84779
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
2607 if (strcmp (t->display_info.tty->name, DEV_TTY)) |
|
83498
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
2608 dissociate_if_controlling_tty (fd); |
|
84779
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
2609 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2610 t->display_info.tty->output = fdopen (fd, "w+"); |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2611 t->display_info.tty->input = t->display_info.tty->output; |
| 97658 | 2612 #endif |
| 2613 | |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2614 add_keyboard_wait_descriptor (fd); |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2615 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2616 if (FRAMEP (t->display_info.tty->top_frame)) |
|
101690
1009d5607716
* dispnew.c (window_change_signal): Don't try to get the size of a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
2617 { |
|
1009d5607716
* dispnew.c (window_change_signal): Don't try to get the size of a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
2618 struct frame *f = XFRAME (t->display_info.tty->top_frame); |
|
1009d5607716
* dispnew.c (window_change_signal): Don't try to get the size of a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
2619 int width, height; |
|
1009d5607716
* dispnew.c (window_change_signal): Don't try to get the size of a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
2620 int old_height = FRAME_COLS (f); |
|
1009d5607716
* dispnew.c (window_change_signal): Don't try to get the size of a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
2621 int old_width = FRAME_LINES (f); |
|
1009d5607716
* dispnew.c (window_change_signal): Don't try to get the size of a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
2622 |
|
1009d5607716
* dispnew.c (window_change_signal): Don't try to get the size of a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
2623 /* Check if terminal/window size has changed while the frame |
|
1009d5607716
* dispnew.c (window_change_signal): Don't try to get the size of a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
2624 was suspended. */ |
|
1009d5607716
* dispnew.c (window_change_signal): Don't try to get the size of a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
2625 get_tty_size (fileno (t->display_info.tty->input), &width, &height); |
|
1009d5607716
* dispnew.c (window_change_signal): Don't try to get the size of a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
2626 if (width != old_width || height != old_height) |
|
1009d5607716
* dispnew.c (window_change_signal): Don't try to get the size of a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
2627 change_frame_size (f, height, width, 0, 0, 0); |
|
1009d5607716
* dispnew.c (window_change_signal): Don't try to get the size of a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
2628 FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1); |
|
1009d5607716
* dispnew.c (window_change_signal): Don't try to get the size of a
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
2629 } |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2630 |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2631 init_sys_modes (t->display_info.tty); |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2632 |
|
83891
dab32bc3edc8
* server.el (server-start, server-unload-hook): Undo previous
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83889
diff
changeset
|
2633 /* Run `resume-tty-functions'. */ |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2634 if (!NILP (Vrun_hooks)) |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2635 { |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2636 Lisp_Object args[2]; |
|
83891
dab32bc3edc8
* server.el (server-start, server-unload-hook): Undo previous
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83889
diff
changeset
|
2637 args[0] = intern ("resume-tty-functions"); |
|
84692
0d8dd9a91520
(get_tty_terminal): Don't treat output_initial specially.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84461
diff
changeset
|
2638 XSETTERMINAL (args[1], t); |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2639 Frun_hook_with_args (2, args); |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2640 } |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2641 } |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2642 |
|
83521
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
2643 set_tty_hooks (t); |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
2644 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2645 return Qnil; |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2646 } |
|
83311
c016d82bf02b
Merged from miles@gnu.org--gnu-2005 (patch 423-434)
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
2647 |
|
82988
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
2648 |
| 25002 | 2649 /*********************************************************************** |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2650 Mouse |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2651 ***********************************************************************/ |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2652 |
|
80994
62b6aa7f8c37
Use HAVE_GPM instead of HAVE_GPM_H.
Nick Roberts <nickrob@snap.net.nz>
parents:
80979
diff
changeset
|
2653 #ifdef HAVE_GPM |
| 81107 | 2654 void |
| 2655 term_mouse_moveto (int x, int y) | |
|
81102
a00e7c5f2faa
(mouse_face_window): Rename...
Nick Roberts <nickrob@snap.net.nz>
parents:
81083
diff
changeset
|
2656 { |
|
81811
c10410a3aa36
Include unistd.h for ttyname, used in handle_one_term_event.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81308
diff
changeset
|
2657 /* TODO: how to set mouse position? |
|
81102
a00e7c5f2faa
(mouse_face_window): Rename...
Nick Roberts <nickrob@snap.net.nz>
parents:
81083
diff
changeset
|
2658 const char *name; |
|
a00e7c5f2faa
(mouse_face_window): Rename...
Nick Roberts <nickrob@snap.net.nz>
parents:
81083
diff
changeset
|
2659 int fd; |
|
a00e7c5f2faa
(mouse_face_window): Rename...
Nick Roberts <nickrob@snap.net.nz>
parents:
81083
diff
changeset
|
2660 name = (const char *) ttyname (0); |
|
a00e7c5f2faa
(mouse_face_window): Rename...
Nick Roberts <nickrob@snap.net.nz>
parents:
81083
diff
changeset
|
2661 fd = open (name, O_WRONLY); |
|
81127
d620b28641cd
(term_mouse_highlight): Remove unused variables.
Nick Roberts <nickrob@snap.net.nz>
parents:
81107
diff
changeset
|
2662 SOME_FUNCTION (x, y, fd); |
|
81102
a00e7c5f2faa
(mouse_face_window): Rename...
Nick Roberts <nickrob@snap.net.nz>
parents:
81083
diff
changeset
|
2663 close (fd); |
|
a00e7c5f2faa
(mouse_face_window): Rename...
Nick Roberts <nickrob@snap.net.nz>
parents:
81083
diff
changeset
|
2664 last_mouse_x = x; |
|
81127
d620b28641cd
(term_mouse_highlight): Remove unused variables.
Nick Roberts <nickrob@snap.net.nz>
parents:
81107
diff
changeset
|
2665 last_mouse_y = y; */ |
|
81102
a00e7c5f2faa
(mouse_face_window): Rename...
Nick Roberts <nickrob@snap.net.nz>
parents:
81083
diff
changeset
|
2666 } |
|
a00e7c5f2faa
(mouse_face_window): Rename...
Nick Roberts <nickrob@snap.net.nz>
parents:
81083
diff
changeset
|
2667 |
|
111343
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2668 /* Implementation of draw_row_with_mouse_face for TTY/GPM. */ |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2669 void |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2670 tty_draw_row_with_mouse_face (struct window *w, struct glyph_row *row, |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2671 int start_hpos, int end_hpos, |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2672 enum draw_glyphs_face draw) |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2673 { |
|
111343
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2674 int nglyphs = end_hpos - start_hpos; |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2675 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2676 struct tty_display_info *tty = FRAME_TTY (f); |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2677 int face_id = tty->mouse_highlight.mouse_face_face_id; |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2678 int save_x, save_y, pos_x, pos_y; |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2679 |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2680 if (end_hpos >= row->used[TEXT_AREA]) |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2681 nglyphs = row->used[TEXT_AREA] - start_hpos; |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2682 |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2683 pos_y = row->y + WINDOW_TOP_EDGE_Y (w); |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2684 pos_x = row->used[LEFT_MARGIN_AREA] + start_hpos + WINDOW_LEFT_EDGE_X (w); |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2685 |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2686 /* Save current cursor co-ordinates. */ |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2687 save_y = curY (tty); |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2688 save_x = curX (tty); |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2689 cursor_to (f, pos_y, pos_x); |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2690 |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2691 if (draw == DRAW_MOUSE_FACE) |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2692 tty_write_glyphs_with_face (f, row->glyphs[TEXT_AREA] + start_hpos, |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2693 nglyphs, face_id); |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2694 else if (draw == DRAW_NORMAL_TEXT) |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2695 write_glyphs (f, row->glyphs[TEXT_AREA] + start_hpos, nglyphs); |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2696 |
|
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2697 cursor_to (f, save_y, save_x); |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2698 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2699 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2700 static int |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2701 term_mouse_movement (FRAME_PTR frame, Gpm_Event *event) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2702 { |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2703 /* Has the mouse moved off the glyph it was on at the last sighting? */ |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2704 if (event->x != last_mouse_x || event->y != last_mouse_y) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2705 { |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2706 frame->mouse_moved = 1; |
|
111343
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
2707 note_mouse_highlight (frame, event->x, event->y); |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2708 /* Remember which glyph we're now on. */ |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2709 last_mouse_x = event->x; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2710 last_mouse_y = event->y; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2711 return 1; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2712 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2713 return 0; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2714 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2715 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2716 /* Return the current position of the mouse. |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2717 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2718 Set *f to the frame the mouse is in, or zero if the mouse is in no |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2719 Emacs frame. If it is set to zero, all the other arguments are |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2720 garbage. |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2721 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2722 Set *bar_window to Qnil, and *x and *y to the column and |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2723 row of the character cell the mouse is over. |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2724 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2725 Set *time to the time the mouse was at the returned position. |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2726 |
|
81127
d620b28641cd
(term_mouse_highlight): Remove unused variables.
Nick Roberts <nickrob@snap.net.nz>
parents:
81107
diff
changeset
|
2727 This clears mouse_moved until the next motion |
|
81102
a00e7c5f2faa
(mouse_face_window): Rename...
Nick Roberts <nickrob@snap.net.nz>
parents:
81083
diff
changeset
|
2728 event arrives. */ |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2729 static void |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2730 term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2731 enum scroll_bar_part *part, Lisp_Object *x, |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2732 Lisp_Object *y, unsigned long *time) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2733 { |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2734 struct timeval now; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2735 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2736 *fp = SELECTED_FRAME (); |
|
81102
a00e7c5f2faa
(mouse_face_window): Rename...
Nick Roberts <nickrob@snap.net.nz>
parents:
81083
diff
changeset
|
2737 (*fp)->mouse_moved = 0; |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2738 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2739 *bar_window = Qnil; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2740 *part = 0; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2741 |
|
81127
d620b28641cd
(term_mouse_highlight): Remove unused variables.
Nick Roberts <nickrob@snap.net.nz>
parents:
81107
diff
changeset
|
2742 XSETINT (*x, last_mouse_x); |
|
81102
a00e7c5f2faa
(mouse_face_window): Rename...
Nick Roberts <nickrob@snap.net.nz>
parents:
81083
diff
changeset
|
2743 XSETINT (*y, last_mouse_y); |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2744 gettimeofday(&now, 0); |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2745 *time = (now.tv_sec * 1000) + (now.tv_usec / 1000); |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2746 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2747 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2748 /* Prepare a mouse-event in *RESULT for placement in the input queue. |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2749 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2750 If the event is a button press, then note that we have grabbed |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2751 the mouse. */ |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2752 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2753 static Lisp_Object |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2754 term_mouse_click (struct input_event *result, Gpm_Event *event, |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2755 struct frame *f) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2756 { |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2757 struct timeval now; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2758 int i, j; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2759 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2760 result->kind = GPM_CLICK_EVENT; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2761 for (i = 0, j = GPM_B_LEFT; i < 3; i++, j >>= 1 ) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2762 { |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2763 if (event->buttons & j) { |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2764 result->code = i; /* button number */ |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2765 break; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2766 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2767 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2768 gettimeofday(&now, 0); |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2769 result->timestamp = (now.tv_sec * 1000) + (now.tv_usec / 1000); |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2770 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2771 if (event->type & GPM_UP) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2772 result->modifiers = up_modifier; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2773 else if (event->type & GPM_DOWN) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2774 result->modifiers = down_modifier; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2775 else |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2776 result->modifiers = 0; |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2777 |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2778 if (event->type & GPM_SINGLE) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2779 result->modifiers |= click_modifier; |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2780 |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2781 if (event->type & GPM_DOUBLE) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2782 result->modifiers |= double_modifier; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2783 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2784 if (event->type & GPM_TRIPLE) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2785 result->modifiers |= triple_modifier; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2786 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2787 if (event->type & GPM_DRAG) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2788 result->modifiers |= drag_modifier; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2789 |
|
81127
d620b28641cd
(term_mouse_highlight): Remove unused variables.
Nick Roberts <nickrob@snap.net.nz>
parents:
81107
diff
changeset
|
2790 if (!(event->type & (GPM_MOVE | GPM_DRAG))) { |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2791 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2792 /* 1 << KG_SHIFT */ |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2793 if (event->modifiers & (1 << 0)) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2794 result->modifiers |= shift_modifier; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2795 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2796 /* 1 << KG_CTRL */ |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2797 if (event->modifiers & (1 << 2)) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2798 result->modifiers |= ctrl_modifier; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2799 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2800 /* 1 << KG_ALT || KG_ALTGR */ |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2801 if (event->modifiers & (1 << 3) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2802 || event->modifiers & (1 << 1)) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2803 result->modifiers |= meta_modifier; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2804 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2805 |
|
81127
d620b28641cd
(term_mouse_highlight): Remove unused variables.
Nick Roberts <nickrob@snap.net.nz>
parents:
81107
diff
changeset
|
2806 XSETINT (result->x, event->x); |
|
d620b28641cd
(term_mouse_highlight): Remove unused variables.
Nick Roberts <nickrob@snap.net.nz>
parents:
81107
diff
changeset
|
2807 XSETINT (result->y, event->y); |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2808 XSETFRAME (result->frame_or_window, f); |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2809 result->arg = Qnil; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2810 return Qnil; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2811 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2812 |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2813 int |
| 83622 | 2814 handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event, struct input_event* hold_quit) |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2815 { |
| 83622 | 2816 struct frame *f = XFRAME (tty->top_frame); |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2817 struct input_event ie; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2818 int do_help = 0; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2819 int count = 0; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2820 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2821 EVENT_INIT (ie); |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2822 ie.kind = NO_EVENT; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2823 ie.arg = Qnil; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2824 |
|
81127
d620b28641cd
(term_mouse_highlight): Remove unused variables.
Nick Roberts <nickrob@snap.net.nz>
parents:
81107
diff
changeset
|
2825 if (event->type & (GPM_MOVE | GPM_DRAG)) { |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2826 previous_help_echo_string = help_echo_string; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2827 help_echo_string = Qnil; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2828 |
|
84968
85eb2660cbe3
(mouse_face_window): Rename from Qmouse_face_window. Update all users.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84955
diff
changeset
|
2829 Gpm_DrawPointer (event->x, event->y, fileno (tty->output)); |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2830 |
|
81127
d620b28641cd
(term_mouse_highlight): Remove unused variables.
Nick Roberts <nickrob@snap.net.nz>
parents:
81107
diff
changeset
|
2831 if (!term_mouse_movement (f, event)) |
|
d620b28641cd
(term_mouse_highlight): Remove unused variables.
Nick Roberts <nickrob@snap.net.nz>
parents:
81107
diff
changeset
|
2832 help_echo_string = previous_help_echo_string; |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2833 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2834 /* If the contents of the global variable help_echo_string |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2835 has changed, generate a HELP_EVENT. */ |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2836 if (!NILP (help_echo_string) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2837 || !NILP (previous_help_echo_string)) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2838 do_help = 1; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2839 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2840 goto done; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2841 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2842 else { |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2843 f->mouse_moved = 0; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2844 term_mouse_click (&ie, event, f); |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2845 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2846 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2847 done: |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2848 if (ie.kind != NO_EVENT) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2849 { |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2850 kbd_buffer_store_event_hold (&ie, hold_quit); |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2851 count++; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2852 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2853 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2854 if (do_help |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2855 && !(hold_quit && hold_quit->kind != NO_EVENT)) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2856 { |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2857 Lisp_Object frame; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2858 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2859 if (f) |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2860 XSETFRAME (frame, f); |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2861 else |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2862 frame = Qnil; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2863 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2864 gen_help_event (help_echo_string, frame, help_echo_window, |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2865 help_echo_object, help_echo_pos); |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2866 count++; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2867 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2868 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2869 return count; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2870 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2871 |
|
84968
85eb2660cbe3
(mouse_face_window): Rename from Qmouse_face_window. Update all users.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84955
diff
changeset
|
2872 DEFUN ("gpm-mouse-start", Fgpm_mouse_start, Sgpm_mouse_start, |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2873 0, 0, 0, |
|
84768
53194ec05789
* termhooks.h (term_gpm): Delete. Use gpm_tty's NULLness instead.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84692
diff
changeset
|
2874 doc: /* Open a connection to Gpm. |
|
84968
85eb2660cbe3
(mouse_face_window): Rename from Qmouse_face_window. Update all users.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84955
diff
changeset
|
2875 Gpm-mouse can only be activated for one tty at a time. */) |
|
109179
8cfee7d2955f
Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109165
diff
changeset
|
2876 (void) |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2877 { |
|
84768
53194ec05789
* termhooks.h (term_gpm): Delete. Use gpm_tty's NULLness instead.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84692
diff
changeset
|
2878 struct frame *f = SELECTED_FRAME (); |
|
53194ec05789
* termhooks.h (term_gpm): Delete. Use gpm_tty's NULLness instead.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84692
diff
changeset
|
2879 struct tty_display_info *tty |
|
53194ec05789
* termhooks.h (term_gpm): Delete. Use gpm_tty's NULLness instead.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84692
diff
changeset
|
2880 = ((f)->output_method == output_termcap |
|
53194ec05789
* termhooks.h (term_gpm): Delete. Use gpm_tty's NULLness instead.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84692
diff
changeset
|
2881 ? (f)->terminal->display_info.tty : NULL); |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2882 Gpm_Connect connection; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2883 |
|
84969
6e58c1c8c0fc
(Fgpm_mouse_start): Don't signal an error if already activated on this tty.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84968
diff
changeset
|
2884 if (!tty) |
|
6e58c1c8c0fc
(Fgpm_mouse_start): Don't signal an error if already activated on this tty.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84968
diff
changeset
|
2885 error ("Gpm-mouse only works in the GNU/Linux console"); |
|
6e58c1c8c0fc
(Fgpm_mouse_start): Don't signal an error if already activated on this tty.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84968
diff
changeset
|
2886 if (gpm_tty == tty) |
|
6e58c1c8c0fc
(Fgpm_mouse_start): Don't signal an error if already activated on this tty.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84968
diff
changeset
|
2887 return Qnil; /* Already activated, nothing to do. */ |
|
84968
85eb2660cbe3
(mouse_face_window): Rename from Qmouse_face_window. Update all users.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84955
diff
changeset
|
2888 if (gpm_tty) |
|
85eb2660cbe3
(mouse_face_window): Rename from Qmouse_face_window. Update all users.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84955
diff
changeset
|
2889 error ("Gpm-mouse can only be activated for one tty at a time"); |
|
84768
53194ec05789
* termhooks.h (term_gpm): Delete. Use gpm_tty's NULLness instead.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84692
diff
changeset
|
2890 |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2891 connection.eventMask = ~0; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2892 connection.defaultMask = ~GPM_HARD; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2893 connection.maxMod = ~0; |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2894 connection.minMod = 0; |
|
81127
d620b28641cd
(term_mouse_highlight): Remove unused variables.
Nick Roberts <nickrob@snap.net.nz>
parents:
81107
diff
changeset
|
2895 gpm_zerobased = 1; |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2896 |
|
84768
53194ec05789
* termhooks.h (term_gpm): Delete. Use gpm_tty's NULLness instead.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84692
diff
changeset
|
2897 if (Gpm_Open (&connection, 0) < 0) |
|
84968
85eb2660cbe3
(mouse_face_window): Rename from Qmouse_face_window. Update all users.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84955
diff
changeset
|
2898 error ("Gpm-mouse failed to connect to the gpm daemon"); |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2899 else |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2900 { |
|
84768
53194ec05789
* termhooks.h (term_gpm): Delete. Use gpm_tty's NULLness instead.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84692
diff
changeset
|
2901 gpm_tty = tty; |
|
84955
dfbee4931a6a
(Fterm_open_connection): Add comment.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84849
diff
changeset
|
2902 /* `init_sys_modes' arranges for mouse movements sent through gpm_fd |
|
dfbee4931a6a
(Fterm_open_connection): Add comment.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84849
diff
changeset
|
2903 to generate SIGIOs. Apparently we need to call reset_sys_modes |
|
dfbee4931a6a
(Fterm_open_connection): Add comment.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84849
diff
changeset
|
2904 before calling init_sys_modes. */ |
| 83622 | 2905 reset_sys_modes (tty); |
| 2906 init_sys_modes (tty); | |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2907 add_gpm_wait_descriptor (gpm_fd); |
|
84968
85eb2660cbe3
(mouse_face_window): Rename from Qmouse_face_window. Update all users.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84955
diff
changeset
|
2908 return Qnil; |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2909 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2910 } |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2911 |
|
98155
314662df7c17
* term.c (close_gpm): New fun extracted from Fgpm_mouse_stop.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
97830
diff
changeset
|
2912 void |
|
102744
d69c45eb83b1
* keyboard.c (tty_read_avail_input): Don't treat a -1 return from
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
101964
diff
changeset
|
2913 close_gpm (int fd) |
|
98155
314662df7c17
* term.c (close_gpm): New fun extracted from Fgpm_mouse_stop.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
97830
diff
changeset
|
2914 { |
|
102744
d69c45eb83b1
* keyboard.c (tty_read_avail_input): Don't treat a -1 return from
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
101964
diff
changeset
|
2915 if (fd >= 0) |
|
d69c45eb83b1
* keyboard.c (tty_read_avail_input): Don't treat a -1 return from
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
101964
diff
changeset
|
2916 delete_gpm_wait_descriptor (fd); |
|
98155
314662df7c17
* term.c (close_gpm): New fun extracted from Fgpm_mouse_stop.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
97830
diff
changeset
|
2917 while (Gpm_Close()); /* close all the stack */ |
|
314662df7c17
* term.c (close_gpm): New fun extracted from Fgpm_mouse_stop.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
97830
diff
changeset
|
2918 gpm_tty = NULL; |
|
314662df7c17
* term.c (close_gpm): New fun extracted from Fgpm_mouse_stop.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
97830
diff
changeset
|
2919 } |
|
314662df7c17
* term.c (close_gpm): New fun extracted from Fgpm_mouse_stop.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
97830
diff
changeset
|
2920 |
|
84968
85eb2660cbe3
(mouse_face_window): Rename from Qmouse_face_window. Update all users.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84955
diff
changeset
|
2921 DEFUN ("gpm-mouse-stop", Fgpm_mouse_stop, Sgpm_mouse_stop, |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2922 0, 0, 0, |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2923 doc: /* Close a connection to Gpm. */) |
|
109179
8cfee7d2955f
Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109165
diff
changeset
|
2924 (void) |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2925 { |
|
84969
6e58c1c8c0fc
(Fgpm_mouse_start): Don't signal an error if already activated on this tty.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84968
diff
changeset
|
2926 struct frame *f = SELECTED_FRAME (); |
|
6e58c1c8c0fc
(Fgpm_mouse_start): Don't signal an error if already activated on this tty.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84968
diff
changeset
|
2927 struct tty_display_info *tty |
|
6e58c1c8c0fc
(Fgpm_mouse_start): Don't signal an error if already activated on this tty.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84968
diff
changeset
|
2928 = ((f)->output_method == output_termcap |
|
6e58c1c8c0fc
(Fgpm_mouse_start): Don't signal an error if already activated on this tty.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84968
diff
changeset
|
2929 ? (f)->terminal->display_info.tty : NULL); |
|
6e58c1c8c0fc
(Fgpm_mouse_start): Don't signal an error if already activated on this tty.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84968
diff
changeset
|
2930 |
|
6e58c1c8c0fc
(Fgpm_mouse_start): Don't signal an error if already activated on this tty.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84968
diff
changeset
|
2931 if (!tty || gpm_tty != tty) |
|
6e58c1c8c0fc
(Fgpm_mouse_start): Don't signal an error if already activated on this tty.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84968
diff
changeset
|
2932 return Qnil; /* Not activated on this terminal, nothing to do. */ |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
2933 |
|
102744
d69c45eb83b1
* keyboard.c (tty_read_avail_input): Don't treat a -1 return from
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
101964
diff
changeset
|
2934 close_gpm (gpm_fd); |
|
84968
85eb2660cbe3
(mouse_face_window): Rename from Qmouse_face_window. Update all users.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84955
diff
changeset
|
2935 return Qnil; |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2936 } |
|
80994
62b6aa7f8c37
Use HAVE_GPM instead of HAVE_GPM_H.
Nick Roberts <nickrob@snap.net.nz>
parents:
80979
diff
changeset
|
2937 #endif /* HAVE_GPM */ |
|
80979
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2938 |
|
3d81d0b44577
(write_glyphs_with_face): New function.
Nick Roberts <nickrob@snap.net.nz>
parents:
76627
diff
changeset
|
2939 |
|
103617
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2940 #ifndef MSDOS |
| 25002 | 2941 /*********************************************************************** |
| 2942 Initialization | |
| 2943 ***********************************************************************/ | |
| 2944 | |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2945 /* Initialize the tty-dependent part of frame F. The frame must |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2946 already have its device initialized. */ |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
2947 |
| 21514 | 2948 void |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2949 create_tty_output (struct frame *f) |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
2950 { |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2951 struct tty_output *t; |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2952 |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2953 if (! FRAME_TERMCAP_P (f)) |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
2954 abort (); |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
2955 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2956 t = xmalloc (sizeof (struct tty_output)); |
|
109165
750db9f3e6d8
Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents:
109144
diff
changeset
|
2957 memset (t, 0, sizeof (struct tty_output)); |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2958 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
2959 t->display_info = FRAME_TERMINAL (f)->display_info.tty; |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2960 |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2961 f->output_data.tty = t; |
|
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
2962 } |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
2963 |
|
100367
b6b22701e97c
(tty_free_frame_resources): Renamed from delete_tty_output; all
Chong Yidong <cyd@stupidchicken.com>
parents:
100276
diff
changeset
|
2964 /* Delete frame F's face cache, and its tty-dependent part. */ |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2965 |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2966 static void |
|
100367
b6b22701e97c
(tty_free_frame_resources): Renamed from delete_tty_output; all
Chong Yidong <cyd@stupidchicken.com>
parents:
100276
diff
changeset
|
2967 tty_free_frame_resources (struct frame *f) |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2968 { |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2969 if (! FRAME_TERMCAP_P (f)) |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2970 abort (); |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2971 |
|
100367
b6b22701e97c
(tty_free_frame_resources): Renamed from delete_tty_output; all
Chong Yidong <cyd@stupidchicken.com>
parents:
100276
diff
changeset
|
2972 if (FRAME_FACE_CACHE (f)) |
|
b6b22701e97c
(tty_free_frame_resources): Renamed from delete_tty_output; all
Chong Yidong <cyd@stupidchicken.com>
parents:
100276
diff
changeset
|
2973 free_frame_faces (f); |
|
b6b22701e97c
(tty_free_frame_resources): Renamed from delete_tty_output; all
Chong Yidong <cyd@stupidchicken.com>
parents:
100276
diff
changeset
|
2974 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2975 xfree (f->output_data.tty); |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2976 } |
|
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2977 |
|
103617
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2978 #else /* MSDOS */ |
|
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2979 |
|
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2980 /* Delete frame F's face cache. */ |
|
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2981 |
|
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2982 static void |
|
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2983 tty_free_frame_resources (struct frame *f) |
|
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2984 { |
|
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2985 if (! FRAME_TERMCAP_P (f) && ! FRAME_MSDOS_P (f)) |
|
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2986 abort (); |
|
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2987 |
|
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2988 if (FRAME_FACE_CACHE (f)) |
|
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2989 free_frame_faces (f); |
|
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2990 } |
|
9342805096db
(create_tty_output) [MSDOS]: #ifdef away.
Eli Zaretskii <eliz@gnu.org>
parents:
103605
diff
changeset
|
2991 #endif /* MSDOS */ |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2992 |
|
84461
7ec30b352b6e
* xterm.c (x_create_terminal): Add comment.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84359
diff
changeset
|
2993 /* Reset the hooks in TERMINAL. */ |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
2994 |
|
83521
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
2995 static void |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
2996 clear_tty_hooks (struct terminal *terminal) |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
2997 { |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
2998 terminal->rif = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
2999 terminal->cursor_to_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3000 terminal->raw_cursor_to_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3001 terminal->clear_to_end_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3002 terminal->clear_frame_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3003 terminal->clear_end_of_line_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3004 terminal->ins_del_lines_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3005 terminal->insert_glyphs_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3006 terminal->write_glyphs_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3007 terminal->delete_glyphs_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3008 terminal->ring_bell_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3009 terminal->reset_terminal_modes_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3010 terminal->set_terminal_modes_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3011 terminal->update_begin_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3012 terminal->update_end_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3013 terminal->set_terminal_window_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3014 terminal->mouse_position_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3015 terminal->frame_rehighlight_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3016 terminal->frame_raise_lower_hook = 0; |
|
83548
c71725faff1a
Merged from emacs@sv.gnu.org. Last-minute emacsclient rewrites be damned!
Karoly Lorentey <lorentey@elte.hu>
diff
changeset
|
3017 terminal->fullscreen_hook = 0; |
|
83521
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3018 terminal->set_vertical_scroll_bar_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3019 terminal->condemn_scroll_bars_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3020 terminal->redeem_scroll_bar_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3021 terminal->judge_scroll_bars_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3022 terminal->read_socket_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3023 terminal->frame_up_to_date_hook = 0; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3024 |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3025 /* Leave these two set, or suspended frames are not deleted |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3026 correctly. */ |
|
100367
b6b22701e97c
(tty_free_frame_resources): Renamed from delete_tty_output; all
Chong Yidong <cyd@stupidchicken.com>
parents:
100276
diff
changeset
|
3027 terminal->delete_frame_hook = &tty_free_frame_resources; |
|
83521
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3028 terminal->delete_terminal_hook = &delete_tty; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3029 } |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3030 |
|
84461
7ec30b352b6e
* xterm.c (x_create_terminal): Add comment.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84359
diff
changeset
|
3031 /* Initialize hooks in TERMINAL with the values needed for a tty. */ |
|
7ec30b352b6e
* xterm.c (x_create_terminal): Add comment.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84359
diff
changeset
|
3032 |
|
83521
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3033 static void |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3034 set_tty_hooks (struct terminal *terminal) |
| 253 | 3035 { |
|
83521
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3036 terminal->rif = 0; /* ttys don't support window-based redisplay. */ |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3037 |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3038 terminal->cursor_to_hook = &tty_cursor_to; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3039 terminal->raw_cursor_to_hook = &tty_raw_cursor_to; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3040 |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3041 terminal->clear_to_end_hook = &tty_clear_to_end; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3042 terminal->clear_frame_hook = &tty_clear_frame; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3043 terminal->clear_end_of_line_hook = &tty_clear_end_of_line; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3044 |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3045 terminal->ins_del_lines_hook = &tty_ins_del_lines; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3046 |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3047 terminal->insert_glyphs_hook = &tty_insert_glyphs; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3048 terminal->write_glyphs_hook = &tty_write_glyphs; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3049 terminal->delete_glyphs_hook = &tty_delete_glyphs; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3050 |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3051 terminal->ring_bell_hook = &tty_ring_bell; |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
3052 |
|
83521
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3053 terminal->reset_terminal_modes_hook = &tty_reset_terminal_modes; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3054 terminal->set_terminal_modes_hook = &tty_set_terminal_modes; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3055 terminal->update_begin_hook = 0; /* Not needed. */ |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3056 terminal->update_end_hook = &tty_update_end; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3057 terminal->set_terminal_window_hook = &tty_set_terminal_window; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3058 |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3059 terminal->mouse_position_hook = 0; /* Not needed. */ |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3060 terminal->frame_rehighlight_hook = 0; /* Not needed. */ |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3061 terminal->frame_raise_lower_hook = 0; /* Not needed. */ |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3062 |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3063 terminal->set_vertical_scroll_bar_hook = 0; /* Not needed. */ |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3064 terminal->condemn_scroll_bars_hook = 0; /* Not needed. */ |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3065 terminal->redeem_scroll_bar_hook = 0; /* Not needed. */ |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3066 terminal->judge_scroll_bars_hook = 0; /* Not needed. */ |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3067 |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3068 terminal->read_socket_hook = &tty_read_avail_input; /* keyboard.c */ |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3069 terminal->frame_up_to_date_hook = 0; /* Not needed. */ |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
3070 |
|
100367
b6b22701e97c
(tty_free_frame_resources): Renamed from delete_tty_output; all
Chong Yidong <cyd@stupidchicken.com>
parents:
100276
diff
changeset
|
3071 terminal->delete_frame_hook = &tty_free_frame_resources; |
|
83521
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3072 terminal->delete_terminal_hook = &delete_tty; |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3073 } |
|
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3074 |
|
83086
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3075 /* Drop the controlling terminal if fd is the same device. */ |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
3076 static void |
|
83086
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3077 dissociate_if_controlling_tty (int fd) |
| 253 | 3078 { |
| 97658 | 3079 #ifndef DOS_NT |
|
111544
107fd4b37e9d
Clean up src/systty.h macros.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
111526
diff
changeset
|
3080 int pgid = tcgetpgrp (fd); /* If tcgetpgrp succeeds, fd is the ctty. */ |
|
83086
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3081 if (pgid != -1) |
|
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3082 { |
|
109633
ce2dcd6fda75
Fix emacs -Q -f server-start & emacsclient -t on GNU/Linux.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109559
diff
changeset
|
3083 #if defined (USG5) |
|
83086
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3084 setpgrp (); |
|
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3085 no_controlling_tty = 1; |
|
84359
b651dc7c54ac
* term.c (dissociate_if_controlling_tty): Call setsid on CYGWIN.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83891
diff
changeset
|
3086 #elif defined (CYGWIN) |
|
b651dc7c54ac
* term.c (dissociate_if_controlling_tty): Call setsid on CYGWIN.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83891
diff
changeset
|
3087 setsid (); |
|
b651dc7c54ac
* term.c (dissociate_if_controlling_tty): Call setsid on CYGWIN.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83891
diff
changeset
|
3088 no_controlling_tty = 1; |
|
83086
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3089 #else |
|
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3090 #ifdef TIOCNOTTY /* Try BSD ioctls. */ |
|
83154
ae72b7a6c292
Dissociate from the controlling tty correctly on FreeBSD.
Karoly Lorentey <lorentey@elte.hu>
parents:
83147
diff
changeset
|
3091 sigblock (sigmask (SIGTTOU)); |
|
84779
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
3092 fd = emacs_open (DEV_TTY, O_RDWR, 0); |
|
83154
ae72b7a6c292
Dissociate from the controlling tty correctly on FreeBSD.
Karoly Lorentey <lorentey@elte.hu>
parents:
83147
diff
changeset
|
3093 if (fd != -1 && ioctl (fd, TIOCNOTTY, 0) != -1) |
|
ae72b7a6c292
Dissociate from the controlling tty correctly on FreeBSD.
Karoly Lorentey <lorentey@elte.hu>
parents:
83147
diff
changeset
|
3094 { |
|
ae72b7a6c292
Dissociate from the controlling tty correctly on FreeBSD.
Karoly Lorentey <lorentey@elte.hu>
parents:
83147
diff
changeset
|
3095 no_controlling_tty = 1; |
|
ae72b7a6c292
Dissociate from the controlling tty correctly on FreeBSD.
Karoly Lorentey <lorentey@elte.hu>
parents:
83147
diff
changeset
|
3096 } |
|
ae72b7a6c292
Dissociate from the controlling tty correctly on FreeBSD.
Karoly Lorentey <lorentey@elte.hu>
parents:
83147
diff
changeset
|
3097 if (fd != -1) |
|
ae72b7a6c292
Dissociate from the controlling tty correctly on FreeBSD.
Karoly Lorentey <lorentey@elte.hu>
parents:
83147
diff
changeset
|
3098 emacs_close (fd); |
|
ae72b7a6c292
Dissociate from the controlling tty correctly on FreeBSD.
Karoly Lorentey <lorentey@elte.hu>
parents:
83147
diff
changeset
|
3099 sigunblock (sigmask (SIGTTOU)); |
|
ae72b7a6c292
Dissociate from the controlling tty correctly on FreeBSD.
Karoly Lorentey <lorentey@elte.hu>
parents:
83147
diff
changeset
|
3100 #else |
|
ae72b7a6c292
Dissociate from the controlling tty correctly on FreeBSD.
Karoly Lorentey <lorentey@elte.hu>
parents:
83147
diff
changeset
|
3101 /* Unknown system. */ |
|
ae72b7a6c292
Dissociate from the controlling tty correctly on FreeBSD.
Karoly Lorentey <lorentey@elte.hu>
parents:
83147
diff
changeset
|
3102 croak (); |
|
ae72b7a6c292
Dissociate from the controlling tty correctly on FreeBSD.
Karoly Lorentey <lorentey@elte.hu>
parents:
83147
diff
changeset
|
3103 #endif /* ! TIOCNOTTY */ |
|
83158
f948c9fd910c
Fix parse error in term.c (ARISAWA Akihiro).
Karoly Lorentey <lorentey@elte.hu>
parents:
83154
diff
changeset
|
3104 #endif /* ! USG */ |
|
83086
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3105 } |
| 97658 | 3106 #endif /* !DOS_NT */ |
|
83086
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3107 } |
|
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3108 |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3109 /* Create a termcap display on the tty device with the given name and |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3110 type. |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3111 |
|
83525
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
3112 If NAME is NULL, then use the controlling tty, i.e., "/dev/tty". |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3113 Otherwise NAME should be a path to the tty device file, |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3114 e.g. "/dev/pts/7". |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3115 |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3116 TERMINAL_TYPE is the termcap type of the device, e.g. "vt100". |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3117 |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3118 If MUST_SUCCEED is true, then all errors are fatal. */ |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
3119 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3120 struct terminal * |
|
109726
64732fa6188a
Use const char* instead of char*.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109664
diff
changeset
|
3121 init_tty (const char *name, const char *terminal_type, int must_succeed) |
| 253 | 3122 { |
|
83498
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3123 char *area = NULL; |
| 253 | 3124 char **address = &area; |
|
52314
529dd59ee898
(term_init): Remove `const' from buffer_size's declaration.
Eli Zaretskii <eliz@gnu.org>
parents:
52294
diff
changeset
|
3125 int buffer_size = 4096; |
|
83498
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3126 register char *p = NULL; |
| 253 | 3127 int status; |
|
83498
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3128 struct tty_display_info *tty = NULL; |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3129 struct terminal *terminal = NULL; |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3130 int ctty = 0; /* 1 if asked to open controlling tty. */ |
|
83004
7900111db01c
Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
82995
diff
changeset
|
3131 |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3132 if (!terminal_type) |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3133 maybe_fatal (must_succeed, 0, |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3134 "Unknown terminal type", |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3135 "Unknown terminal type"); |
|
83167
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83161
diff
changeset
|
3136 |
|
83525
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
3137 if (name == NULL) |
|
84779
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
3138 name = DEV_TTY; |
|
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
3139 if (!strcmp (name, DEV_TTY)) |
|
83525
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
3140 ctty = 1; |
|
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
3141 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3142 /* If we already have a terminal on the given device, use that. If |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3143 all such terminals are suspended, create a new one instead. */ |
|
83341
76e51706154e
Rename term_init to init_tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83338
diff
changeset
|
3144 /* XXX Perhaps this should be made explicit by having init_tty |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3145 always create a new terminal and separating terminal and frame |
|
83167
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83161
diff
changeset
|
3146 creation on Lisp level. */ |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3147 terminal = get_named_tty (name); |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3148 if (terminal) |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3149 return terminal; |
|
84779
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
3150 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3151 terminal = create_terminal (); |
| 97658 | 3152 #ifdef MSDOS |
| 3153 if (been_here > 0) | |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3154 maybe_fatal (1, 0, "Attempt to create another terminal %s", "", |
| 97658 | 3155 name, ""); |
| 3156 been_here = 1; | |
| 3157 tty = &the_only_display_info; | |
| 3158 #else | |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3159 tty = (struct tty_display_info *) xmalloc (sizeof (struct tty_display_info)); |
| 97658 | 3160 #endif |
|
109165
750db9f3e6d8
Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents:
109144
diff
changeset
|
3161 memset (tty, 0, sizeof (struct tty_display_info)); |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3162 tty->next = tty_list; |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3163 tty_list = tty; |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3164 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3165 terminal->type = output_termcap; |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3166 terminal->display_info.tty = tty; |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3167 tty->terminal = terminal; |
|
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
3168 |
|
82991
2b26656ff804
MULTI_KBOARD support for ttys. Input-related bugfixes for X+tty sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82990
diff
changeset
|
3169 tty->Wcm = (struct cm *) xmalloc (sizeof (struct cm)); |
|
2b26656ff804
MULTI_KBOARD support for ttys. Input-related bugfixes for X+tty sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82990
diff
changeset
|
3170 Wcm_clear (tty); |
|
2b26656ff804
MULTI_KBOARD support for ttys. Input-related bugfixes for X+tty sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82990
diff
changeset
|
3171 |
|
110588
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3172 encode_terminal_src_size = 0; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3173 encode_terminal_dst_size = 0; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3174 |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3175 #ifdef HAVE_GPM |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3176 terminal->mouse_position_hook = term_mouse_position; |
|
111343
f168d8610334
Reflect mouse-highlight redesign in term.c
Eli Zaretskii <eliz@gnu.org>
parents:
110688
diff
changeset
|
3177 tty->mouse_highlight.mouse_face_window = Qnil; |
|
110588
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3178 #endif |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3179 |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3180 |
| 97658 | 3181 #ifndef DOS_NT |
|
83521
40a5d8a15056
Fix crashes in redisplay functions on suspended tty frames. (Reported by Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83512
diff
changeset
|
3182 set_tty_hooks (terminal); |
|
84779
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
3183 |
|
83498
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3184 { |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3185 int fd; |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3186 FILE *file; |
|
83032
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
3187 |
|
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
3188 #ifdef O_IGNORE_CTTY |
|
83498
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3189 if (!ctty) |
|
83032
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
3190 /* Open the terminal device. Don't recognize it as our |
|
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
3191 controlling terminal, and don't make it the controlling tty |
|
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
3192 if we don't have one at the moment. */ |
|
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
3193 fd = emacs_open (name, O_RDWR | O_IGNORE_CTTY | O_NOCTTY, 0); |
|
83498
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3194 else |
|
83032
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
3195 #else |
|
83074
34a7a8f40548
Fix background-mode on terminal frames (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83065
diff
changeset
|
3196 /* Alas, O_IGNORE_CTTY is a GNU extension that seems to be only |
|
83498
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3197 defined on Hurd. On other systems, we need to explicitly |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3198 dissociate ourselves from the controlling tty when we want to |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3199 open a frame on the same terminal. */ |
|
83032
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
3200 fd = emacs_open (name, O_RDWR | O_NOCTTY, 0); |
|
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
3201 #endif /* O_IGNORE_CTTY */ |
|
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
3202 |
|
100370
c611d83003ce
(init_tty): Move setting the terminal name before the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100367
diff
changeset
|
3203 tty->name = xstrdup (name); |
|
c611d83003ce
(init_tty): Move setting the terminal name before the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100367
diff
changeset
|
3204 terminal->name = xstrdup (name); |
|
c611d83003ce
(init_tty): Move setting the terminal name before the
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100367
diff
changeset
|
3205 |
|
83498
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3206 if (fd < 0) |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3207 maybe_fatal (must_succeed, terminal, |
|
83498
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3208 "Could not open file: %s", |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3209 "Could not open file: %s", |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3210 name); |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3211 if (!isatty (fd)) |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3212 { |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3213 close (fd); |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3214 maybe_fatal (must_succeed, terminal, |
|
83498
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3215 "Not a tty device: %s", |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3216 "Not a tty device: %s", |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3217 name); |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3218 } |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3219 |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3220 #ifndef O_IGNORE_CTTY |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3221 if (!ctty) |
|
83086
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3222 dissociate_if_controlling_tty (fd); |
|
83498
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3223 #endif |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3224 |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3225 file = fdopen (fd, "w+"); |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3226 tty->input = file; |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3227 tty->output = file; |
|
f0987e2f27e2
Clean up tty device handling. Change name of controlling tty from nil to "/dev/tty".
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
3228 } |
|
84779
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
3229 |
|
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
82988
diff
changeset
|
3230 tty->type = xstrdup (terminal_type); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3231 |
|
82988
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
3232 add_keyboard_wait_descriptor (fileno (tty->input)); |
| 253 | 3233 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3234 Wcm_clear (tty); |
| 253 | 3235 |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3236 tty->termcap_term_buffer = (char *) xmalloc (buffer_size); |
|
84779
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
3237 |
|
83086
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3238 /* On some systems, tgetent tries to access the controlling |
|
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3239 terminal. */ |
|
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3240 sigblock (sigmask (SIGTTOU)); |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3241 status = tgetent (tty->termcap_term_buffer, terminal_type); |
|
83086
347ce3d5d79c
Fix dropping of the controlling tty on Solaris (Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83082
diff
changeset
|
3242 sigunblock (sigmask (SIGTTOU)); |
|
84779
67e430e38471
(DEV_TTY): New macro. Provide a definition for MS-Windows.
Eli Zaretskii <eliz@gnu.org>
parents:
84769
diff
changeset
|
3243 |
| 253 | 3244 if (status < 0) |
|
10824
894369e950f5
(term_init) [TERMINFO]: Make error message more accurate.
Karl Heuer <kwzh@gnu.org>
parents:
10771
diff
changeset
|
3245 { |
|
894369e950f5
(term_init) [TERMINFO]: Make error message more accurate.
Karl Heuer <kwzh@gnu.org>
parents:
10771
diff
changeset
|
3246 #ifdef TERMINFO |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3247 maybe_fatal (must_succeed, terminal, |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3248 "Cannot open terminfo database file", |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3249 "Cannot open terminfo database file"); |
|
10824
894369e950f5
(term_init) [TERMINFO]: Make error message more accurate.
Karl Heuer <kwzh@gnu.org>
parents:
10771
diff
changeset
|
3250 #else |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3251 maybe_fatal (must_succeed, terminal, |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3252 "Cannot open termcap database file", |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3253 "Cannot open termcap database file"); |
|
10824
894369e950f5
(term_init) [TERMINFO]: Make error message more accurate.
Karl Heuer <kwzh@gnu.org>
parents:
10771
diff
changeset
|
3254 #endif |
|
894369e950f5
(term_init) [TERMINFO]: Make error message more accurate.
Karl Heuer <kwzh@gnu.org>
parents:
10771
diff
changeset
|
3255 } |
| 253 | 3256 if (status == 0) |
|
10824
894369e950f5
(term_init) [TERMINFO]: Make error message more accurate.
Karl Heuer <kwzh@gnu.org>
parents:
10771
diff
changeset
|
3257 { |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3258 maybe_fatal (must_succeed, terminal, |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3259 "Terminal type %s is not defined", |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3260 "Terminal type %s is not defined.\n\ |
|
10824
894369e950f5
(term_init) [TERMINFO]: Make error message more accurate.
Karl Heuer <kwzh@gnu.org>
parents:
10771
diff
changeset
|
3261 If that is not the actual type of terminal you have,\n\ |
|
894369e950f5
(term_init) [TERMINFO]: Make error message more accurate.
Karl Heuer <kwzh@gnu.org>
parents:
10771
diff
changeset
|
3262 use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ |
|
107847
e81bca2fba28
(init_tty): Move common text outside of #ifdef TERMINFO.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
107640
diff
changeset
|
3263 `setenv TERM ...') to specify the correct type. It may be necessary\n" |
|
e81bca2fba28
(init_tty): Move common text outside of #ifdef TERMINFO.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
107640
diff
changeset
|
3264 #ifdef TERMINFO |
|
e81bca2fba28
(init_tty): Move common text outside of #ifdef TERMINFO.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
107640
diff
changeset
|
3265 "to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.", |
|
10824
894369e950f5
(term_init) [TERMINFO]: Make error message more accurate.
Karl Heuer <kwzh@gnu.org>
parents:
10771
diff
changeset
|
3266 #else |
|
107847
e81bca2fba28
(init_tty): Move common text outside of #ifdef TERMINFO.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
107640
diff
changeset
|
3267 "to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", |
|
e81bca2fba28
(init_tty): Move common text outside of #ifdef TERMINFO.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
107640
diff
changeset
|
3268 #endif |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3269 terminal_type); |
|
10824
894369e950f5
(term_init) [TERMINFO]: Make error message more accurate.
Karl Heuer <kwzh@gnu.org>
parents:
10771
diff
changeset
|
3270 } |
|
52265
84e49afb2178
(term_init): Use a buffer of size 4096 for tgetent since
Richard M. Stallman <rms@gnu.org>
parents:
51212
diff
changeset
|
3271 |
|
52294
d9ae4cdf1ed1
(term_init): Fix previous change
Kenichi Handa <handa@m17n.org>
parents:
52293
diff
changeset
|
3272 #ifndef TERMINFO |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3273 if (strlen (tty->termcap_term_buffer) >= buffer_size) |
|
52265
84e49afb2178
(term_init): Use a buffer of size 4096 for tgetent since
Richard M. Stallman <rms@gnu.org>
parents:
51212
diff
changeset
|
3274 abort (); |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3275 buffer_size = strlen (tty->termcap_term_buffer); |
|
52293
473d34d4814c
(term_init): Fix previous change; don't rely on the
Kenichi Handa <handa@m17n.org>
parents:
52265
diff
changeset
|
3276 #endif |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3277 tty->termcap_strings_buffer = area = (char *) xmalloc (buffer_size); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3278 tty->TS_ins_line = tgetstr ("al", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3279 tty->TS_ins_multi_lines = tgetstr ("AL", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3280 tty->TS_bell = tgetstr ("bl", address); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3281 BackTab (tty) = tgetstr ("bt", address); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3282 tty->TS_clr_to_bottom = tgetstr ("cd", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3283 tty->TS_clr_line = tgetstr ("ce", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3284 tty->TS_clr_frame = tgetstr ("cl", address); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3285 ColPosition (tty) = NULL; /* tgetstr ("ch", address); */ |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3286 AbsPosition (tty) = tgetstr ("cm", address); |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3287 CR (tty) = tgetstr ("cr", address); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3288 tty->TS_set_scroll_region = tgetstr ("cs", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3289 tty->TS_set_scroll_region_1 = tgetstr ("cS", address); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3290 RowPosition (tty) = tgetstr ("cv", address); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3291 tty->TS_del_char = tgetstr ("dc", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3292 tty->TS_del_multi_chars = tgetstr ("DC", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3293 tty->TS_del_line = tgetstr ("dl", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3294 tty->TS_del_multi_lines = tgetstr ("DL", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3295 tty->TS_delete_mode = tgetstr ("dm", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3296 tty->TS_end_delete_mode = tgetstr ("ed", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3297 tty->TS_end_insert_mode = tgetstr ("ei", address); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3298 Home (tty) = tgetstr ("ho", address); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3299 tty->TS_ins_char = tgetstr ("ic", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3300 tty->TS_ins_multi_chars = tgetstr ("IC", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3301 tty->TS_insert_mode = tgetstr ("im", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3302 tty->TS_pad_inserted_char = tgetstr ("ip", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3303 tty->TS_end_keypad_mode = tgetstr ("ke", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3304 tty->TS_keypad_mode = tgetstr ("ks", address); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3305 LastLine (tty) = tgetstr ("ll", address); |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3306 Right (tty) = tgetstr ("nd", address); |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3307 Down (tty) = tgetstr ("do", address); |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3308 if (!Down (tty)) |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3309 Down (tty) = tgetstr ("nl", address); /* Obsolete name for "do" */ |
| 253 | 3310 if (tgetflag ("bs")) |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3311 Left (tty) = "\b"; /* can't possibly be longer! */ |
| 253 | 3312 else /* (Actually, "bs" is obsolete...) */ |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3313 Left (tty) = tgetstr ("le", address); |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3314 if (!Left (tty)) |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3315 Left (tty) = tgetstr ("bc", address); /* Obsolete name for "le" */ |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3316 tty->TS_pad_char = tgetstr ("pc", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3317 tty->TS_repeat = tgetstr ("rp", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3318 tty->TS_end_standout_mode = tgetstr ("se", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3319 tty->TS_fwd_scroll = tgetstr ("sf", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3320 tty->TS_standout_mode = tgetstr ("so", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3321 tty->TS_rev_scroll = tgetstr ("sr", address); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3322 tty->Wcm->cm_tab = tgetstr ("ta", address); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3323 tty->TS_end_termcap_modes = tgetstr ("te", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3324 tty->TS_termcap_modes = tgetstr ("ti", address); |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3325 Up (tty) = tgetstr ("up", address); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3326 tty->TS_visible_bell = tgetstr ("vb", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3327 tty->TS_cursor_normal = tgetstr ("ve", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3328 tty->TS_cursor_visible = tgetstr ("vs", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3329 tty->TS_cursor_invisible = tgetstr ("vi", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3330 tty->TS_set_window = tgetstr ("wi", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3331 |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3332 tty->TS_enter_underline_mode = tgetstr ("us", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3333 tty->TS_exit_underline_mode = tgetstr ("ue", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3334 tty->TS_enter_bold_mode = tgetstr ("md", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3335 tty->TS_enter_dim_mode = tgetstr ("mh", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3336 tty->TS_enter_blink_mode = tgetstr ("mb", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3337 tty->TS_enter_reverse_mode = tgetstr ("mr", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3338 tty->TS_enter_alt_charset_mode = tgetstr ("as", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3339 tty->TS_exit_alt_charset_mode = tgetstr ("ae", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3340 tty->TS_exit_attribute_mode = tgetstr ("me", address); |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
3341 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3342 MultiUp (tty) = tgetstr ("UP", address); |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3343 MultiDown (tty) = tgetstr ("DO", address); |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3344 MultiLeft (tty) = tgetstr ("LE", address); |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3345 MultiRight (tty) = tgetstr ("RI", address); |
| 253 | 3346 |
|
26425
08c26156186a
(term_init): If "op" isn't available, don't support color
Gerd Moellmann <gerd@gnu.org>
parents:
25727
diff
changeset
|
3347 /* SVr4/ANSI color suppert. If "op" isn't available, don't support |
|
08c26156186a
(term_init): If "op" isn't available, don't support color
Gerd Moellmann <gerd@gnu.org>
parents:
25727
diff
changeset
|
3348 color because we can't switch back to the default foreground and |
|
08c26156186a
(term_init): If "op" isn't available, don't support color
Gerd Moellmann <gerd@gnu.org>
parents:
25727
diff
changeset
|
3349 background. */ |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3350 tty->TS_orig_pair = tgetstr ("op", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3351 if (tty->TS_orig_pair) |
| 25002 | 3352 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3353 tty->TS_set_foreground = tgetstr ("AF", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3354 tty->TS_set_background = tgetstr ("AB", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3355 if (!tty->TS_set_foreground) |
|
26425
08c26156186a
(term_init): If "op" isn't available, don't support color
Gerd Moellmann <gerd@gnu.org>
parents:
25727
diff
changeset
|
3356 { |
|
08c26156186a
(term_init): If "op" isn't available, don't support color
Gerd Moellmann <gerd@gnu.org>
parents:
25727
diff
changeset
|
3357 /* SVr4. */ |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3358 tty->TS_set_foreground = tgetstr ("Sf", address); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3359 tty->TS_set_background = tgetstr ("Sb", address); |
|
26425
08c26156186a
(term_init): If "op" isn't available, don't support color
Gerd Moellmann <gerd@gnu.org>
parents:
25727
diff
changeset
|
3360 } |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
3361 |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3362 tty->TN_max_colors = tgetnum ("Co"); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3363 tty->TN_max_pairs = tgetnum ("pa"); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3364 |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3365 tty->TN_no_color_video = tgetnum ("NC"); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3366 if (tty->TN_no_color_video == -1) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3367 tty->TN_no_color_video = 0; |
| 25002 | 3368 } |
| 3369 | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3370 tty_default_color_capabilities (tty, 1); |
|
42742
73fcf65b58d3
(tty_default_color_capabilities, tty_setup_colors)
Eli Zaretskii <eliz@gnu.org>
parents:
42122
diff
changeset
|
3371 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3372 MagicWrap (tty) = tgetflag ("xn"); |
|
11530
a265aaa699e0
(term_init): MagicWrap implies AutoWrap.
Karl Heuer <kwzh@gnu.org>
parents:
11235
diff
changeset
|
3373 /* Since we make MagicWrap terminals look like AutoWrap, we need to have |
|
a265aaa699e0
(term_init): MagicWrap implies AutoWrap.
Karl Heuer <kwzh@gnu.org>
parents:
11235
diff
changeset
|
3374 the former flag imply the latter. */ |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3375 AutoWrap (tty) = MagicWrap (tty) || tgetflag ("am"); |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3376 terminal->memory_below_frame = tgetflag ("db"); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3377 tty->TF_hazeltine = tgetflag ("hz"); |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3378 terminal->must_write_spaces = tgetflag ("in"); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3379 tty->meta_key = tgetflag ("km") || tgetflag ("MT"); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3380 tty->TF_insmode_motion = tgetflag ("mi"); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3381 tty->TF_standout_motion = tgetflag ("ms"); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3382 tty->TF_underscore = tgetflag ("ul"); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3383 tty->TF_teleray = tgetflag ("xt"); |
| 253 | 3384 |
|
110588
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3385 #else /* DOS_NT */ |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3386 #ifdef WINDOWSNT |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3387 { |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3388 struct frame *f = XFRAME (selected_frame); |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3389 |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3390 initialize_w32_display (terminal); |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3391 |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3392 FrameRows (tty) = FRAME_LINES (f); |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3393 FrameCols (tty) = FRAME_COLS (f); |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3394 tty->specified_window = FRAME_LINES (f); |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3395 |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3396 FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3397 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3398 terminal->char_ins_del_ok = 1; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3399 baud_rate = 19200; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3400 } |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3401 #else /* MSDOS */ |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3402 { |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3403 int height, width; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3404 if (strcmp (terminal_type, "internal") == 0) |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3405 terminal->type = output_msdos_raw; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3406 initialize_msdos_display (terminal); |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3407 |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3408 get_tty_size (fileno (tty->input), &width, &height); |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3409 FrameCols (tty) = width; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3410 FrameRows (tty) = height; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3411 terminal->char_ins_del_ok = 0; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3412 init_baud_rate (fileno (tty->input)); |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3413 } |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3414 #endif /* MSDOS */ |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3415 tty->output = stdout; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3416 tty->input = stdin; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3417 /* The following two are inaccessible from w32console.c. */ |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3418 terminal->delete_frame_hook = &tty_free_frame_resources; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3419 terminal->delete_terminal_hook = &delete_tty; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3420 |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3421 tty->name = xstrdup (name); |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3422 terminal->name = xstrdup (name); |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3423 tty->type = xstrdup (terminal_type); |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3424 |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3425 add_keyboard_wait_descriptor (0); |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3426 |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3427 tty->delete_in_insert_mode = 1; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3428 |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3429 UseTabs (tty) = 0; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3430 terminal->scroll_region_ok = 0; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3431 |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3432 /* Seems to insert lines when it's not supposed to, messing up the |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3433 display. In doing a trace, it didn't seem to be called much, so I |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3434 don't think we're losing anything by turning it off. */ |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3435 terminal->line_ins_del_ok = 0; |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3436 |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3437 tty->TN_max_colors = 16; /* Required to be non-zero for tty-display-color-p */ |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3438 #endif /* DOS_NT */ |
|
0995e4af573f
Code simplification in term.c.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
110562
diff
changeset
|
3439 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3440 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3441 init_kboard (terminal->kboard); |
|
85614
9f3a25157e4f
Make `window-system' into a keyboard-local variable (rather than
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85106
diff
changeset
|
3442 terminal->kboard->Vwindow_system = Qnil; |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3443 terminal->kboard->next_kboard = all_kboards; |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3444 all_kboards = terminal->kboard; |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3445 terminal->kboard->reference_count++; |
|
83317
e235da12dd03
Make sure the terminfo function key sequences are set up in the correct function-key-map.
Karoly Lorentey <lorentey@elte.hu>
parents:
83315
diff
changeset
|
3446 /* Don't let the initial kboard remain current longer than necessary. |
|
e235da12dd03
Make sure the terminfo function key sequences are set up in the correct function-key-map.
Karoly Lorentey <lorentey@elte.hu>
parents:
83315
diff
changeset
|
3447 That would cause problems if a file loaded on startup tries to |
|
e235da12dd03
Make sure the terminfo function key sequences are set up in the correct function-key-map.
Karoly Lorentey <lorentey@elte.hu>
parents:
83315
diff
changeset
|
3448 prompt in the mini-buffer. */ |
|
e235da12dd03
Make sure the terminfo function key sequences are set up in the correct function-key-map.
Karoly Lorentey <lorentey@elte.hu>
parents:
83315
diff
changeset
|
3449 if (current_kboard == initial_kboard) |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3450 current_kboard = terminal->kboard; |
| 97658 | 3451 #ifndef DOS_NT |
|
83619
5da6a46ddbd6
* s/darwin.h (SYSTEM_PURESIZE_EXTRA): Define here.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83616
diff
changeset
|
3452 term_get_fkeys (address, terminal->kboard); |
|
97141
840bd675fd85
* s/ms-w32.h (MULTI_KBOARD): Remove.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
97043
diff
changeset
|
3453 |
| 765 | 3454 /* Get frame size from system, or else from termcap. */ |
|
16093
4c74d7f1cfa6
(term_init): Avoid type-mismatch calling get_frame_size.
Richard M. Stallman <rms@gnu.org>
parents:
15974
diff
changeset
|
3455 { |
|
4c74d7f1cfa6
(term_init): Avoid type-mismatch calling get_frame_size.
Richard M. Stallman <rms@gnu.org>
parents:
15974
diff
changeset
|
3456 int height, width; |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
3457 get_tty_size (fileno (tty->input), &width, &height); |
| 53341 | 3458 FrameCols (tty) = width; |
| 3459 FrameRows (tty) = height; | |
|
16093
4c74d7f1cfa6
(term_init): Avoid type-mismatch calling get_frame_size.
Richard M. Stallman <rms@gnu.org>
parents:
15974
diff
changeset
|
3460 } |
|
4c74d7f1cfa6
(term_init): Avoid type-mismatch calling get_frame_size.
Richard M. Stallman <rms@gnu.org>
parents:
15974
diff
changeset
|
3461 |
| 53341 | 3462 if (FrameCols (tty) <= 0) |
| 3463 FrameCols (tty) = tgetnum ("co"); | |
| 3464 if (FrameRows (tty) <= 0) | |
| 3465 FrameRows (tty) = tgetnum ("li"); | |
| 3466 | |
| 3467 if (FrameRows (tty) < 3 || FrameCols (tty) < 3) | |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3468 maybe_fatal (must_succeed, terminal, |
|
109375
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3469 "Screen size %dx%d is too small", |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3470 "Screen size %dx%d is too small", |
| 53341 | 3471 FrameCols (tty), FrameRows (tty)); |
|
10332
e14daed4a820
(term_init): Fatal error if screen is too small.
Richard M. Stallman <rms@gnu.org>
parents:
10261
diff
changeset
|
3472 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3473 TabWidth (tty) = tgetnum ("tw"); |
| 253 | 3474 |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3475 if (!tty->TS_bell) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3476 tty->TS_bell = "\07"; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3477 |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3478 if (!tty->TS_fwd_scroll) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3479 tty->TS_fwd_scroll = Down (tty); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3480 |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3481 PC = tty->TS_pad_char ? *tty->TS_pad_char : 0; |
| 253 | 3482 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3483 if (TabWidth (tty) < 0) |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3484 TabWidth (tty) = 8; |
|
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46559
diff
changeset
|
3485 |
| 253 | 3486 /* Turned off since /etc/termcap seems to have :ta= for most terminals |
| 3487 and newer termcap doc does not seem to say there is a default. | |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3488 if (!tty->Wcm->cm_tab) |
|
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3489 tty->Wcm->cm_tab = "\t"; |
| 253 | 3490 */ |
| 3491 | |
|
40086
050b19294988
(TN_standout_width, TF_xs, TN_magic_cookie_glitch_ul): Variables removed.
Miles Bader <miles@gnu.org>
parents:
40081
diff
changeset
|
3492 /* We don't support standout modes that use `magic cookies', so |
|
050b19294988
(TN_standout_width, TF_xs, TN_magic_cookie_glitch_ul): Variables removed.
Miles Bader <miles@gnu.org>
parents:
40081
diff
changeset
|
3493 turn off any that do. */ |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3494 if (tty->TS_standout_mode && tgetnum ("sg") >= 0) |
|
40086
050b19294988
(TN_standout_width, TF_xs, TN_magic_cookie_glitch_ul): Variables removed.
Miles Bader <miles@gnu.org>
parents:
40081
diff
changeset
|
3495 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3496 tty->TS_standout_mode = 0; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3497 tty->TS_end_standout_mode = 0; |
|
40086
050b19294988
(TN_standout_width, TF_xs, TN_magic_cookie_glitch_ul): Variables removed.
Miles Bader <miles@gnu.org>
parents:
40081
diff
changeset
|
3498 } |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3499 if (tty->TS_enter_underline_mode && tgetnum ("ug") >= 0) |
|
40086
050b19294988
(TN_standout_width, TF_xs, TN_magic_cookie_glitch_ul): Variables removed.
Miles Bader <miles@gnu.org>
parents:
40081
diff
changeset
|
3500 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3501 tty->TS_enter_underline_mode = 0; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3502 tty->TS_exit_underline_mode = 0; |
|
40086
050b19294988
(TN_standout_width, TF_xs, TN_magic_cookie_glitch_ul): Variables removed.
Miles Bader <miles@gnu.org>
parents:
40081
diff
changeset
|
3503 } |
|
050b19294988
(TN_standout_width, TF_xs, TN_magic_cookie_glitch_ul): Variables removed.
Miles Bader <miles@gnu.org>
parents:
40081
diff
changeset
|
3504 |
|
050b19294988
(TN_standout_width, TF_xs, TN_magic_cookie_glitch_ul): Variables removed.
Miles Bader <miles@gnu.org>
parents:
40081
diff
changeset
|
3505 /* If there's no standout mode, try to use underlining instead. */ |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3506 if (tty->TS_standout_mode == 0) |
| 253 | 3507 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3508 tty->TS_standout_mode = tty->TS_enter_underline_mode; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3509 tty->TS_end_standout_mode = tty->TS_exit_underline_mode; |
| 253 | 3510 } |
| 3511 | |
|
5933
560cee2048ed
(term_init): If no `se', use `me';
Richard M. Stallman <rms@gnu.org>
parents:
5648
diff
changeset
|
3512 /* If no `se' string, try using a `me' string instead. |
|
560cee2048ed
(term_init): If no `se', use `me';
Richard M. Stallman <rms@gnu.org>
parents:
5648
diff
changeset
|
3513 If that fails, we can't use standout mode at all. */ |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3514 if (tty->TS_end_standout_mode == 0) |
|
5933
560cee2048ed
(term_init): If no `se', use `me';
Richard M. Stallman <rms@gnu.org>
parents:
5648
diff
changeset
|
3515 { |
|
8612
86065bec6fc9
(term_init): Added missing argument to tgetstr.
Richard M. Stallman <rms@gnu.org>
parents:
8027
diff
changeset
|
3516 char *s = tgetstr ("me", address); |
|
5933
560cee2048ed
(term_init): If no `se', use `me';
Richard M. Stallman <rms@gnu.org>
parents:
5648
diff
changeset
|
3517 if (s != 0) |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3518 tty->TS_end_standout_mode = s; |
|
5933
560cee2048ed
(term_init): If no `se', use `me';
Richard M. Stallman <rms@gnu.org>
parents:
5648
diff
changeset
|
3519 else |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3520 tty->TS_standout_mode = 0; |
|
5933
560cee2048ed
(term_init): If no `se', use `me';
Richard M. Stallman <rms@gnu.org>
parents:
5648
diff
changeset
|
3521 } |
|
560cee2048ed
(term_init): If no `se', use `me';
Richard M. Stallman <rms@gnu.org>
parents:
5648
diff
changeset
|
3522 |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3523 if (tty->TF_teleray) |
| 253 | 3524 { |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3525 tty->Wcm->cm_tab = 0; |
|
40086
050b19294988
(TN_standout_width, TF_xs, TN_magic_cookie_glitch_ul): Variables removed.
Miles Bader <miles@gnu.org>
parents:
40081
diff
changeset
|
3526 /* We can't support standout mode, because it uses magic cookies. */ |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3527 tty->TS_standout_mode = 0; |
| 253 | 3528 /* But that means we cannot rely on ^M to go to column zero! */ |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3529 CR (tty) = 0; |
| 253 | 3530 /* LF can't be trusted either -- can alter hpos */ |
| 3531 /* if move at column 0 thru a line with TS_standout_mode */ | |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3532 Down (tty) = 0; |
| 253 | 3533 } |
| 3534 | |
| 3535 /* Special handling for certain terminal types known to need it */ | |
| 3536 | |
| 3537 if (!strcmp (terminal_type, "supdup")) | |
| 3538 { | |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3539 terminal->memory_below_frame = 1; |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3540 tty->Wcm->cm_losewrap = 1; |
| 253 | 3541 } |
| 3542 if (!strncmp (terminal_type, "c10", 3) | |
| 3543 || !strcmp (terminal_type, "perq")) | |
| 3544 { | |
| 3545 /* Supply a makeshift :wi string. | |
| 3546 This string is not valid in general since it works only | |
| 3547 for windows starting at the upper left corner; | |
| 3548 but that is all Emacs uses. | |
| 3549 | |
| 765 | 3550 This string works only if the frame is using |
| 253 | 3551 the top of the video memory, because addressing is memory-relative. |
| 3552 So first check the :ti string to see if that is true. | |
| 3553 | |
| 3554 It would be simpler if the :wi string could go in the termcap | |
| 3555 entry, but it can't because it is not fully valid. | |
| 3556 If it were in the termcap entry, it would confuse other programs. */ | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3557 if (!tty->TS_set_window) |
| 253 | 3558 { |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3559 p = tty->TS_termcap_modes; |
| 253 | 3560 while (*p && strcmp (p, "\033v ")) |
| 3561 p++; | |
| 3562 if (*p) | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3563 tty->TS_set_window = "\033v%C %C %C %C "; |
| 253 | 3564 } |
| 3565 /* Termcap entry often fails to have :in: flag */ | |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3566 terminal->must_write_spaces = 1; |
| 253 | 3567 /* :ti string typically fails to have \E^G! in it */ |
| 3568 /* This limits scope of insert-char to one line. */ | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3569 strcpy (area, tty->TS_termcap_modes); |
| 253 | 3570 strcat (area, "\033\007!"); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3571 tty->TS_termcap_modes = area; |
| 253 | 3572 area += strlen (area) + 1; |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3573 p = AbsPosition (tty); |
| 253 | 3574 /* Change all %+ parameters to %C, to handle |
|
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
3575 values above 96 correctly for the C100. */ |
| 253 | 3576 while (*p) |
|
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
3577 { |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
3578 if (p[0] == '%' && p[1] == '+') |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
3579 p[1] = 'C'; |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
3580 p++; |
|
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
3581 } |
| 253 | 3582 } |
| 3583 | |
| 53341 | 3584 tty->specified_window = FrameRows (tty); |
| 253 | 3585 |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3586 if (Wcm_init (tty) == -1) /* can't do cursor motion */ |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3587 { |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3588 maybe_fatal (must_succeed, terminal, |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3589 "Terminal type \"%s\" is not powerful enough to run Emacs", |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3590 "Terminal type \"%s\" is not powerful enough to run Emacs.\n\ |
|
12412
7f2c068121d8
(term_init): Alternative error messages for TERMCAP/TERMINFO.
Richard M. Stallman <rms@gnu.org>
parents:
12071
diff
changeset
|
3591 It lacks the ability to position the cursor.\n\ |
|
7f2c068121d8
(term_init): Alternative error messages for TERMCAP/TERMINFO.
Richard M. Stallman <rms@gnu.org>
parents:
12071
diff
changeset
|
3592 If that is not the actual type of terminal you have,\n\ |
|
7f2c068121d8
(term_init): Alternative error messages for TERMCAP/TERMINFO.
Richard M. Stallman <rms@gnu.org>
parents:
12071
diff
changeset
|
3593 use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ |
|
107847
e81bca2fba28
(init_tty): Move common text outside of #ifdef TERMINFO.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
107640
diff
changeset
|
3594 `setenv TERM ...') to specify the correct type. It may be necessary\n" |
|
e81bca2fba28
(init_tty): Move common text outside of #ifdef TERMINFO.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
107640
diff
changeset
|
3595 # ifdef TERMINFO |
|
e81bca2fba28
(init_tty): Move common text outside of #ifdef TERMINFO.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
107640
diff
changeset
|
3596 "to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.", |
|
12412
7f2c068121d8
(term_init): Alternative error messages for TERMCAP/TERMINFO.
Richard M. Stallman <rms@gnu.org>
parents:
12071
diff
changeset
|
3597 # else /* TERMCAP */ |
|
107847
e81bca2fba28
(init_tty): Move common text outside of #ifdef TERMINFO.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
107640
diff
changeset
|
3598 "to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", |
|
12412
7f2c068121d8
(term_init): Alternative error messages for TERMCAP/TERMINFO.
Richard M. Stallman <rms@gnu.org>
parents:
12071
diff
changeset
|
3599 # endif /* TERMINFO */ |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3600 terminal_type); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3601 } |
|
82990
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
3602 |
| 53341 | 3603 if (FrameRows (tty) <= 0 || FrameCols (tty) <= 0) |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3604 maybe_fatal (must_succeed, terminal, |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3605 "Could not determine the frame size", |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3606 "Could not determine the frame size"); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3607 |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3608 tty->delete_in_insert_mode |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3609 = tty->TS_delete_mode && tty->TS_insert_mode |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3610 && !strcmp (tty->TS_delete_mode, tty->TS_insert_mode); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3611 |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3612 tty->se_is_so = (tty->TS_standout_mode |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3613 && tty->TS_end_standout_mode |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3614 && !strcmp (tty->TS_standout_mode, tty->TS_end_standout_mode)); |
| 253 | 3615 |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
3616 UseTabs (tty) = tabs_safe_p (fileno (tty->input)) && TabWidth (tty) == 8; |
| 253 | 3617 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3618 terminal->scroll_region_ok |
|
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53229
diff
changeset
|
3619 = (tty->Wcm->cm_abs |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3620 && (tty->TS_set_window || tty->TS_set_scroll_region || tty->TS_set_scroll_region_1)); |
| 253 | 3621 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3622 terminal->line_ins_del_ok |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3623 = (((tty->TS_ins_line || tty->TS_ins_multi_lines) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3624 && (tty->TS_del_line || tty->TS_del_multi_lines)) |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3625 || (terminal->scroll_region_ok |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3626 && tty->TS_fwd_scroll && tty->TS_rev_scroll)); |
|
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
53225
diff
changeset
|
3627 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3628 terminal->char_ins_del_ok |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3629 = ((tty->TS_ins_char || tty->TS_insert_mode |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3630 || tty->TS_pad_inserted_char || tty->TS_ins_multi_chars) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3631 && (tty->TS_del_char || tty->TS_del_multi_chars)); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3632 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3633 terminal->fast_clear_end_of_line = tty->TS_clr_line != 0; |
| 253 | 3634 |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
3635 init_baud_rate (fileno (tty->input)); |
|
83004
7900111db01c
Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
82995
diff
changeset
|
3636 |
| 97658 | 3637 #endif /* not DOS_NT */ |
|
84849
ba20cee1aec0
(init_tty): Call init_sys_modes on WINDOWSNT also.
Jason Rumney <jasonr@gnu.org>
parents:
84779
diff
changeset
|
3638 |
| 53341 | 3639 /* Init system terminal modes (RAW or CBREAK, etc.). */ |
| 3640 init_sys_modes (tty); | |
|
82990
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
3641 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3642 return terminal; |
| 253 | 3643 } |
| 3644 | |
|
109375
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3645 |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3646 static void |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3647 vfatal (const char *str, va_list ap) |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3648 { |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3649 fprintf (stderr, "emacs: "); |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3650 vfprintf (stderr, str, ap); |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3651 if (!(strlen (str) > 0 && str[strlen (str) - 1] == '\n')) |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3652 fprintf (stderr, "\n"); |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3653 va_end (ap); |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3654 fflush (stderr); |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3655 exit (1); |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3656 } |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3657 |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3658 |
|
83341
76e51706154e
Rename term_init to init_tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83338
diff
changeset
|
3659 /* Auxiliary error-handling function for init_tty. |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3660 Delete TERMINAL, then call error or fatal with str1 or str2, |
|
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3661 respectively, according to MUST_SUCCEED. */ |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
3662 |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3663 static void |
|
109375
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3664 maybe_fatal (int must_succeed, struct terminal *terminal, |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3665 const char *str1, const char *str2, ...) |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3666 { |
|
109375
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3667 va_list ap; |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3668 va_start (ap, str2); |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3669 if (terminal) |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3670 delete_tty (terminal); |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
3671 |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3672 if (must_succeed) |
|
109375
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3673 vfatal (str2, ap); |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3674 else |
|
109375
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3675 verror (str1, ap); |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3676 |
|
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3677 va_end (ap); |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3678 abort (); |
| 253 | 3679 } |
| 3680 | |
| 21514 | 3681 void |
|
86288
145903731829
* term.c: Include stdarg.h.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85614
diff
changeset
|
3682 fatal (const char *str, ...) |
| 253 | 3683 { |
|
86288
145903731829
* term.c: Include stdarg.h.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85614
diff
changeset
|
3684 va_list ap; |
|
145903731829
* term.c: Include stdarg.h.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85614
diff
changeset
|
3685 va_start (ap, str); |
|
109375
3e07e13fe30a
Convert maybe_fatal to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109179
diff
changeset
|
3686 vfatal (str, ap); |
|
86288
145903731829
* term.c: Include stdarg.h.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85614
diff
changeset
|
3687 va_end (ap); |
| 253 | 3688 } |
|
6752
f9236145bad7
(system_uses_terminfo): New variable.
Karl Heuer <kwzh@gnu.org>
parents:
6652
diff
changeset
|
3689 |
|
82988
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
3690 |
|
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
3691 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3692 /* Delete the given tty terminal, closing all frames on it. */ |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
3693 |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
3694 static void |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3695 delete_tty (struct terminal *terminal) |
|
63549
bda22724fc82
(produce_special_glyphs): Use spec_glyph_lookup_face.
Richard M. Stallman <rms@gnu.org>
parents:
61591
diff
changeset
|
3696 { |
|
83004
7900111db01c
Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
82995
diff
changeset
|
3697 struct tty_display_info *tty; |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
3698 |
|
100666
dab9cf44bf3f
In comments, write delete_frame instead of Fdelete_frame.
Martin Rudalics <rudalics@gmx.at>
parents:
100370
diff
changeset
|
3699 /* Protect against recursive calls. delete_frame in |
|
83525
b2e7507b55c6
Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents:
83522
diff
changeset
|
3700 delete_terminal calls us back when it deletes our last frame. */ |
|
84692
0d8dd9a91520
(get_tty_terminal): Don't treat output_initial specially.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84461
diff
changeset
|
3701 if (!terminal->name) |
| 53341 | 3702 return; |
| 3703 | |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3704 if (terminal->type != output_termcap) |
|
83004
7900111db01c
Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
82995
diff
changeset
|
3705 abort (); |
|
7900111db01c
Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
82995
diff
changeset
|
3706 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3707 tty = terminal->display_info.tty; |
|
92281
4bf10a5a835d
(encode_terminal_code, produce_special_glyphs): Likewise.
Kim F. Storm <storm@cua.dk>
parents:
92237
diff
changeset
|
3708 |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3709 if (tty == tty_list) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3710 tty_list = tty->next; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3711 else |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3712 { |
|
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
82988
diff
changeset
|
3713 struct tty_display_info *p; |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3714 for (p = tty_list; p && p->next != tty; p = p->next) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3715 ; |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3716 |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3717 if (! p) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3718 /* This should not happen. */ |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3719 abort (); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3720 |
| 53341 | 3721 p->next = tty->next; |
| 3722 tty->next = 0; | |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3723 } |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3724 |
|
83342
9216636c02fc
Rename `struct display' to `struct device'. Update function, parameter and variable names accordingly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83341
diff
changeset
|
3725 /* reset_sys_modes needs a valid device, so this call needs to be |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3726 before delete_terminal. */ |
|
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3727 reset_sys_modes (tty); |
|
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
3728 |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3729 delete_terminal (terminal); |
|
83004
7900111db01c
Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
82995
diff
changeset
|
3730 |
|
95481
4390d64d3328
Make "xfree (NULL)" a no-op; remove useless if-before-xfree.
Jim Meyering <jim@meyering.net>
parents:
94963
diff
changeset
|
3731 xfree (tty->name); |
|
4390d64d3328
Make "xfree (NULL)" a no-op; remove useless if-before-xfree.
Jim Meyering <jim@meyering.net>
parents:
94963
diff
changeset
|
3732 xfree (tty->type); |
|
82990
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
3733 |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3734 if (tty->input) |
|
82988
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
3735 { |
|
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
3736 delete_keyboard_wait_descriptor (fileno (tty->input)); |
|
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
3737 if (tty->input != stdin) |
|
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
3738 fclose (tty->input); |
|
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
3739 } |
|
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
3740 if (tty->output && tty->output != stdout && tty->output != tty->input) |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3741 fclose (tty->output); |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3742 if (tty->termscript) |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3743 fclose (tty->termscript); |
|
82990
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
3744 |
|
95481
4390d64d3328
Make "xfree (NULL)" a no-op; remove useless if-before-xfree.
Jim Meyering <jim@meyering.net>
parents:
94963
diff
changeset
|
3745 xfree (tty->old_tty); |
|
4390d64d3328
Make "xfree (NULL)" a no-op; remove useless if-before-xfree.
Jim Meyering <jim@meyering.net>
parents:
94963
diff
changeset
|
3746 xfree (tty->Wcm); |
|
103624
3e06f0e66062
Remove useless if-before-xfree tests.
Jim Meyering <jim@meyering.net>
parents:
103617
diff
changeset
|
3747 xfree (tty->termcap_strings_buffer); |
|
3e06f0e66062
Remove useless if-before-xfree tests.
Jim Meyering <jim@meyering.net>
parents:
103617
diff
changeset
|
3748 xfree (tty->termcap_term_buffer); |
|
82990
2ecd1f669db9
Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents:
82989
diff
changeset
|
3749 |
|
109165
750db9f3e6d8
Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents:
109144
diff
changeset
|
3750 memset (tty, 0, sizeof (struct tty_display_info)); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3751 xfree (tty); |
|
63549
bda22724fc82
(produce_special_glyphs): Use spec_glyph_lookup_face.
Richard M. Stallman <rms@gnu.org>
parents:
61591
diff
changeset
|
3752 } |
|
bda22724fc82
(produce_special_glyphs): Use spec_glyph_lookup_face.
Richard M. Stallman <rms@gnu.org>
parents:
61591
diff
changeset
|
3753 |
|
83004
7900111db01c
Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
82995
diff
changeset
|
3754 |
|
7900111db01c
Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
82995
diff
changeset
|
3755 |
|
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
82988
diff
changeset
|
3756 /* Mark the pointers in the tty_display_info objects. |
|
82988
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
3757 Called by the Fgarbage_collector. */ |
|
83025
c66ebcc29777
Removed %T in mode-line-format. Trivial documentation changes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83021
diff
changeset
|
3758 |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3759 void |
|
83420
521d3f18b3d1
Reimplement terminal parameters in C; clean up term.c, create terminal.c.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
3760 mark_ttys (void) |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3761 { |
|
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
82988
diff
changeset
|
3762 struct tty_display_info *tty; |
|
83032
b8237c556f0e
Fix the case when emacsclient is run on Emacs's controlling tty.
Karoly Lorentey <lorentey@elte.hu>
parents:
83027
diff
changeset
|
3763 |
|
82988
f82e3a6f5ccb
A few more bugfixes and new features.
Karoly Lorentey <lorentey@elte.hu>
parents:
82987
diff
changeset
|
3764 for (tty = tty_list; tty; tty = tty->next) |
|
83762
ffb5395e8445
(mark_ttys): Don't bother checking top_frame (incorrectly)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
83653
diff
changeset
|
3765 mark_object (tty->top_frame); |
|
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3766 } |
|
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
53232
diff
changeset
|
3767 |
|
83004
7900111db01c
Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
82995
diff
changeset
|
3768 |
|
7900111db01c
Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
82995
diff
changeset
|
3769 |
| 21514 | 3770 void |
|
109144
7dceae91724c
Convert most remaining function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109108
diff
changeset
|
3771 syms_of_term (void) |
|
6752
f9236145bad7
(system_uses_terminfo): New variable.
Karl Heuer <kwzh@gnu.org>
parents:
6652
diff
changeset
|
3772 { |
|
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39914
diff
changeset
|
3773 DEFVAR_BOOL ("system-uses-terminfo", &system_uses_terminfo, |
|
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39914
diff
changeset
|
3774 doc: /* Non-nil means the system uses terminfo rather than termcap. |
|
39914
91951fb5b9e5
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39697
diff
changeset
|
3775 This variable can be used by terminal emulator packages. */); |
|
6752
f9236145bad7
(system_uses_terminfo): New variable.
Karl Heuer <kwzh@gnu.org>
parents:
6652
diff
changeset
|
3776 #ifdef TERMINFO |
|
f9236145bad7
(system_uses_terminfo): New variable.
Karl Heuer <kwzh@gnu.org>
parents:
6652
diff
changeset
|
3777 system_uses_terminfo = 1; |
|
f9236145bad7
(system_uses_terminfo): New variable.
Karl Heuer <kwzh@gnu.org>
parents:
6652
diff
changeset
|
3778 #else |
|
f9236145bad7
(system_uses_terminfo): New variable.
Karl Heuer <kwzh@gnu.org>
parents:
6652
diff
changeset
|
3779 system_uses_terminfo = 0; |
|
f9236145bad7
(system_uses_terminfo): New variable.
Karl Heuer <kwzh@gnu.org>
parents:
6652
diff
changeset
|
3780 #endif |
|
15974
61249a8fe735
(Vring_bell_function): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
15094
diff
changeset
|
3781 |
|
83891
dab32bc3edc8
* server.el (server-start, server-unload-hook): Undo previous
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83889
diff
changeset
|
3782 DEFVAR_LISP ("suspend-tty-functions", &Vsuspend_tty_functions, |
|
dab32bc3edc8
* server.el (server-start, server-unload-hook): Undo previous
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83889
diff
changeset
|
3783 doc: /* Functions to be run after suspending a tty. |
|
103048
b5e8a934cfd1
* term.c (Vsuspend_tty_functions, Vresume_tty_functions): Doc fixes,
Chong Yidong <cyd@stupidchicken.com>
parents:
103047
diff
changeset
|
3784 The functions are run with one argument, the terminal object to be suspended. |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
3785 See `suspend-tty'. */); |
|
83891
dab32bc3edc8
* server.el (server-start, server-unload-hook): Undo previous
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83889
diff
changeset
|
3786 Vsuspend_tty_functions = Qnil; |
|
dab32bc3edc8
* server.el (server-start, server-unload-hook): Undo previous
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83889
diff
changeset
|
3787 |
|
dab32bc3edc8
* server.el (server-start, server-unload-hook): Undo previous
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83889
diff
changeset
|
3788 |
|
dab32bc3edc8
* server.el (server-start, server-unload-hook): Undo previous
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83889
diff
changeset
|
3789 DEFVAR_LISP ("resume-tty-functions", &Vresume_tty_functions, |
|
dab32bc3edc8
* server.el (server-start, server-unload-hook): Undo previous
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83889
diff
changeset
|
3790 doc: /* Functions to be run after resuming a tty. |
|
103048
b5e8a934cfd1
* term.c (Vsuspend_tty_functions, Vresume_tty_functions): Doc fixes,
Chong Yidong <cyd@stupidchicken.com>
parents:
103047
diff
changeset
|
3791 The functions are run with one argument, the terminal object that was revived. |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
3792 See `resume-tty'. */); |
|
83891
dab32bc3edc8
* server.el (server-start, server-unload-hook): Undo previous
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83889
diff
changeset
|
3793 Vresume_tty_functions = Qnil; |
| 25002 | 3794 |
|
67935
52bbc53dbce1
(visible_cursor): New boolean var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66238
diff
changeset
|
3795 DEFVAR_BOOL ("visible-cursor", &visible_cursor, |
|
52bbc53dbce1
(visible_cursor): New boolean var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66238
diff
changeset
|
3796 doc: /* Non-nil means to make the cursor very visible. |
|
52bbc53dbce1
(visible_cursor): New boolean var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66238
diff
changeset
|
3797 This only has an effect when running in a text terminal. |
|
52bbc53dbce1
(visible_cursor): New boolean var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66238
diff
changeset
|
3798 What means \"very visible\" is up to your terminal. It may make the cursor |
|
52bbc53dbce1
(visible_cursor): New boolean var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66238
diff
changeset
|
3799 bigger, or it may make it blink, or it may do nothing at all. */); |
|
52bbc53dbce1
(visible_cursor): New boolean var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66238
diff
changeset
|
3800 visible_cursor = 1; |
|
52bbc53dbce1
(visible_cursor): New boolean var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
66238
diff
changeset
|
3801 |
| 25002 | 3802 defsubr (&Stty_display_color_p); |
|
42954
e514d4931d6f
(Ftty_display_color_cells): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
42808
diff
changeset
|
3803 defsubr (&Stty_display_color_cells); |
|
63549
bda22724fc82
(produce_special_glyphs): Use spec_glyph_lookup_face.
Richard M. Stallman <rms@gnu.org>
parents:
61591
diff
changeset
|
3804 defsubr (&Stty_no_underline); |
|
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3805 defsubr (&Stty_type); |
|
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83420
diff
changeset
|
3806 defsubr (&Scontrolling_tty_p); |
|
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
3807 defsubr (&Ssuspend_tty); |
|
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83050
diff
changeset
|
3808 defsubr (&Sresume_tty); |
|
80994
62b6aa7f8c37
Use HAVE_GPM instead of HAVE_GPM_H.
Nick Roberts <nickrob@snap.net.nz>
parents:
80979
diff
changeset
|
3809 #ifdef HAVE_GPM |
|
84968
85eb2660cbe3
(mouse_face_window): Rename from Qmouse_face_window. Update all users.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84955
diff
changeset
|
3810 defsubr (&Sgpm_mouse_start); |
|
85eb2660cbe3
(mouse_face_window): Rename from Qmouse_face_window. Update all users.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84955
diff
changeset
|
3811 defsubr (&Sgpm_mouse_stop); |
|
80994
62b6aa7f8c37
Use HAVE_GPM instead of HAVE_GPM_H.
Nick Roberts <nickrob@snap.net.nz>
parents:
80979
diff
changeset
|
3812 #endif /* HAVE_GPM */ |
|
97021
fb376eec83a9
(syms_of_term): Initialize default_orig_pair, default_set_foreground,
Chong Yidong <cyd@stupidchicken.com>
parents:
96303
diff
changeset
|
3813 |
| 97658 | 3814 #ifndef DOS_NT |
|
97021
fb376eec83a9
(syms_of_term): Initialize default_orig_pair, default_set_foreground,
Chong Yidong <cyd@stupidchicken.com>
parents:
96303
diff
changeset
|
3815 default_orig_pair = NULL; |
|
fb376eec83a9
(syms_of_term): Initialize default_orig_pair, default_set_foreground,
Chong Yidong <cyd@stupidchicken.com>
parents:
96303
diff
changeset
|
3816 default_set_foreground = NULL; |
|
fb376eec83a9
(syms_of_term): Initialize default_orig_pair, default_set_foreground,
Chong Yidong <cyd@stupidchicken.com>
parents:
96303
diff
changeset
|
3817 default_set_background = NULL; |
| 97658 | 3818 #endif /* !DOS_NT */ |
|
100276
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3819 |
|
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3820 encode_terminal_src = NULL; |
|
8f4457a692c5
(encode_terminal_code): Free any previous memory blocks
Chong Yidong <cyd@stupidchicken.com>
parents:
98367
diff
changeset
|
3821 encode_terminal_dst = NULL; |
|
6752
f9236145bad7
(system_uses_terminfo): New variable.
Karl Heuer <kwzh@gnu.org>
parents:
6652
diff
changeset
|
3822 } |
| 25002 | 3823 |
