annotate src/frame-tty.c @ 5697:40fbceabaafd

menubar-items.el (default-menubar): Reorganize. Add PROBLEMS to toplevel. New "More about XEmacs" submenu for NEWS, licensing, etc. New "Recent History" menu for messages, lossage, etc. Get rid of ugly and unexpressive ellipses.
author Stephen J. Turnbull <stephen@xemacs.org>
date Mon, 24 Dec 2012 03:08:33 +0900
parents 56144c8593a8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* TTY frame functions.
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
2 Copyright (C) 1995, 1997 Free Software Foundation, Inc.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
3 Copyright (C) 1995, 1996, 2002 Ben Wing.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4477
diff changeset
7 XEmacs is free software: you can redistribute it and/or modify it
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4477
diff changeset
9 Free Software Foundation, either version 3 of the License, or (at your
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4477
diff changeset
10 option) any later version.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 4477
diff changeset
18 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 /* Synched up with: Not in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 /* Written by Ben Wing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 Multi-frame support added by Hrvoje Niksic. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 #include <config.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 #include "lisp.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 800
diff changeset
28 #include "device-impl.h"
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 793
diff changeset
29 #include "events.h"
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 800
diff changeset
30 #include "frame-impl.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 800
diff changeset
32 #include "console-tty-impl.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 /* Default properties to use when creating frames. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 Lisp_Object Vdefault_tty_frame_plist;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 3025
diff changeset
38 Lisp_Object Qframe_number, Qmake_frame_after_init_entry_point;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
39
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 static void tty_raise_frame (struct frame *);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 static void
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 872
diff changeset
44 tty_init_frame_1 (struct frame *f, Lisp_Object UNUSED (props),
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
45 int frame_name_is_defaulted)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 struct device *d = XDEVICE (FRAME_DEVICE (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 struct console *c = XCONSOLE (DEVICE_CONSOLE (d));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 ++CONSOLE_TTY_DATA (c)->frame_count;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 f->order_count = CONSOLE_TTY_DATA (c)->frame_count;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 f->height = CONSOLE_TTY_DATA (c)->height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 f->width = CONSOLE_TTY_DATA (c)->width;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
54 if (frame_name_is_defaulted)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
55 f->name = emacs_sprintf_string ("F%d", f->order_count);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 tty_init_frame_3 (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 tty_raise_frame (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 tty_select_frame_if_unhidden (Lisp_Object frame)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 if (FRAME_REPAINT_P (XFRAME (frame)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 select_frame_1 (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 tty_schedule_frame_select (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 {
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
74 Lisp_Object frame = wrap_frame (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 enqueue_magic_eval_event (tty_select_frame_if_unhidden, frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 static void
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 872
diff changeset
80 tty_after_init_frame (struct frame *f, int UNUSED (first_on_device),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 int first_on_console)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 if (first_on_console)
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 3025
diff changeset
84 call1 (Qmake_frame_after_init_entry_point, FRAME_CONSOLE (f));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 /* Change from withdrawn state to mapped state. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 tty_make_frame_visible (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
91 if (!FRAME_VISIBLE_P (f))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 f->visible = -1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 /* Change from mapped state to withdrawn state. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 tty_make_frame_invisible (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 f->visible = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 tty_make_frame_hidden (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 f->visible = -1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 tty_make_frame_unhidden (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
113 if (!FRAME_REPAINT_P (f))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 {
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
115 SET_FRAME_CLEAR (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 f->visible = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 static int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 tty_frame_visible_p (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 return FRAME_VISIBLE_P (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 tty_raise_frame_no_select (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 LIST_LOOP_2 (frame, DEVICE_FRAME_LIST (XDEVICE (FRAME_DEVICE (f))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 struct frame *o = XFRAME (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 if (o != f && FRAME_REPAINT_P (o))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 tty_make_frame_hidden (o);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 tty_make_frame_unhidden (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 tty_raise_frame (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 tty_raise_frame_no_select (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 tty_schedule_frame_select (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 tty_lower_frame (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 Lisp_Object frame_list = DEVICE_FRAME_LIST (XDEVICE (FRAME_DEVICE (f)));
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
152 Lisp_Object tail, new_;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 if (!FRAME_REPAINT_P (f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157 LIST_LOOP (tail, frame_list)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 if (f == XFRAME (XCAR (tail)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 /* To lower this frame, another frame has to be raised. Return if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 there is no other frame. */
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
165 if (NILP (tail) && EQ (frame_list, tail))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 tty_make_frame_hidden (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 if (CONSP (XCDR (tail)))
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
170 new_ = XCAR (XCDR (tail));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 else
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
172 new_ = XCAR (frame_list);
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
173 tty_make_frame_unhidden (XFRAME (new_));
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
174 tty_schedule_frame_select (XFRAME (new_));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 tty_delete_frame (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 struct device *d = XDEVICE (FRAME_DEVICE (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 if (!NILP (DEVICE_SELECTED_FRAME (d)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 tty_raise_frame (XFRAME (DEVICE_SELECTED_FRAME (d)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 }
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
185
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
186 static Lisp_Object
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
187 tty_frame_property (struct frame *f, Lisp_Object property)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
188 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
189 if (EQ (Qframe_number, property))
5581
56144c8593a8 Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents: 5402
diff changeset
190 return make_fixnum (f->order_count);
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
191
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
192 return Qunbound;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
193 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
194
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
195 static int
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 872
diff changeset
196 tty_internal_frame_property_p (struct frame *UNUSED (f), Lisp_Object property)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
197 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
198 return EQ (property, Qframe_number);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
199 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
200
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
201 static Lisp_Object
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
202 tty_frame_properties (struct frame *f)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
203 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
204 Lisp_Object props = Qnil;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
205
5581
56144c8593a8 Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents: 5402
diff changeset
206 props = cons3 (Qframe_number, make_fixnum (f->order_count), props);
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
207
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
208 return props;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
209 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 /* initialization */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 console_type_create_frame_tty (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 CONSOLE_HAS_METHOD (tty, init_frame_1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 CONSOLE_HAS_METHOD (tty, init_frame_3);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 CONSOLE_HAS_METHOD (tty, after_init_frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 CONSOLE_HAS_METHOD (tty, make_frame_visible);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 CONSOLE_HAS_METHOD (tty, make_frame_invisible);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 CONSOLE_HAS_METHOD (tty, frame_visible_p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 CONSOLE_HAS_METHOD (tty, raise_frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 CONSOLE_HAS_METHOD (tty, lower_frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 CONSOLE_HAS_METHOD (tty, delete_frame);
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
227 CONSOLE_HAS_METHOD (tty, frame_property);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
228 CONSOLE_HAS_METHOD (tty, internal_frame_property_p);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
229 CONSOLE_HAS_METHOD (tty, frame_properties);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
230 }
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
231
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
232 void
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
233 syms_of_frame_tty (void)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
234 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
235 DEFSYMBOL (Qframe_number);
4477
e34711681f30 Don't determine whether to call general device-type code at startup,
Aidan Kehoe <kehoea@parhasard.net>
parents: 3025
diff changeset
236 DEFSYMBOL (Qmake_frame_after_init_entry_point);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 vars_of_frame_tty (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 DEFVAR_LISP ("default-tty-frame-plist", &Vdefault_tty_frame_plist /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 Plist of default frame-creation properties for tty frames.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 These are in addition to and override what is specified in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 `default-frame-plist', but are overridden by the arguments to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 particular call to `make-frame'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 Vdefault_tty_frame_plist = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 tty_console_methods->device_specific_frame_props =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 &Vdefault_tty_frame_plist;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 /* Tty frames are now supported. Advertise a feature to indicate this. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 Fprovide (intern ("tty-frames"));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 }