comparison src/frame-tty.c @ 771:943eaba38521

[xemacs-hg @ 2002-03-13 08:51:24 by ben] The big ben-mule-21-5 check-in! Various files were added and deleted. See CHANGES-ben-mule. There are still some test suite failures. No crashes, though. Many of the failures have to do with problems in the test suite itself rather than in the actual code. I'll be addressing these in the next day or so -- none of the test suite failures are at all critical. Meanwhile I'll be trying to address the biggest issues -- i.e. build or run failures, which will almost certainly happen on various platforms. All comments should be sent to ben@xemacs.org -- use a Cc: if necessary when sending to mailing lists. There will be pre- and post- tags, something like pre-ben-mule-21-5-merge-in, and post-ben-mule-21-5-merge-in.
author ben
date Wed, 13 Mar 2002 08:54:06 +0000
parents abe6d1db359e
children e38acbeb1cae
comparison
equal deleted inserted replaced
770:336a418893b5 771:943eaba38521
1 /* TTY frame functions. 1 /* TTY frame functions.
2 Copyright (C) 1995 Free Software Foundation, Inc. 2 Copyright (C) 1995, 1997 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1996 Ben Wing. 3 Copyright (C) 1995, 1996, 2002 Ben Wing.
4 Copyright (C) 1997 Free Software Foundation, Inc.
5 4
6 This file is part of XEmacs. 5 This file is part of XEmacs.
7 6
8 XEmacs is free software; you can redistribute it and/or modify it 7 XEmacs is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
35 34
36 35
37 /* Default properties to use when creating frames. */ 36 /* Default properties to use when creating frames. */
38 Lisp_Object Vdefault_tty_frame_plist; 37 Lisp_Object Vdefault_tty_frame_plist;
39 38
39 Lisp_Object Qframe_number;
40
40 static void tty_raise_frame (struct frame *); 41 static void tty_raise_frame (struct frame *);
41 42
42 43
43 static void 44 static void
44 tty_init_frame_1 (struct frame *f, Lisp_Object props) 45 tty_init_frame_1 (struct frame *f, Lisp_Object props,
46 int frame_name_is_defaulted)
45 { 47 {
46 struct device *d = XDEVICE (FRAME_DEVICE (f)); 48 struct device *d = XDEVICE (FRAME_DEVICE (f));
47 struct console *c = XCONSOLE (DEVICE_CONSOLE (d)); 49 struct console *c = XCONSOLE (DEVICE_CONSOLE (d));
48 50
49 ++CONSOLE_TTY_DATA (c)->frame_count; 51 ++CONSOLE_TTY_DATA (c)->frame_count;
50 f->order_count = CONSOLE_TTY_DATA (c)->frame_count; 52 f->order_count = CONSOLE_TTY_DATA (c)->frame_count;
51 f->height = CONSOLE_TTY_DATA (c)->height; 53 f->height = CONSOLE_TTY_DATA (c)->height;
52 f->width = CONSOLE_TTY_DATA (c)->width; 54 f->width = CONSOLE_TTY_DATA (c)->width;
55 if (frame_name_is_defaulted)
56 f->name = emacs_sprintf_string ("F%d", f->order_count);
53 } 57 }
54 58
55 static void 59 static void
56 tty_init_frame_3 (struct frame *f) 60 tty_init_frame_3 (struct frame *f)
57 { 61 {
84 88
85 /* Change from withdrawn state to mapped state. */ 89 /* Change from withdrawn state to mapped state. */
86 static void 90 static void
87 tty_make_frame_visible (struct frame *f) 91 tty_make_frame_visible (struct frame *f)
88 { 92 {
89 if (!FRAME_VISIBLE_P(f)) 93 if (!FRAME_VISIBLE_P (f))
90 { 94 {
91 f->visible = -1; 95 f->visible = -1;
92 } 96 }
93 } 97 }
94 98
106 } 110 }
107 111
108 static void 112 static void
109 tty_make_frame_unhidden (struct frame *f) 113 tty_make_frame_unhidden (struct frame *f)
110 { 114 {
111 if (!FRAME_REPAINT_P(f)) 115 if (!FRAME_REPAINT_P (f))
112 { 116 {
113 SET_FRAME_CLEAR(f); 117 SET_FRAME_CLEAR (f);
114 f->visible = 1; 118 f->visible = 1;
115 } 119 }
116 } 120 }
117 121
118 static int 122 static int
158 break; 162 break;
159 } 163 }
160 164
161 /* To lower this frame, another frame has to be raised. Return if 165 /* To lower this frame, another frame has to be raised. Return if
162 there is no other frame. */ 166 there is no other frame. */
163 if (NILP (tail) && EQ(frame_list, tail)) 167 if (NILP (tail) && EQ (frame_list, tail))
164 return; 168 return;
165 169
166 tty_make_frame_hidden (f); 170 tty_make_frame_hidden (f);
167 if (CONSP (XCDR (tail))) 171 if (CONSP (XCDR (tail)))
168 new = XCAR (XCDR (tail)); 172 new = XCAR (XCDR (tail));
177 { 181 {
178 struct device *d = XDEVICE (FRAME_DEVICE (f)); 182 struct device *d = XDEVICE (FRAME_DEVICE (f));
179 183
180 if (!NILP (DEVICE_SELECTED_FRAME (d))) 184 if (!NILP (DEVICE_SELECTED_FRAME (d)))
181 tty_raise_frame (XFRAME (DEVICE_SELECTED_FRAME (d))); 185 tty_raise_frame (XFRAME (DEVICE_SELECTED_FRAME (d)));
186 }
187
188 static Lisp_Object
189 tty_frame_property (struct frame *f, Lisp_Object property)
190 {
191 if (EQ (Qframe_number, property))
192 return make_int (f->order_count);
193
194 return Qunbound;
195 }
196
197 static int
198 tty_internal_frame_property_p (struct frame *f, Lisp_Object property)
199 {
200 return EQ (property, Qframe_number);
201 }
202
203 static Lisp_Object
204 tty_frame_properties (struct frame *f)
205 {
206 Lisp_Object props = Qnil;
207
208 props = cons3 (Qframe_number, make_int (f->order_count), props);
209
210 return props;
182 } 211 }
183 212
184 /************************************************************************/ 213 /************************************************************************/
185 /* initialization */ 214 /* initialization */
186 /************************************************************************/ 215 /************************************************************************/
195 CONSOLE_HAS_METHOD (tty, make_frame_invisible); 224 CONSOLE_HAS_METHOD (tty, make_frame_invisible);
196 CONSOLE_HAS_METHOD (tty, frame_visible_p); 225 CONSOLE_HAS_METHOD (tty, frame_visible_p);
197 CONSOLE_HAS_METHOD (tty, raise_frame); 226 CONSOLE_HAS_METHOD (tty, raise_frame);
198 CONSOLE_HAS_METHOD (tty, lower_frame); 227 CONSOLE_HAS_METHOD (tty, lower_frame);
199 CONSOLE_HAS_METHOD (tty, delete_frame); 228 CONSOLE_HAS_METHOD (tty, delete_frame);
229 CONSOLE_HAS_METHOD (tty, frame_property);
230 CONSOLE_HAS_METHOD (tty, internal_frame_property_p);
231 CONSOLE_HAS_METHOD (tty, frame_properties);
232 }
233
234 void
235 syms_of_frame_tty (void)
236 {
237 DEFSYMBOL (Qframe_number);
200 } 238 }
201 239
202 void 240 void
203 vars_of_frame_tty (void) 241 vars_of_frame_tty (void)
204 { 242 {