comparison src/cm.h @ 53232:22aaf1e5fbe6

Full support for multiple terminal I/O (with some rough edges). lib-src/emacsclient.c (emacs_pid): New variable. (window_change): Forward the SIGWINCH signal to the Emacs process after copying the size parameters to the proxy terminal. (copy_from_to): New parameter (sigio), kill Emacs with SIGIO if it is nonzero. (main): Set emacs_pid. lisp/server.el (server-process-filter): Send the pid of Emacs to emacsclient. src/cm.c: Added tty parameters to all functions and all Wcm macro calls. src/cm.h: Added tty parameters to all macros. Updated function prototypes. (Wcm): Moved to struct tty_output. src/dispextern.h: Updated function prototypes. src/dispnew.c: Added tty parameters to all Wcm macro calls. (do_switch_frame): Make old frame obscured, not invisible, to solve problems with other-frame. (Wcm): Moved to struct tty_output. src/keyboard.c (read_avail_input): Select the frame corresponding to the tty that was read. Slight rearrangement of tty loop. src/lisp.h (tabs_safe_p): Removed duplicate prototype. src/sysdep.c (hft_init, hft_reset): Added tty_output parameter. (discard_tty_input): Discard input from all ttys on APOLLO, too. Whatever it is. (narrow_foreground_group, widen_foreground_group): Added tty parameter (not really useful, the functions only work on the controlling tty.) (tabs_safe_p): Added tty parameter. src/term.c Added tty parameters to all Wcm macro calls. Standardised updating_frame vs. selected frame and tty_output access. (term_init): Allocate Wcm. (syms_of_term): Provide the `multi-tty' feature. src/termchar.h (struct tty_output): Added Wcm. src/xdisp.c (try_window_id): Make sure we use the tty device corresponding to the current frame. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-8
author Karoly Lorentey <lorentey@elte.hu>
date Sat, 27 Dec 2003 01:12:57 +0000
parents dd3018b4785b
children db645482d6bc
comparison
equal deleted inserted replaced
53231:e0c359b85b58 53232:22aaf1e5fbe6
96 int cc_abs; 96 int cc_abs;
97 int cc_habs; 97 int cc_habs;
98 int cc_vabs; 98 int cc_vabs;
99 }; 99 };
100 100
101 extern struct cm Wcm; /* Terminal capabilities */
102 extern char PC; /* Pad character */ 101 extern char PC; /* Pad character */
103 102
104 /* Shorthand */ 103 /* Shorthand */
105 #ifndef NoCMShortHand 104 #ifndef NoCMShortHand
106 #define curY Wcm.cm_curY 105 #define curY(tty) (tty)->Wcm->cm_curY
107 #define curX Wcm.cm_curX 106 #define curX(tty) (tty)->Wcm->cm_curX
108 #define Up Wcm.cm_up 107 #define Up(tty) (tty)->Wcm->cm_up
109 #define Down Wcm.cm_down 108 #define Down(tty) (tty)->Wcm->cm_down
110 #define Left Wcm.cm_left 109 #define Left(tty) (tty)->Wcm->cm_left
111 #define Right Wcm.cm_right 110 #define Right(tty) (tty)->Wcm->cm_right
112 #define Tab Wcm.cm_tab 111 #define Tab(tty) (tty)->Wcm->cm_tab
113 #define BackTab Wcm.cm_backtab 112 #define BackTab(tty) (tty)->Wcm->cm_backtab
114 #define TabWidth Wcm.cm_tabwidth 113 #define TabWidth(tty) (tty)->Wcm->cm_tabwidth
115 #define CR Wcm.cm_cr 114 #define CR(tty) (tty)->Wcm->cm_cr
116 #define Home Wcm.cm_home 115 #define Home(tty) (tty)->Wcm->cm_home
117 #define LastLine Wcm.cm_ll 116 #define LastLine(tty) (tty)->Wcm->cm_ll
118 #define AbsPosition Wcm.cm_abs 117 #define AbsPosition(tty) (tty)->Wcm->cm_abs
119 #define ColPosition Wcm.cm_habs 118 #define ColPosition(tty) (tty)->Wcm->cm_habs
120 #define RowPosition Wcm.cm_vabs 119 #define RowPosition(tty) (tty)->Wcm->cm_vabs
121 #define MultiUp Wcm.cm_multiup 120 #define MultiUp(tty) (tty)->Wcm->cm_multiup
122 #define MultiDown Wcm.cm_multidown 121 #define MultiDown(tty) (tty)->Wcm->cm_multidown
123 #define MultiLeft Wcm.cm_multileft 122 #define MultiLeft(tty) (tty)->Wcm->cm_multileft
124 #define MultiRight Wcm.cm_multiright 123 #define MultiRight(tty) (tty)->Wcm->cm_multiright
125 #define AutoWrap Wcm.cm_autowrap 124 #define AutoWrap(tty) (tty)->Wcm->cm_autowrap
126 #define MagicWrap Wcm.cm_magicwrap 125 #define MagicWrap(tty) (tty)->Wcm->cm_magicwrap
127 #define UseTabs Wcm.cm_usetabs 126 #define UseTabs(tty) (tty)->Wcm->cm_usetabs
128 #define FrameRows Wcm.cm_rows 127 #define FrameRows(tty) (tty)->Wcm->cm_rows
129 #define FrameCols Wcm.cm_cols 128 #define FrameCols(tty) (tty)->Wcm->cm_cols
130 129
131 #define UpCost Wcm.cc_up 130 #define UpCost(tty) (tty)->Wcm->cc_up
132 #define DownCost Wcm.cc_down 131 #define DownCost(tty) (tty)->Wcm->cc_down
133 #define LeftCost Wcm.cc_left 132 #define LeftCost(tty) (tty)->Wcm->cc_left
134 #define RightCost Wcm.cc_right 133 #define RightCost(tty) (tty)->Wcm->cc_right
135 #define HomeCost Wcm.cc_home 134 #define HomeCost(tty) (tty)->Wcm->cc_home
136 #define CRCost Wcm.cc_cr 135 #define CRCost(tty) (tty)->Wcm->cc_cr
137 #define LastLineCost Wcm.cc_ll 136 #define LastLineCost(tty) (tty)->Wcm->cc_ll
138 #define TabCost Wcm.cc_tab 137 #define TabCost(tty) (tty)->Wcm->cc_tab
139 #define BackTabCost Wcm.cc_backtab 138 #define BackTabCost(tty) (tty)->Wcm->cc_backtab
140 #define AbsPositionCost Wcm.cc_abs 139 #define AbsPositionCost(tty) (tty)->Wcm->cc_abs
141 #define ColPositionCost Wcm.cc_habs 140 #define ColPositionCost(tty) (tty)->Wcm->cc_habs
142 #define RowPositionCost Wcm.cc_vabs 141 #define RowPositionCost(tty) (tty)->Wcm->cc_vabs
143 #define MultiUpCost Wcm.cc_multiup 142 #define MultiUpCost(tty) (tty)->Wcm->cc_multiup
144 #define MultiDownCost Wcm.cc_multidown 143 #define MultiDownCost(tty) (tty)->Wcm->cc_multidown
145 #define MultiLeftCost Wcm.cc_multileft 144 #define MultiLeftCost(tty) (tty)->Wcm->cc_multileft
146 #define MultiRightCost Wcm.cc_multiright 145 #define MultiRightCost(tty) (tty)->Wcm->cc_multiright
147 #endif 146 #endif
148 147
149 #define cmat(row,col) (curY = (row), curX = (col)) 148 #define cmat(tty,row,col) (curY(tty) = (row), curX(tty) = (col))
150 #define cmplus(n) \ 149 #define cmplus(tty,n) \
151 { \ 150 { \
152 if ((curX += (n)) >= FrameCols && !MagicWrap) \ 151 if ((curX (tty) += (n)) >= FrameCols (tty) && !MagicWrap (tty)) \
153 { \ 152 { \
154 if (Wcm.cm_losewrap) losecursor (); \ 153 if ((tty)->Wcm->cm_losewrap) losecursor (tty); \
155 else if (AutoWrap) curX = 0, curY++; \ 154 else if (AutoWrap (tty)) curX (tty) = 0, curY (tty)++; \
156 else curX--; \ 155 else curX (tty)--; \
157 } \ 156 } \
158 } 157 }
159 158
160 #define losecursor() (curX = -1, curY = -1) 159 #define losecursor(tty) (curX(tty) = -1, curY(tty) = -1)
161 160
162 extern int cost; 161 extern int cost;
163 extern int evalcost (); 162 extern int evalcost ();
164 163
165 #define emacs_tputs(tty, str, affcnt, putc) (current_tty = (tty), tputs (str, affcnt, putc)) 164 #define emacs_tputs(tty, str, affcnt, putc) (current_tty = (tty), tputs (str, affcnt, putc))
166 165
167 extern struct tty_output *current_tty; 166 extern struct tty_output *current_tty;
168 extern void cmcheckmagic P_ ((struct tty_output *)); 167 extern void cmcheckmagic P_ ((struct tty_output *));
169 extern int cmputc P_ ((int)); 168 extern int cmputc P_ ((int));
170 extern void cmcostinit (); 169 extern void cmcostinit P_ ((struct tty_output *tty));
171 extern void cmgoto P_ ((struct tty_output *, int, int)); 170 extern void cmgoto P_ ((struct tty_output *, int, int));
172 extern void Wcm_clear (); 171 extern void Wcm_clear P_ ((struct tty_output *tty));
173 extern int Wcm_init (); 172 extern int Wcm_init P_ ((struct tty_output *tty));
174 173
175 /* arch-tag: acc1535a-7136-49d6-b22d-9bc85702251b 174 /* arch-tag: acc1535a-7136-49d6-b22d-9bc85702251b
176 (do not change this comment) */ 175 (do not change this comment) */