annotate src/frame-tty.c @ 108:360340f9fd5f r20-1b6

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