annotate src/frame-tty.c @ 223:2c611d1463a6 r20-4b10

Import from CVS: tag r20-4b10
author cvs
date Mon, 13 Aug 2007 10:10:54 +0200
parents 2d532a89d707
children c42ec1d1cded
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;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 #ifdef HAVE_SCROLLBARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 f->scrollbar_on_left = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 f->scrollbar_on_top = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 #endif
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
61 }
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
62
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
63 static void
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
64 tty_init_frame_3 (struct frame *f)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
65 {
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
66 tty_raise_frame (f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
67 }
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
68
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
69 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
70 tty_select_frame_if_unhidden (Lisp_Object frame)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
71 {
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
72 if (FRAME_REPAINT_P (XFRAME (frame)))
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
73 select_frame_1 (frame);
155
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
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
76 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
77 tty_schedule_frame_select (struct frame *f)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
78 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
79 Lisp_Object frame;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
80
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
81 XSETFRAME (frame, f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
82 enqueue_magic_eval_event (tty_select_frame_if_unhidden, frame);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 tty_after_init_frame (struct frame *f, int first_on_device,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 int first_on_console)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 if (first_on_console)
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
90 call1 (Qinit_post_tty_win, FRAME_CONSOLE (f));
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
93 #ifdef HAVE_GPM
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
94 static int
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
95 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
96 {
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
97 Gpm_Event ev;
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
98 int num_buttons;
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
99
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
100 num_buttons = Gpm_GetSnapshot(&ev);
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
101 *x = ev.x;
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
102 *y = ev.y;
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
103 *frame = DEVICE_SELECTED_FRAME (d);
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
104 return (1);
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
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
107 static void
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
108 tty_set_mouse_position (struct window *w, int x, int y)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
109 {
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
110 /* XXX
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
111 I couldn't find any GPM functions that set the mouse position.
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
112 Mr. Perry had left this function empty; that must be why.
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
113 karlheg
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 }
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
116
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
117 #endif
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
118
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
119
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
120 /* Change from withdrawn state to mapped state. */
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
121 static void
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
122 tty_make_frame_visible (struct frame *f)
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 if (!FRAME_VISIBLE_P(f))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
125 {
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
126 f->visible = -1;
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
127 }
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
128 }
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
129
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
130 /* Change from mapped state to withdrawn state. */
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
131 static void
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
132 tty_make_frame_invisible (struct frame *f)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
133 {
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
134 f->visible = 0;
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
135 }
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
136
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
137 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
138 tty_make_frame_hidden (struct frame *f)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
139 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
140 f->visible = -1;
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
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
143 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
144 tty_make_frame_unhidden (struct frame *f)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
145 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
146 if (!FRAME_REPAINT_P(f))
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 SET_FRAME_CLEAR(f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
149 f->visible = 1;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
150 }
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
151 }
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
152
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
153 static int
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
154 tty_frame_visible_p (struct frame *f)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
155 {
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
156 return FRAME_VISIBLE_P (f);
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
157 }
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
158
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
159 static void
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
160 tty_raise_frame_no_select (struct frame *f)
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
161 {
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
162 struct frame *o;
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
163 Lisp_Object tail;
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
164
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
165 LIST_LOOP (tail, DEVICE_FRAME_LIST (XDEVICE (FRAME_DEVICE (f))))
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
166 {
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
167 o = XFRAME (XCAR (tail));
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
168 if (o != f && FRAME_REPAINT_P(o))
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
169 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
170 tty_make_frame_hidden (o);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
171 break;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
172 }
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
173 }
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
174 tty_make_frame_unhidden (f);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
175 }
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
176
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
177 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
178 tty_raise_frame (struct frame *f)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
179 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
180 tty_raise_frame_no_select (f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
181 tty_schedule_frame_select (f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
182 }
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
183
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
184 static void
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
185 tty_lower_frame (struct frame *f)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
186 {
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
187 Lisp_Object frame_list = DEVICE_FRAME_LIST (XDEVICE (FRAME_DEVICE (f)));
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
188 Lisp_Object tail, new;
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
189
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
190 if (!FRAME_REPAINT_P (f))
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
191 return;
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
192
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
193 LIST_LOOP (tail, frame_list)
149
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 if (f == XFRAME (XCAR (tail)))
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
196 break;
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
197 }
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
198
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
199 /* To lower this frame, another frame has to be raised. Return if
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
200 there is no other frame. */
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
201 if (NILP (tail) && EQ(frame_list, tail))
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
202 return;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
203
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
204 tty_make_frame_hidden (f);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
205 if (CONSP (XCDR (tail)))
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
206 new = XCAR (XCDR (tail));
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
207 else
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
208 new = XCAR (frame_list);
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
209 tty_make_frame_unhidden (XFRAME (new));
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
210 tty_schedule_frame_select (XFRAME (new));
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
211 }
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
212
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
213 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
214 tty_delete_frame (struct frame *f)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
215 {
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
216 struct device *d = XDEVICE (FRAME_DEVICE (f));
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
217
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
218 if (!NILP (DEVICE_SELECTED_FRAME (d)))
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 175
diff changeset
219 tty_raise_frame (XFRAME (DEVICE_SELECTED_FRAME (d)));
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
220 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 /************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 /* initialization */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 /************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 console_type_create_frame_tty (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 CONSOLE_HAS_METHOD (tty, init_frame_1);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
230 CONSOLE_HAS_METHOD (tty, init_frame_3);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 CONSOLE_HAS_METHOD (tty, after_init_frame);
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
232 #ifdef HAVE_GPM
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
233 CONSOLE_HAS_METHOD (tty, get_mouse_position);
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
234 CONSOLE_HAS_METHOD (tty, set_mouse_position);
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
235 #endif
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
236 CONSOLE_HAS_METHOD (tty, make_frame_visible);
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
237 CONSOLE_HAS_METHOD (tty, make_frame_invisible);
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
238 CONSOLE_HAS_METHOD (tty, frame_visible_p);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
239 CONSOLE_HAS_METHOD (tty, raise_frame);
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
240 CONSOLE_HAS_METHOD (tty, lower_frame);
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
241 CONSOLE_HAS_METHOD (tty, delete_frame);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 vars_of_frame_tty (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 DEFVAR_LISP ("default-tty-frame-plist", &Vdefault_tty_frame_plist /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 Plist of default frame-creation properties for tty frames.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 These are in addition to and override what is specified in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 `default-frame-plist', but are overridden by the arguments to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 particular call to `make-frame'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 */ );
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 Vdefault_tty_frame_plist = Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 tty_console_methods->device_specific_frame_props =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 &Vdefault_tty_frame_plist;
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
257
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
258 /* Tty frames are now supported. Advertise a feature to indicate this. */
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
259 Fprovide (intern ("tty-frames"));
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 }