annotate src/frame-tty.c @ 158:558dfa75ffb3

Added tag r20-3b5 for changeset 6b37e6ddd302
author cvs
date Mon, 13 Aug 2007 09:40:48 +0200
parents 43dd3413c7c7
children 2d532a89d707
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
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
44 /* The count of frame number. */
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
45 static int tty_frame_count;
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
46
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
47 static void tty_raise_frame (struct frame *);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
48
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
49
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 tty_init_frame_1 (struct frame *f, Lisp_Object props)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 struct device *d = XDEVICE (FRAME_DEVICE (f));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 struct console *c = XCONSOLE (DEVICE_CONSOLE (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
56 ++CONSOLE_TTY_DATA (c)->frame_count;
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
57 f->order_count = CONSOLE_TTY_DATA (c)->frame_count;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 f->height = CONSOLE_TTY_DATA (c)->height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 f->width = CONSOLE_TTY_DATA (c)->width;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 #ifdef HAVE_SCROLLBARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 f->scrollbar_on_left = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 f->scrollbar_on_top = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 #endif
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
64 }
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
65
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
66 static void
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
67 tty_init_frame_3 (struct frame *f)
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 tty_raise_frame (f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
70 }
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
71
155
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_select_frame_if_unhidden (Lisp_Object frame)
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 if (FRAME_REPAINT_P (XFRAME (frame)))
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
76 select_frame_1 (frame);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
77 }
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 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
80 tty_schedule_frame_select (struct frame *f)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
81 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
82 Lisp_Object frame;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
83
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
84 XSETFRAME (frame, f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
85 enqueue_magic_eval_event (tty_select_frame_if_unhidden, frame);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 tty_after_init_frame (struct frame *f, int first_on_device,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 int first_on_console)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 if (first_on_console)
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
93 call1 (Qinit_post_tty_win, FRAME_CONSOLE (f));
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
96 #ifdef HAVE_GPM
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
97 static int
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
98 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
99 {
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
100 Gpm_Event ev;
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
101 int num_buttons;
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 num_buttons = Gpm_GetSnapshot(&ev);
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
104 *x = ev.x;
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
105 *y = ev.y;
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
106 *frame = DEVICE_SELECTED_FRAME (d);
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
107 return (1);
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
108 }
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 static void
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
111 tty_set_mouse_position (struct window *w, int x, int y)
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 /* XXX
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
114 I couldn't find any GPM functions that set the mouse position.
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
115 Mr. Perry had left this function empty; that must be why.
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
116 karlheg
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
117 */
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
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
120 #endif
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
121
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
122
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
123 /* Change from withdrawn state to mapped state. */
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
124 static void
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
125 tty_make_frame_visible (struct frame *f)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
126 {
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
127 if (!FRAME_VISIBLE_P(f))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
128 {
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
129 f->visible = -1;
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
130 }
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
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
133 /* Change from mapped state to withdrawn state. */
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
134 static void
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
135 tty_make_frame_invisible (struct frame *f)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
136 {
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
137 f->visible = 0;
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
138 }
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
139
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
140 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
141 tty_make_frame_hidden (struct frame *f)
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 f->visible = -1;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
144 }
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 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
147 tty_make_frame_unhidden (struct frame *f)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
148 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
149 if (!FRAME_REPAINT_P(f))
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 SET_FRAME_CLEAR(f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
152 f->visible = 1;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
153 }
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
154 }
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
155
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
156 static int
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
157 tty_frame_visible_p (struct frame *f)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
158 {
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
159 return FRAME_VISIBLE_P (f);
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
160 }
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
161
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
162 static void
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
163 tty_raise_frame_no_select (struct frame *f)
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
164 {
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
165 struct frame *o;
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
166 struct device *d = XDEVICE (FRAME_DEVICE (f));
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
167 Lisp_Object frame_list = DEVICE_FRAME_LIST (d);
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
168 Lisp_Object tail = frame_list;
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
169
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
170 while (CONSP (tail))
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
171 {
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
172 o = XFRAME (XCAR (tail));
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
173 if (o != f && FRAME_REPAINT_P(o))
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
174 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
175 tty_make_frame_hidden (o);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
176 break;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
177 }
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
178 tail = XCDR (tail);
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
179 }
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
180 tty_make_frame_unhidden (f);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
181 }
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
182
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
183 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
184 tty_raise_frame (struct frame *f)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
185 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
186 struct device *d = XDEVICE (FRAME_DEVICE (f));
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
187
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
188 tty_raise_frame_no_select (f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
189 tty_schedule_frame_select (f);
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
190 }
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
191
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
192 static void
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
193 tty_lower_frame (struct frame *f)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
194 {
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
195 struct frame *o;
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
196 struct device *d = XDEVICE (FRAME_DEVICE (f));
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
197 Lisp_Object frame_list = DEVICE_FRAME_LIST (d);
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
198 Lisp_Object tail;
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
199 Lisp_Object new;
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
200
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
201 if (!FRAME_REPAINT_P (f))
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
202 return;
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
203
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
204 tail = frame_list;
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
205 while (CONSP (tail))
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
206 {
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
207 o = XFRAME (XCAR (tail));
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
208 if (o == f)
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
209 break;
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
210 tail = XCDR (tail);
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
211 }
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
212
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
213 /* to lower this frame another frame has to be raised.
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
214 return if there is no other frame. */
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
215 if (!CONSP (tail) && EQ(frame_list, tail))
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
216 return;
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
217
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
218 tty_make_frame_hidden (f);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
219 if (CONSP (XCDR (tail)))
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
220 new = XCAR (XCDR (tail));
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
221 else
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
222 new = XCAR (frame_list);
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
223 tty_make_frame_unhidden (XFRAME (new));
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
224 tty_schedule_frame_select (XFRAME (new));
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
225 }
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
226
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
227 static void
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
228 tty_delete_frame (struct frame *f)
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
229 {
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
230 struct device *d = XDEVICE (FRAME_DEVICE (f));
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
231
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
232 if (!NILP (DEVICE_SELECTED_FRAME (d)))
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
233 tty_raise_frame (XFRAME (DEVICE_SELECTED_FRAME (d)));
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
234 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 /************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 /* initialization */
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 console_type_create_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 CONSOLE_HAS_METHOD (tty, init_frame_1);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
244 CONSOLE_HAS_METHOD (tty, init_frame_3);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 CONSOLE_HAS_METHOD (tty, after_init_frame);
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
246 #ifdef HAVE_GPM
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
247 CONSOLE_HAS_METHOD (tty, get_mouse_position);
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
248 CONSOLE_HAS_METHOD (tty, set_mouse_position);
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
249 #endif
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
250 CONSOLE_HAS_METHOD (tty, make_frame_visible);
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
251 CONSOLE_HAS_METHOD (tty, make_frame_invisible);
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
252 CONSOLE_HAS_METHOD (tty, frame_visible_p);
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
253 CONSOLE_HAS_METHOD (tty, raise_frame);
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 108
diff changeset
254 CONSOLE_HAS_METHOD (tty, lower_frame);
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
255 CONSOLE_HAS_METHOD (tty, delete_frame);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 vars_of_frame_tty (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 DEFVAR_LISP ("default-tty-frame-plist", &Vdefault_tty_frame_plist /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 Plist of default frame-creation properties for tty frames.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 These are in addition to and override what is specified in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 `default-frame-plist', but are overridden by the arguments to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 particular call to `make-frame'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 */ );
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 Vdefault_tty_frame_plist = Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 tty_console_methods->device_specific_frame_props =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 &Vdefault_tty_frame_plist;
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
271
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
272 /* Tty frames are now supported. Advertise a feature to indicate this. */
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 149
diff changeset
273 Fprovide (intern ("tty-frames"));
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 }