0
|
1 /* TTY frame functions.
|
|
2 Copyright (C) 1995 Free Software Foundation, Inc.
|
|
3 Copyright (C) 1995, 1996 Ben Wing.
|
|
4
|
|
5 This file is part of XEmacs.
|
|
6
|
|
7 XEmacs is free software; you can redistribute it and/or modify it
|
|
8 under the terms of the GNU General Public License as published by the
|
|
9 Free Software Foundation; either version 2, or (at your option) any
|
|
10 later version.
|
|
11
|
|
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
15 for more details.
|
|
16
|
|
17 You should have received a copy of the GNU General Public License
|
|
18 along with XEmacs; see the file COPYING. If not, write to
|
|
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
20 Boston, MA 02111-1307, USA. */
|
|
21
|
|
22 /* Synched up with: Not in FSF. */
|
|
23
|
|
24 /* Written by Ben Wing. */
|
|
25
|
|
26 /* #### This file is just a stub. It should be possible to have more
|
|
27 than one frame on a tty, with only one frame being "active" (displayed)
|
|
28 at a time. */
|
|
29
|
|
30 #include <config.h>
|
|
31 #include "lisp.h"
|
|
32
|
|
33 #include "console-tty.h"
|
|
34 #include "frame.h"
|
|
35
|
|
36 Lisp_Object Vdefault_tty_frame_plist;
|
|
37
|
|
38 static void
|
|
39 tty_init_frame_1 (struct frame *f, Lisp_Object props)
|
|
40 {
|
|
41 struct device *d = XDEVICE (FRAME_DEVICE (f));
|
|
42 struct console *c = XCONSOLE (DEVICE_CONSOLE (d));
|
|
43 if (!NILP (DEVICE_FRAME_LIST (d)))
|
|
44 error ("Only one frame allowed on TTY devices");
|
|
45
|
|
46 f->name = build_string ("emacs");
|
|
47 f->height = CONSOLE_TTY_DATA (c)->height;
|
|
48 f->width = CONSOLE_TTY_DATA (c)->width;
|
|
49 f->visible = 1;
|
|
50 #ifdef HAVE_SCROLLBARS
|
|
51 f->scrollbar_on_left = 1;
|
|
52 f->scrollbar_on_top = 0;
|
|
53 #endif
|
|
54 SET_FRAME_CLEAR (f);
|
|
55 }
|
|
56
|
|
57 static void
|
|
58 tty_after_init_frame (struct frame *f, int first_on_device,
|
|
59 int first_on_console)
|
|
60 {
|
|
61 if (first_on_console)
|
|
62 call1 (Qinit_post_tty_win, FRAME_CONSOLE (f));
|
|
63 }
|
|
64
|
108
|
65 /* Change from withdrawn state to mapped state. */
|
|
66 static void
|
|
67 tty_make_frame_visible (struct frame *f)
|
|
68 {
|
|
69 if (!FRAME_VISIBLE_P(f))
|
|
70 {
|
|
71 SET_FRAME_CLEAR(f);
|
|
72 f->visible = 1;
|
|
73 }
|
|
74
|
|
75 }
|
|
76
|
|
77 /* Change from mapped state to withdrawn state. */
|
|
78 static void
|
|
79 tty_make_frame_invisible (struct frame *f)
|
|
80 {
|
|
81 f->visible = 0;
|
|
82 }
|
|
83
|
|
84 static int
|
|
85 tty_frame_visible_p (struct frame *f)
|
|
86 {
|
|
87 return FRAME_VISIBLE_P(f);
|
|
88 }
|
|
89
|
0
|
90
|
|
91 /************************************************************************/
|
|
92 /* initialization */
|
|
93 /************************************************************************/
|
|
94
|
|
95 void
|
|
96 console_type_create_frame_tty (void)
|
|
97 {
|
|
98 CONSOLE_HAS_METHOD (tty, init_frame_1);
|
|
99 CONSOLE_HAS_METHOD (tty, after_init_frame);
|
108
|
100 CONSOLE_HAS_METHOD (tty, make_frame_visible);
|
|
101 CONSOLE_HAS_METHOD (tty, make_frame_invisible);
|
|
102 CONSOLE_HAS_METHOD (tty, frame_visible_p);
|
0
|
103 }
|
|
104
|
|
105 void
|
|
106 vars_of_frame_tty (void)
|
|
107 {
|
|
108 DEFVAR_LISP ("default-tty-frame-plist", &Vdefault_tty_frame_plist /*
|
|
109 Plist of default frame-creation properties for tty frames.
|
|
110 These are in addition to and override what is specified in
|
|
111 `default-frame-plist', but are overridden by the arguments to the
|
|
112 particular call to `make-frame'.
|
|
113 */ );
|
|
114 Vdefault_tty_frame_plist = Qnil;
|
|
115
|
|
116 tty_console_methods->device_specific_frame_props =
|
|
117 &Vdefault_tty_frame_plist;
|
|
118 }
|