annotate src/frame-tty.c @ 339:336b97f03633 r21-0-67

Import from CVS: tag r21-0-67
author cvs
date Mon, 13 Aug 2007 10:51:27 +0200
parents c42ec1d1cded
children 8626e4521993
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* TTY frame functions.
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
2 Copyright (C) 1995 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 Copyright (C) 1995, 1996 Ben Wing.
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
4 Copyright (C) 1997 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
25 /* Written by Ben Wing.
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
26 Multi-frame support added by Hrvoje Niksic. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 #include <config.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #include "lisp.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #include "console-tty.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #include "frame.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
34 #include "events.h"
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
35
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
36 #ifdef HAVE_GPM
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
37 #include <gpm.h>
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
38 #endif
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
39
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
40
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
41 /* Default properties to use when creating frames. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 Lisp_Object Vdefault_tty_frame_plist;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
44 static void tty_raise_frame (struct frame *);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
45
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
46
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 tty_init_frame_1 (struct frame *f, Lisp_Object props)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 struct device *d = XDEVICE (FRAME_DEVICE (f));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 struct console *c = XCONSOLE (DEVICE_CONSOLE (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
53 ++CONSOLE_TTY_DATA (c)->frame_count;
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
54 f->order_count = CONSOLE_TTY_DATA (c)->frame_count;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 f->height = CONSOLE_TTY_DATA (c)->height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 f->width = CONSOLE_TTY_DATA (c)->width;
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
57 }
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
58
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
59 static void
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
60 tty_init_frame_3 (struct frame *f)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
61 {
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
62 tty_raise_frame (f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
63 }
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
64
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
65 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
66 tty_select_frame_if_unhidden (Lisp_Object frame)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
67 {
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
68 if (FRAME_REPAINT_P (XFRAME (frame)))
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
69 select_frame_1 (frame);
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
70 }
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
71
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
72 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
73 tty_schedule_frame_select (struct frame *f)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
74 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
75 Lisp_Object frame;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
76
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
77 XSETFRAME (frame, f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
78 enqueue_magic_eval_event (tty_select_frame_if_unhidden, frame);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 tty_after_init_frame (struct frame *f, int first_on_device,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 int first_on_console)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 if (first_on_console)
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
86 call1 (Qinit_post_tty_win, FRAME_CONSOLE (f));
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
89 #ifdef HAVE_GPM
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
90 static int
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
91 tty_get_mouse_position (struct device *d, Lisp_Object *frame, int *x, int *y)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
92 {
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
93 Gpm_Event ev;
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
94 int num_buttons;
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
95
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
96 num_buttons = Gpm_GetSnapshot(&ev);
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
97 *x = ev.x;
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
98 *y = ev.y;
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
99 *frame = DEVICE_SELECTED_FRAME (d);
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
100 return (1);
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
101 }
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
102
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
103 static void
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
104 tty_set_mouse_position (struct window *w, int x, int y)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
105 {
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
106 /* XXX
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
107 I couldn't find any GPM functions that set the mouse position.
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
108 Mr. Perry had left this function empty; that must be why.
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
109 karlheg
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
110 */
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
111 }
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
112
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
113 #endif
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
114
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
115
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
116 /* Change from withdrawn state to mapped state. */
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
117 static void
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
118 tty_make_frame_visible (struct frame *f)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
119 {
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
120 if (!FRAME_VISIBLE_P(f))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
121 {
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
122 f->visible = -1;
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
123 }
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
124 }
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
125
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
126 /* Change from mapped state to withdrawn state. */
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
127 static void
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
128 tty_make_frame_invisible (struct frame *f)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
129 {
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
130 f->visible = 0;
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
131 }
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
132
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
133 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
134 tty_make_frame_hidden (struct frame *f)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
135 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
136 f->visible = -1;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
137 }
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
138
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
139 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
140 tty_make_frame_unhidden (struct frame *f)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
141 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
142 if (!FRAME_REPAINT_P(f))
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
143 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
144 SET_FRAME_CLEAR(f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
145 f->visible = 1;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
146 }
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
147 }
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
148
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
149 static int
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
150 tty_frame_visible_p (struct frame *f)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
151 {
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
152 return FRAME_VISIBLE_P (f);
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
153 }
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
154
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
155 static void
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
156 tty_raise_frame_no_select (struct frame *f)
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
157 {
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
158 struct frame *o;
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
159 Lisp_Object tail;
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
160
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
161 LIST_LOOP (tail, DEVICE_FRAME_LIST (XDEVICE (FRAME_DEVICE (f))))
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
162 {
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
163 o = XFRAME (XCAR (tail));
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
164 if (o != f && FRAME_REPAINT_P(o))
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
165 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
166 tty_make_frame_hidden (o);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
167 break;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
168 }
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
169 }
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
170 tty_make_frame_unhidden (f);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
171 }
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
172
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
173 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
174 tty_raise_frame (struct frame *f)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
175 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
176 tty_raise_frame_no_select (f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
177 tty_schedule_frame_select (f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
178 }
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
179
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
180 static void
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
181 tty_lower_frame (struct frame *f)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
182 {
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
183 Lisp_Object frame_list = DEVICE_FRAME_LIST (XDEVICE (FRAME_DEVICE (f)));
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
184 Lisp_Object tail, new;
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
185
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
186 if (!FRAME_REPAINT_P (f))
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
187 return;
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
188
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
189 LIST_LOOP (tail, frame_list)
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
190 {
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
191 if (f == XFRAME (XCAR (tail)))
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
192 break;
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
193 }
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
194
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
195 /* To lower this frame, another frame has to be raised. Return if
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
196 there is no other frame. */
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
197 if (NILP (tail) && EQ(frame_list, tail))
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
198 return;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
199
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
200 tty_make_frame_hidden (f);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
201 if (CONSP (XCDR (tail)))
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
202 new = XCAR (XCDR (tail));
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
203 else
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
204 new = XCAR (frame_list);
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
205 tty_make_frame_unhidden (XFRAME (new));
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
206 tty_schedule_frame_select (XFRAME (new));
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
207 }
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
208
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
209 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
210 tty_delete_frame (struct frame *f)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
211 {
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
212 struct device *d = XDEVICE (FRAME_DEVICE (f));
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
213
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
214 if (!NILP (DEVICE_SELECTED_FRAME (d)))
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
215 tty_raise_frame (XFRAME (DEVICE_SELECTED_FRAME (d)));
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
216 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 /************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 /* initialization */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 /************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 console_type_create_frame_tty (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 CONSOLE_HAS_METHOD (tty, init_frame_1);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
226 CONSOLE_HAS_METHOD (tty, init_frame_3);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 CONSOLE_HAS_METHOD (tty, after_init_frame);
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
228 #ifdef HAVE_GPM
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
229 CONSOLE_HAS_METHOD (tty, get_mouse_position);
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
230 CONSOLE_HAS_METHOD (tty, set_mouse_position);
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
231 #endif
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
232 CONSOLE_HAS_METHOD (tty, make_frame_visible);
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
233 CONSOLE_HAS_METHOD (tty, make_frame_invisible);
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
234 CONSOLE_HAS_METHOD (tty, frame_visible_p);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
235 CONSOLE_HAS_METHOD (tty, raise_frame);
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
236 CONSOLE_HAS_METHOD (tty, lower_frame);
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
237 CONSOLE_HAS_METHOD (tty, delete_frame);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 vars_of_frame_tty (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 DEFVAR_LISP ("default-tty-frame-plist", &Vdefault_tty_frame_plist /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 Plist of default frame-creation properties for tty frames.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 These are in addition to and override what is specified in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 `default-frame-plist', but are overridden by the arguments to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 particular call to `make-frame'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 */ );
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 Vdefault_tty_frame_plist = Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 tty_console_methods->device_specific_frame_props =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 &Vdefault_tty_frame_plist;
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
253
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
254 /* Tty frames are now supported. Advertise a feature to indicate this. */
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
255 Fprovide (intern ("tty-frames"));
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 }