annotate src/frame.c @ 5126:2a462149bd6a ben-lisp-object

merge
author Ben Wing <ben@xemacs.org>
date Wed, 24 Feb 2010 19:04:27 -0600
parents b5df3737028a 92dc90c0bb40
children a9c41067dd88
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 /* Generic frame functions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3 Copyright (C) 1995, 1996, 2002, 2003, 2005, 2010 Ben Wing.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 Copyright (C) 1995 Sun Microsystems, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 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
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 /* Synched up with: FSF 19.30. */
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 /* This file has been Mule-ized. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
27 /* About window and frame geometry [ben]:
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
28
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
29 Here is an ASCII diagram:
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
30
5046
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
31 +------------------------------------------------------------------------|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
32 | window-manager decoration |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
33 | +--------------------------------------------------------------------+ |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
34 | | menubar | |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
35 | ###################################################################### |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
36 | # toolbar # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
37 | #--------------------------------------------------------------------# |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
38 | # | gutter | # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
39 | # |--------------------------------------------------------------| # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
40 | # | | internal border width | | # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
41 | # | | ******************************************************** | | # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
42 |w# | | * |s|v* |s* | | #w|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
43 |i# | | * |c|e* |c* | | #i|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
44 |n# | | * |r|r* |r* | | #n|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
45 |d# | | * |o|t* |o* | | #d|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
46 |o# | | * text area |l|.* text area |l* | | #o|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
47 |w# | |i* |l| * |l*i| | #w|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
48 |-# | |n* |b|d* |b*n| | #-|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
49 |m# | |t* |a|i* |a*t| | #m|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
50 |a# | |.* |r|v* |r*.| | #a|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
51 |n# t| | *-------------------------+-|i*----------------------+-* | |t #n|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
52 |a# o|g|b* scrollbar | |d* scrollbar | *b|g|o #a|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
53 |g# o|u|o*-------------------------+-|e*----------------------+-*o|u|o #g|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
54 |e# l|t|r* modeline |r* modeline *r|t|l #e|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
55 |r# b|t|d********************************************************d|t|b #r|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
56 | # a|e|e* =..texttexttex....= |s|v* |s*e|e|a # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
57 |d# r|r|r*o m=..texttexttextt..=o m|c|e* |c*r|r|r #d|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
58 |e# | | *u a=.exttexttextte...=u a|r|r* |r* | | #e|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
59 |c# | |w*t r=....texttexttex..=t r|o|t* |o*w| | #c|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
60 |o# | |i*s g= etc. =s g|l|.* text area |l*i| | #o|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
61 |r# | |d*i i= =i i|l| * |l*d| | #r|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
62 |a# | |t*d n= =d n|b|d* |b*t| | #a|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
63 |t# | |h*e = inner text area =e |a|i* |a*h| | #t|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
64 |i# | | * = = |r|v* |r* | | #i|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
65 |o# | | *---===================---+-|i*----------------------+-* | | #o|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
66 |n# | | * scrollbar | |d* scrollbar | * | | #n|
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
67 | # | | *-------------------------+-|e*----------------------+-* | | # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
68 | # | | * modeline |r* modeline * | | # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
69 | # | | ******************************************************** | | # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
70 | # | | * minibuffer * | | # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
71 | # | | ******************************************************** | | # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
72 | # | | internal border width | | # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
73 | # |--------------------------------------------------------------| # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
74 | # | gutter | # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
75 | #--------------------------------------------------------------------# |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
76 | # toolbar # |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
77 | ###################################################################### |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
78 | window manager decoration |
d4f666cda5e6 some random fixups
Ben Wing <ben@xemacs.org>
parents: 5045
diff changeset
79 +------------------------------------------------------------------------+
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
80
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
81 # = boundary of client area; * = window boundaries, boundary of paned area
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
82 = = boundary of inner text area; . = inside margin area
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
83
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
84 Note in particular what happens at the corners, where a "corner box"
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
85 occurs. Top and bottom toolbars take precedence over left and right
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
86 toolbars, extending out horizontally into the corner boxes. Gutters
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
87 work the same way. The corner box where the scrollbars meet, however,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
88 is assigned to neither scrollbar, and is known as the "dead box"; it is
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
89 an area that must be cleared specially.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
90
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
91 THE FRAME
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
92 ---------
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
93
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
94 The "top-level window area" is the entire area of a top-level window (or
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
95 "frame"). The "client area" (a term from MS Windows) is the area of a
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
96 top-level window that XEmacs draws into and manages with redisplay.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
97 This includes the toolbar, scrollbars, gutters, dividers, text area,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
98 modeline and minibuffer. It does not include the menubar, title or
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
99 outer borders. The "non-client area" is the area of a top-level window
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
100 outside of the client area and includes the menubar, title and outer
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
101 borders. Internally, all frame coordinates are relative to the client
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
102 area.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
103
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
104
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
105 THE NON-CLIENT AREA
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
106 -------------------
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
107
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
108 Under X, the non-client area is split into two parts:
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
109
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
110 (1) The outer layer is the window-manager decorations: The title and
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
111 borders. These are controlled by the window manager, a separate process
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
112 that controls the desktop, the location of icons, etc. When a process
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
113 tries to create a window, the window manager intercepts this action and
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
114 "reparents" the window, placing another window around it which contains
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
115 the window decorations, including the title bar, outer borders used for
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
116 resizing, etc. The window manager also implements any actions involving
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
117 the decorations, such as the ability to resize a window by dragging its
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
118 borders, move a window by dragging its title bar, etc. If there is no
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
119 window manager or you kill it, windows will have no decorations (and
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
120 will lose them if they previously had any) and you will not be able to
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
121 move or resize them.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
122
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
123 (2) Inside of the window-manager decorations is the "shell", which is
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
124 managed by the toolkit and widget libraries your program is linked with.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
125 The code in *-x.c uses the Xt toolkit and various possible widget
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
126 libraries built on top of Xt, such as Motif, Athena, the "Lucid"
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
127 widgets, etc. Another possibility is GTK (*-gtk.c), which implements
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
128 both the toolkit and widgets. Under Xt, the "shell" window is an
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
129 EmacsShell widget, containing an EmacsManager widget of the same size,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
130 which in turn contains a menubar widget and an EmacsFrame widget, inside
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
131 of which is the client area. (The division into EmacsShell and
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
132 EmacsManager is due to the complex and screwy geometry-management system
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
133 in Xt [and X more generally]. The EmacsShell handles negotation with
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
134 the window manager; the place of the EmacsManager widget is normally
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
135 assumed by a widget that manages the geometry of its child widgets, but
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
136 the EmacsManager widget just lets the XEmacs redisplay mechanism do the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
137 positioning.)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
138
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
139 Under Windows, the non-client area is managed by the window system.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
140 There is no division such as under X. Part of the window-system API
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
141 (USER.DLL) of Win32 includes functions to control the menubars, title,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
142 etc. and implements the move and resize behavior. There *is* an
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
143 equivalent of the window manager, called the "shell", but it manages
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
144 only the desktop, not the windows themselves. The normal shell under
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
145 Windows is EXPLORER.EXE; if you kill this, you will lose the bar
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
146 containing the "Start" menu and tray and such, but the windows
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
147 themselves will not be affected or lose their decorations.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
148
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
149
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
150 THE CLIENT AREA
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
151 ---------------
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
152
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
153 Inside of the client area is the toolbars, the gutters (where the buffer
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
154 tabs are displayed), the minibuffer, the internal border width, and one
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
155 or more non-overlapping "windows" (this is old Emacs terminology, from
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
156 before the time when frames existed at all; the standard terminology for
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
157 this would be "pane"). Each window can contain a modeline, horizontal
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
158 and/or vertical scrollbars, and (for non-rightmost windows) a vertical
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
159 divider, surrounding a text area.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
160
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
161 The dimensions of the toolbars and gutters are determined by the formula
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
162 (THICKNESS + 2 * BORDER-THICKNESS), where "thickness" is a cover term
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
163 for height or width, as appropriate. The height and width come from
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
164 `default-toolbar-height' and `default-toolbar-width' and the specific
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
165 versions of these (`top-toolbar-height', `left-toolbar-width', etc.).
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
166 The border thickness comes from `default-toolbar-border-height' and
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
167 `default-toolbar-border-width', and the specific versions of these. The
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
168 gutter works exactly equivalently.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
169
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
170 Note that for any particular toolbar or gutter, it will only be
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
171 displayed if [a] its visibility specifier (`default-toolbar-visible-p'
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
172 etc.) is non-nil; [b] its thickness (`default-toolbar-height' etc.) is
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
173 greater than 0; [c] its contents (`default-toolbar' etc.) are non-nil.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
174
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
175 The position-specific toolbars interact with the default specifications
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
176 as follows: If the value for a position-specific specifier is not
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
177 defined in a particular domain (usually a window), and the position of
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
178 that specifier is set as the default position (using
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
179 `default-toolbar-position'), then the value from the corresponding
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
180 default specifier in that domain will be used. The gutters work the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
181 same.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
182
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
183
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
184 THE PANED AREA
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
185 --------------
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
186
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
187 The area occupied by the "windows" is called the paned area. Note that
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
188 this includes the minibuffer, which is just another window but is
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
189 special-cased in XEmacs. Each window can include a horizontal and/or
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
190 vertical scrollbar, a modeline and a vertical divider to its right, as
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
191 well as the text area. Only non-rightmost windows can include a
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
192 vertical divider. (The minibuffer normally does not include either
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
193 modeline or scrollbars.)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
194
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
195 Note that, because the toolbars and gutters are controlled by
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
196 specifiers, and specifiers can have window-specific and buffer-specific
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
197 values, the size of the paned area can change depending on which window
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
198 is selected: In other words, if the selected window or buffer changes,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
199 the entire paned area for the frame may change.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
200
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
201
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
202 TEXT AREAS, FRINGES, MARGINS
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
203 ----------------------------
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
204
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
205 The space occupied by a window can be divided into the text area and the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
206 fringes. The fringes include the modeline, scrollbars and vertical
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
207 divider on the right side (if any); inside of this is the text area,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
208 where the text actually occurs. Note that a window may or may not
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
209 contain any of the elements that are part of the fringe -- this is
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
210 controlled by specifiers, e.g. `has-modeline-p',
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
211 `horizontal-scrollbar-visible-p', `vertical-scrollbar-visible-p',
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
212 `vertical-divider-always-visible-p', etc.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
213
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
214 In addition, it is possible to set margins in the text area using the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
215 specifiers `left-margin-width' and `right-margin-width'. When this is
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
216 done, only the "inner text area" (the area inside of the margins) will
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
217 be used for normal display of text; the margins will be used for glyphs
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
218 with a layout policy of `outside-margin' (as set on an extent containing
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
219 the glyph by `set-extent-begin-glyph-layout' or
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
220 `set-extent-end-glyph-layout'). However, the calculation of the text
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
221 area size (e.g. in the function `window-text-area-width') includes the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
222 margins. Which margin is used depends on whether a glyph has been set
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
223 as the begin-glyph or end-glyph of an extent (`set-extent-begin-glyph'
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
224 etc.), using the left and right margins, respectively.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
225
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
226 Technically, the margins outside of the inner text area are known as the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
227 "outside margins". The "inside margins" are in the inner text area and
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
228 constitute the whitespace between the outside margins and the first or
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
229 last non-whitespace character in a line; their width can vary from line
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
230 to line. Glyphs will be placed in the inside margin if their layout
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
231 policy is `inside-margin' or `whitespace', with `whitespace' glyphs on
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
232 the inside and `inside-margin' glyphs on the outside. Inside-margin
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
233 glyphs can spill over into the outside margin if `use-left-overflow' or
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
234 `use-right-overflow', respectively, is non-nil.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
235
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
236 See the Lisp Reference manual, under Annotations, for more details.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
237
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
238
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
239 THE DISPLAYABLE AREA
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
240 --------------------
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
241
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
242 The "displayable area" is not so much an actual area as a convenient
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
243 fiction. It is the area used to convert between pixel and character
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
244 dimensions for frames. The character dimensions for a frame (e.g. as
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
245 returned by `frame-width' and `frame-height' and set by
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
246 `set-frame-width' and `set-frame-height') are determined from the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
247 displayable area by dividing by the pixel size of the default font as
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
248 instantiated in the frame. (For proportional fonts, the "average" width
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
249 is used. Under Windows, this is a built-in property of the fonts.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
250 Under X, this is based on the width of the lowercase 'n', or if this is
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
251 zero then the width of the default character. [We prefer 'n' to the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
252 specified default character because many X fonts have a default
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
253 character with a zero or otherwise non-representative width.])
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
254
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
255 The displayable area is essentially the "theoretical" paned area of the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
256 frame excluding the rightmost and bottom-most scrollbars. In this
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
257 context, "theoretical" means that all calculations on based on
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
258 frame-level values for toolbar, gutter and scrollbar thicknesses.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
259 Because these thicknesses are controlled by specifiers, and specifiers
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
260 can have window-specific and buffer-specific values, these calculations
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
261 may or may not reflect the actual size of the paned area or of the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
262 scrollbars when any particular window is selected. Note also that the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
263 "displayable area" may not even be contiguous! In particular, if the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
264 frame-level value of the horizontal scrollbar height is non-zero, then
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
265 the displayable area includes the paned area above and below the bottom
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
266 horizontal scrollbar but not the scrollbar itself.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
267
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
268 As a further twist, the character-dimension calculations are adjusted so
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
269 that the truncation and continuation glyphs (see `truncation-glyph' and
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
270 `continuation-glyph') count as a single character even if they are wider
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
271 than the default font width. (Technically, the character width is
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
272 computed from the displayable-area width by subtracting the maximum of
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
273 the truncation-glyph width, continuation-glyph width and default-font
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
274 width before dividing by the default-font width, and then adding 1 to
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
275 the result.) (The ultimate motivation for this kludge as well as the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
276 subtraction of the scrollbars, but not the minibuffer or bottom-most
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
277 modeline, is to maintain compatibility with TTY's.)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
278
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
279 Despite all these concerns and kludges, however, the "displayable area"
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
280 concept works well in practice and mostly ensures that by default the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
281 frame will actually fit 79 characters + continuation/truncation glyph.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
282
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
283
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
284 WHICH FUNCTIONS USE WHICH?
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
285 --------------------------
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
286
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
287 [1] Top-level window area:
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
288
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
289 set-frame-position
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
290 `left' and `top' frame properties
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
291
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
292 [2] Client area:
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
293
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
294 frame-pixel-*, set-frame-pixel-*
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
295
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
296 [3] Paned area:
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
297
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
298 window-pixel-edges
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
299 event-x-pixel, event-y-pixel, event-properties, make-event
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
300
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
301 [4] Displayable area:
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
302
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
303 frame-width, frame-height and other all functions specifying frame size
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
304 in characters
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
305 frame-displayable-pixel-*
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
306
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
307 --ben
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
308
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
309 */
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
310
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 #include <config.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 #include "lisp.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 #include "buffer.h" /* for Vbuffer_alist */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 #include "console.h"
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
316 #include "device-impl.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 #include "events.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 #include "extents.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 #include "faces.h"
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
320 #include "frame-impl.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 #include "glyphs.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 #include "gutter.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 #include "menubar.h"
2681
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
324 #include "process.h" /* for egetenv */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 #include "redisplay.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 #include "scrollbar.h"
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 793
diff changeset
327 #include "toolbar.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 #include "window.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 Lisp_Object Vselect_frame_hook, Qselect_frame_hook;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 Lisp_Object Vdeselect_frame_hook, Qdeselect_frame_hook;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 Lisp_Object Vcreate_frame_hook, Qcreate_frame_hook;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 Lisp_Object Vdelete_frame_hook, Qdelete_frame_hook;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334 Lisp_Object Vmouse_enter_frame_hook, Qmouse_enter_frame_hook;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335 Lisp_Object Vmouse_leave_frame_hook, Qmouse_leave_frame_hook;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 Lisp_Object Vmap_frame_hook, Qmap_frame_hook;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 Lisp_Object Vunmap_frame_hook, Qunmap_frame_hook;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 int allow_deletion_of_last_visible_frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 Lisp_Object Vadjust_frame_function;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 Lisp_Object Vmouse_motion_handler;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 Lisp_Object Vsynchronize_minibuffers;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 Lisp_Object Qsynchronize_minibuffers;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 Lisp_Object Qbuffer_predicate;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 Lisp_Object Qmake_initial_minibuffer_frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 Lisp_Object Qcustom_initialize_frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 /* We declare all these frame properties here even though many of them
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 are currently only used in frame-x.c, because we should generalize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 them. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 Lisp_Object Qminibuffer;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 Lisp_Object Qunsplittable;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 Lisp_Object Qinternal_border_width;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 Lisp_Object Qtop_toolbar_shadow_color;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 Lisp_Object Qbottom_toolbar_shadow_color;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 Lisp_Object Qbackground_toolbar_color;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 Lisp_Object Qtop_toolbar_shadow_pixmap;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 Lisp_Object Qbottom_toolbar_shadow_pixmap;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 Lisp_Object Qtoolbar_shadow_thickness;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 Lisp_Object Qscrollbar_placement;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 Lisp_Object Qinter_line_space;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 Lisp_Object Qvisual_bell;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 Lisp_Object Qbell_volume;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 Lisp_Object Qpointer_background;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 Lisp_Object Qpointer_color;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 Lisp_Object Qtext_pointer;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 Lisp_Object Qspace_pointer;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368 Lisp_Object Qmodeline_pointer;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369 Lisp_Object Qgc_pointer;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 Lisp_Object Qinitially_unmapped;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 Lisp_Object Quse_backing_store;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 Lisp_Object Qborder_color;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 Lisp_Object Qborder_width;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 Lisp_Object Qframep, Qframe_live_p;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 Lisp_Object Qdelete_frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 Lisp_Object Qframe_title_format, Vframe_title_format;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 Lisp_Object Qframe_icon_title_format, Vframe_icon_title_format;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 Lisp_Object Vdefault_frame_name;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 Lisp_Object Vdefault_frame_plist;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384 Lisp_Object Vframe_icon_glyph;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386 Lisp_Object Qhidden;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388 Lisp_Object Qvisible, Qiconic, Qinvisible, Qvisible_iconic, Qinvisible_iconic;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 Lisp_Object Qnomini, Qvisible_nomini, Qiconic_nomini, Qinvisible_nomini;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390 Lisp_Object Qvisible_iconic_nomini, Qinvisible_iconic_nomini;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
392 Lisp_Object Qset_specifier, Qset_face_property;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 Lisp_Object Qface_property_instance;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395 Lisp_Object Qframe_property_alias;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 /* If this is non-nil, it is the frame that make-frame is currently
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398 creating. We can't set the current frame to this in case the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 debugger goes off because it would try and display to it. However,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 there are some places which need to reference it which have no
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 other way of getting it if it isn't the selected frame. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402 Lisp_Object Vframe_being_created;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 Lisp_Object Qframe_being_created;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 static void store_minibuf_frame_prop (struct frame *f, Lisp_Object val);
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
406
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
407 typedef enum
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
408 {
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
409 DISPLAYABLE_PIXEL_TO_CHAR,
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
410 CHAR_TO_DISPLAYABLE_PIXEL,
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
411 TOTAL_PIXEL_TO_CHAR,
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
412 CHAR_TO_TOTAL_PIXEL,
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
413 TOTAL_PIXEL_TO_DISPLAYABLE_PIXEL,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
414 DISPLAYABLE_PIXEL_TO_TOTAL_PIXEL,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
415 }
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
416 pixel_to_char_mode_t;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
417
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
418 enum frame_size_type
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
419 {
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
420 SIZE_TOTAL_PIXEL,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
421 SIZE_DISPLAYABLE_PIXEL,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
422 SIZE_CHAR_CELL,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
423 SIZE_FRAME_UNIT,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
424 };
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
425
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
426 static void frame_conversion_internal (struct frame *f,
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
427 enum frame_size_type source,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
428 int source_width, int source_height,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
429 enum frame_size_type dest,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
430 int *dest_width, int *dest_height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
431 static void get_frame_char_size (struct frame *f, int *out_width,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
432 int *out_height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
433 static void get_frame_displayable_pixel_size (struct frame *f, int *out_width,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
434 int *out_height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
435
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
436 static struct display_line title_string_display_line;
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
437 /* Used by generate_title_string. Global because they get used so much that
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
438 the dynamic allocation time adds up. */
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 863
diff changeset
439 static Ichar_dynarr *title_string_ichar_dynarr;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
442
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
443 #ifndef NEW_GC
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
444 extern const struct sized_memory_description gtk_frame_data_description;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
445 extern const struct sized_memory_description mswindows_frame_data_description;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
446 extern const struct sized_memory_description x_frame_data_description;
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
447 #endif /* not NEW_GC */
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
448
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
449 static const struct memory_description frame_data_description_1 []= {
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
450 #ifdef NEW_GC
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
451 #ifdef HAVE_GTK
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
452 { XD_LISP_OBJECT, gtk_console },
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
453 #endif
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
454 #ifdef HAVE_MS_WINDOWS
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
455 { XD_LISP_OBJECT, mswindows_console },
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
456 #endif
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
457 #ifdef HAVE_X_WINDOWS
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
458 { XD_LISP_OBJECT, x_console },
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
459 #endif
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
460 #else /* not NEW_GC */
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
461 #ifdef HAVE_GTK
2551
9f70af3ac939 [xemacs-hg @ 2005-02-03 16:14:02 by james]
james
parents: 2500
diff changeset
462 { XD_BLOCK_PTR, gtk_console, 1, { &gtk_frame_data_description} },
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
463 #endif
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
464 #ifdef HAVE_MS_WINDOWS
2551
9f70af3ac939 [xemacs-hg @ 2005-02-03 16:14:02 by james]
james
parents: 2500
diff changeset
465 { XD_BLOCK_PTR, mswindows_console, 1, { &mswindows_frame_data_description} },
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
466 #endif
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
467 #ifdef HAVE_X_WINDOWS
2551
9f70af3ac939 [xemacs-hg @ 2005-02-03 16:14:02 by james]
james
parents: 2500
diff changeset
468 { XD_BLOCK_PTR, x_console, 1, { &x_frame_data_description} },
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
469 #endif
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
470 #endif /* not NEW_GC */
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
471 { XD_END }
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
472 };
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
473
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
474 static const struct sized_memory_description frame_data_description = {
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
475 sizeof (void *), frame_data_description_1
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
476 };
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
477
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
478 #ifdef NEW_GC
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
479 static const struct memory_description expose_ignore_description_1 [] = {
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
480 { XD_LISP_OBJECT, offsetof (struct expose_ignore, next) },
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
481 { XD_END }
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
482 };
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
483
5118
e0db3c197671 merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents: 5117 4790
diff changeset
484 DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT ("expose-ignore", expose_ignore,
e0db3c197671 merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents: 5117 4790
diff changeset
485 0, expose_ignore_description_1,
e0db3c197671 merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents: 5117 4790
diff changeset
486 struct expose_ignore);
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
487 #else /* not NEW_GC */
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
488 extern const struct sized_memory_description expose_ignore_description;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
489
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
490 static const struct memory_description expose_ignore_description_1 [] = {
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2286
diff changeset
491 { XD_BLOCK_PTR, offsetof (struct expose_ignore, next),
2551
9f70af3ac939 [xemacs-hg @ 2005-02-03 16:14:02 by james]
james
parents: 2500
diff changeset
492 1, { &expose_ignore_description } },
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
493 { XD_END }
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
494 };
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
495
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
496 const struct sized_memory_description expose_ignore_description = {
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
497 sizeof (struct expose_ignore),
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
498 expose_ignore_description_1
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
499 };
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
500 #endif /* not NEW_GC */
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
501
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
502 static const struct memory_description display_line_dynarr_pointer_description_1 []= {
2551
9f70af3ac939 [xemacs-hg @ 2005-02-03 16:14:02 by james]
james
parents: 2500
diff changeset
503 { XD_BLOCK_PTR, 0, 1, { &display_line_dynarr_description} },
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
504 { XD_END }
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
505 };
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
506
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
507 static const struct sized_memory_description display_line_dynarr_pointer_description = {
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
508 sizeof (display_line_dynarr *), display_line_dynarr_pointer_description_1
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
509 };
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
510
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
511 static const struct memory_description frame_description [] = {
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
512 { XD_INT, offsetof (struct frame, frametype) },
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
513 #define MARKED_SLOT(x) { XD_LISP_OBJECT, offsetof (struct frame, x) },
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
514 #define MARKED_SLOT_ARRAY(slot, size) \
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
515 { XD_LISP_OBJECT_ARRAY, offsetof (struct frame, slot), size },
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
516 #include "frameslots.h"
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
517
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
518 #ifdef NEW_GC
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
519 { XD_LISP_OBJECT, offsetof (struct frame, subwindow_exposures) },
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
520 { XD_LISP_OBJECT, offsetof (struct frame, subwindow_exposures_tail) },
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
521 #else /* not NEW_GC */
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2286
diff changeset
522 { XD_BLOCK_PTR, offsetof (struct frame, subwindow_exposures),
2551
9f70af3ac939 [xemacs-hg @ 2005-02-03 16:14:02 by james]
james
parents: 2500
diff changeset
523 1, { &expose_ignore_description } },
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2286
diff changeset
524 { XD_BLOCK_PTR, offsetof (struct frame, subwindow_exposures_tail),
2551
9f70af3ac939 [xemacs-hg @ 2005-02-03 16:14:02 by james]
james
parents: 2500
diff changeset
525 1, { &expose_ignore_description } },
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
526 #endif /* not NEW_GC */
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
527
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
528 #ifdef HAVE_SCROLLBARS
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
529 { XD_LISP_OBJECT, offsetof (struct frame, sb_vcache) },
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
530 { XD_LISP_OBJECT, offsetof (struct frame, sb_hcache) },
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
531 #endif /* HAVE_SCROLLBARS */
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
532
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2286
diff changeset
533 { XD_BLOCK_ARRAY, offsetof (struct frame, current_display_lines),
2551
9f70af3ac939 [xemacs-hg @ 2005-02-03 16:14:02 by james]
james
parents: 2500
diff changeset
534 4, { &display_line_dynarr_pointer_description } },
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2286
diff changeset
535 { XD_BLOCK_ARRAY, offsetof (struct frame, desired_display_lines),
2551
9f70af3ac939 [xemacs-hg @ 2005-02-03 16:14:02 by james]
james
parents: 2500
diff changeset
536 4, { &display_line_dynarr_pointer_description } },
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
537
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 2286
diff changeset
538 { XD_BLOCK_PTR, offsetof (struct frame, framemeths), 1,
2551
9f70af3ac939 [xemacs-hg @ 2005-02-03 16:14:02 by james]
james
parents: 2500
diff changeset
539 { &console_methods_description } },
4207
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
540 { XD_UNION, offsetof (struct frame, frame_data),
2551
9f70af3ac939 [xemacs-hg @ 2005-02-03 16:14:02 by james]
james
parents: 2500
diff changeset
541 XD_INDIRECT (0, 0), { &frame_data_description } },
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
542 { XD_END }
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
543 };
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
544
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546 mark_frame (Lisp_Object obj)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548 struct frame *f = XFRAME (obj);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
550 #define MARKED_SLOT(x) mark_object (f->x);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
551 #include "frameslots.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
552
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
553 if (FRAME_LIVE_P (f)) /* device is nil for a dead frame */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554 MAYBE_FRAMEMETH (f, mark_frame, (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
555
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
556 #ifdef HAVE_SCROLLBARS
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
557 if (f->sb_vcache)
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
558 mark_object (wrap_scrollbar_instance (f->sb_vcache));
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
559 if (f->sb_hcache)
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
560 mark_object (wrap_scrollbar_instance (f->sb_hcache));
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
561 #endif
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
562
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
563 mark_gutters (f);
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
564
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
565 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
566 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
567
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568 static void
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 1726
diff changeset
569 print_frame (Lisp_Object obj, Lisp_Object printcharfun,
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 1726
diff changeset
570 int UNUSED (escapeflag))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
571 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
572 struct frame *frm = XFRAME (obj);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
573
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
574 if (print_readably)
4846
a98ca4640147 clean up object print methods
Ben Wing <ben@xemacs.org>
parents: 4790
diff changeset
575 printing_unreadable_lcrecord (obj, XSTRING_DATA (frm->name));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
576
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 793
diff changeset
577 write_fmt_string (printcharfun, "#<%s-frame ", !FRAME_LIVE_P (frm) ? "dead" :
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 793
diff changeset
578 FRAME_TYPE_NAME (frm));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
579 print_internal (frm->name, printcharfun, 1);
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 793
diff changeset
580 write_fmt_string (printcharfun, " 0x%x>", frm->header.uid);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
581 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
582
5118
e0db3c197671 merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents: 5117 4790
diff changeset
583 DEFINE_NODUMP_LISP_OBJECT ("frame", frame,
5124
623d57b7fbe8 separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents: 5120
diff changeset
584 mark_frame, print_frame, 0, 0, 0,
623d57b7fbe8 separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents: 5120
diff changeset
585 frame_description,
623d57b7fbe8 separate regular and disksave finalization, print method fixes.
Ben Wing <ben@xemacs.org>
parents: 5120
diff changeset
586 struct frame);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
587
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
588 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
589 nuke_all_frame_slots (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
590 {
5120
d1247f3cc363 latest work on lisp-object workspace;
Ben Wing <ben@xemacs.org>
parents: 5118
diff changeset
591 ZERO_LISP_OBJECT (f);
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
592
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
593 #define MARKED_SLOT(x) f->x = Qnil;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
594 #include "frameslots.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
595 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
596
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
597 /* Allocate a new frame object and set all its fields to reasonable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
598 values. The root window is created but the minibuffer will be done
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
599 later. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
600
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
601 static struct frame *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
602 allocate_frame_core (Lisp_Object device)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
603 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
604 /* This function can GC */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
605 Lisp_Object root_window;
5117
3742ea8250b5 Checking in final CVS version of workspace 'ben-lisp-object'
Ben Wing <ben@xemacs.org>
parents: 3025
diff changeset
606 Lisp_Object frame = ALLOC_LISP_OBJECT (frame);
3742ea8250b5 Checking in final CVS version of workspace 'ben-lisp-object'
Ben Wing <ben@xemacs.org>
parents: 3025
diff changeset
607 struct frame *f = XFRAME (frame);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
608
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
609 nuke_all_frame_slots (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
610
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
611 f->device = device;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
612 f->framemeths = XDEVICE (device)->devmeths;
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
613 f->frametype = get_console_variant (XDEVICE_TYPE (device));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
614 f->buffer_alist = Fcopy_sequence (Vbuffer_alist);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
615
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
616 root_window = allocate_window ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
617 XWINDOW (root_window)->frame = frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
618
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
619 /* 10 is arbitrary,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
620 Just so that there is "something there."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
621 Correct size will be set up later with change_frame_size. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
622
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
623 f->width = 10;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
624 f->height = 10;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
625
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
626 XWINDOW (root_window)->pixel_width = 10;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
627 XWINDOW (root_window)->pixel_height = 9;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
628
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
629 f->root_window = root_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
630 f->selected_window = root_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
631 f->last_nonminibuf_window = root_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
632
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
633 /* cache of subwindows visible on frame */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
634 f->subwindow_instance_cache = make_weak_list (WEAK_LIST_SIMPLE);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
635
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
636 /* associated exposure ignore list */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
637 f->subwindow_exposures = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
638 f->subwindow_exposures_tail = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
639
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
640 FRAME_SET_PAGENUMBER (f, 1);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
641
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
642 note_object_created (root_window);
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
643
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
644 /* Choose a buffer for the frame's root window. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
645 XWINDOW (root_window)->buffer = Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
646 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
647 Lisp_Object buf;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
648
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
649 buf = Fcurrent_buffer ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650 /* If buf is a 'hidden' buffer (i.e. one whose name starts with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
651 a space), try to find another one. */
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 863
diff changeset
652 if (string_ichar (Fbuffer_name (buf), 0) == ' ')
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
653 buf = Fother_buffer (buf, Qnil, Qnil);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
654 Fset_window_buffer (root_window, buf, Qnil);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
655 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
656
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
657 return f;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
658 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
660 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661 setup_normal_frame (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
662 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
663 Lisp_Object mini_window;
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
664 Lisp_Object frame = wrap_frame (f);
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
665
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
666
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
667 mini_window = allocate_window ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
668 XWINDOW (f->root_window)->next = mini_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
669 XWINDOW (mini_window)->prev = f->root_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
670 XWINDOW (mini_window)->mini_p = Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
671 XWINDOW (mini_window)->frame = frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
672 f->minibuffer_window = mini_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
673 f->has_minibuffer = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
674
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
675 note_object_created (mini_window);
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
676
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
677 XWINDOW (mini_window)->buffer = Qt;
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
678 Fset_window_buffer (mini_window, Vminibuffer_zero, Qt);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
679 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
680
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
681 /* Make a frame using a separate minibuffer window on another frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
682 MINI_WINDOW is the minibuffer window to use. nil means use the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
683 default-minibuffer-frame. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
684
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
685 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
686 setup_frame_without_minibuffer (struct frame *f, Lisp_Object mini_window)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
687 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
688 /* This function can GC */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
689 Lisp_Object device = f->device;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
690
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
691 if (!NILP (mini_window))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
692 CHECK_LIVE_WINDOW (mini_window);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
693
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
694 if (!NILP (mini_window)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
695 && !EQ (DEVICE_CONSOLE (XDEVICE (device)),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
696 FRAME_CONSOLE (XFRAME (XWINDOW (mini_window)->frame))))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
697 invalid_argument ("frame and minibuffer must be on the same console", Qunbound);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
698
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
699 /* Do not create a default minibuffer frame on printer devices. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
700 if (NILP (mini_window)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
701 && DEVICE_DISPLAY_P (XDEVICE (FRAME_DEVICE (f))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
702 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
703 struct console *con = XCONSOLE (FRAME_CONSOLE (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
704 /* Use default-minibuffer-frame if possible. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
705 if (!FRAMEP (con->default_minibuffer_frame)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
706 || ! FRAME_LIVE_P (XFRAME (con->default_minibuffer_frame)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
707 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
708 /* If there's no minibuffer frame to use, create one. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
709 con->default_minibuffer_frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
710 = call1 (Qmake_initial_minibuffer_frame, device);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
711 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
712 mini_window = XFRAME (con->default_minibuffer_frame)->minibuffer_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
713 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
714
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
715 /* Install the chosen minibuffer window, with proper buffer. */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
716 if (!NILP (mini_window))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
717 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
718 store_minibuf_frame_prop (f, mini_window);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
719 Fset_window_buffer (mini_window, Vminibuffer_zero, Qt);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
720 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
721 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
722 f->minibuffer_window = Qnil;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
723 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
724
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
725 /* Make a frame containing only a minibuffer window. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
726
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
727 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
728 setup_minibuffer_frame (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
729 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
730 /* This function can GC */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
731 /* First make a frame containing just a root window, no minibuffer. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
732 Lisp_Object mini_window;
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
733 Lisp_Object frame = wrap_frame (f);
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
734
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
735
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
736 f->no_split = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
737 f->has_minibuffer = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
738
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
739 /* Now label the root window as also being the minibuffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
740 Avoid infinite looping on the window chain by marking next pointer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
741 as nil. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
742
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
743 mini_window = f->minibuffer_window = f->root_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
744 XWINDOW (mini_window)->mini_p = Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
745 XWINDOW (mini_window)->next = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
746 XWINDOW (mini_window)->prev = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
747 XWINDOW (mini_window)->frame = frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
748
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
749 /* Put the proper buffer in that window. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
750
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
751 Fset_window_buffer (mini_window, Vminibuffer_zero, Qt);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
752 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
753
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
754 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
755 make_sure_its_a_fresh_plist (Lisp_Object foolist)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
756 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
757 if (CONSP (Fcar (foolist)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
758 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
759 /* looks like an alist to me. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
760 foolist = Fcopy_alist (foolist);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
761 foolist = Fdestructive_alist_to_plist (foolist);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
762 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
763 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
764 foolist = Fcopy_sequence (foolist);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
765
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
766 return foolist;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
767 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
768
558
ed498ef2108b [xemacs-hg @ 2001-05-23 09:59:33 by ben]
ben
parents: 546
diff changeset
769 static Lisp_Object
546
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
770 restore_frame_list_to_its_unbesmirched_state (Lisp_Object kawnz)
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
771 {
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
772 Lisp_Object lissed = XCDR (kawnz);
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
773 if (!EQ (lissed, Qunbound))
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
774 DEVICE_FRAME_LIST (XDEVICE (XCAR (kawnz))) = lissed;
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
775 return Qnil;
4207
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
776 }
546
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
777
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
778 DEFUN ("make-frame", Fmake_frame, 0, 2, "", /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
779 Create and return a new frame, displaying the current buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
780 Runs the functions listed in `create-frame-hook' after frame creation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
781
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
782 Optional argument PROPS is a property list (a list of alternating
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
783 keyword-value specifications) of properties for the new frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
784 \(An alist is accepted for backward compatibility but should not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
785 be passed in.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
786
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
787 See `set-frame-properties', `default-x-frame-plist', and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
788 `default-tty-frame-plist' for the specially-recognized properties.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
789 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
790 (props, device))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
791 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
792 struct frame *f;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
793 struct device *d;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
794 Lisp_Object frame = Qnil, name = Qnil, minibuf;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
795 struct gcpro gcpro1, gcpro2, gcpro3;
546
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
796 int speccount = specpdl_depth (), speccount2;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
797 int first_frame_on_device = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
798 int first_frame_on_console = 0;
546
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
799 Lisp_Object besmirched_cons = Qnil;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
800 int frame_name_is_defaulted = 1;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
801
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
802 d = decode_device (device);
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
803 device = wrap_device (d);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
804
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
805 /* PROPS and NAME may be freshly-created, so make sure to GCPRO. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
806 GCPRO3 (frame, props, name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
807
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
808 props = make_sure_its_a_fresh_plist (props);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
809 if (DEVICE_SPECIFIC_FRAME_PROPS (d))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
810 /* Put the device-specific props before the more general ones so
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
811 that they override them. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
812 props = nconc2 (props,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
813 make_sure_its_a_fresh_plist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
814 (*DEVICE_SPECIFIC_FRAME_PROPS (d)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
815 props = nconc2 (props, make_sure_its_a_fresh_plist (Vdefault_frame_plist));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
816 Fcanonicalize_lax_plist (props, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
817
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
818 name = Flax_plist_get (props, Qname, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
819 if (!NILP (name))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
820 {
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
821 CHECK_STRING (name);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
822 frame_name_is_defaulted = 0;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
823 }
2681
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
824 else if (!initialized)
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
825 {
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
826 /* We leave Vdefault_frame_name alone here so that it'll remain Qnil
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
827 in the dumped executable, and we can choose it at runtime. */
4952
19a72041c5ed Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents: 4846
diff changeset
828 name = build_ascstring ("XEmacs");
2681
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
829 }
4207
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
830 else if (NILP (Vdefault_frame_name))
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
831 {
2681
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
832 if (egetenv ("USE_EMACS_AS_DEFAULT_APPLICATION_CLASS"))
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
833 {
4952
19a72041c5ed Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents: 4846
diff changeset
834 Vdefault_frame_name = build_ascstring ("emacs");
2681
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
835 }
4207
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
836 else
2681
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
837 {
4952
19a72041c5ed Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents: 4846
diff changeset
838 Vdefault_frame_name = build_ascstring ("XEmacs");
2681
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
839 }
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
840 }
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
841
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
842 if (NILP(name) && STRINGP(Vdefault_frame_name))
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
843 {
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
844 name = Vdefault_frame_name;
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
845 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
846
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 863
diff changeset
847 if (!NILP (Fstring_match (make_string ((const Ibyte *) "\\.", 2), name,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
848 Qnil, Qnil)))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
849 syntax_error (". not allowed in frame names", name);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
850
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
851 f = allocate_frame_core (device);
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
852 frame = wrap_frame (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
853
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
854 specbind (Qframe_being_created, name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
855 f->name = name;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
856
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
857 FRAMEMETH (f, init_frame_1, (f, props, frame_name_is_defaulted));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
858
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
859 minibuf = Flax_plist_get (props, Qminibuffer, Qunbound);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
860 if (UNBOUNDP (minibuf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
861 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
862 /* If minibuf is unspecified, then look for a minibuffer X resource. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
863 /* #### Not implemented any more. We need to fix things up so
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
864 that we search out all X resources and append them to the end of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
865 props, above. This is the only way in general to assure
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
866 coherent behavior for all frame properties/resources/etc. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
867 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
868 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
869 props = Flax_plist_remprop (props, Qminibuffer);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
870
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
871 if (EQ (minibuf, Qnone) || NILP (minibuf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
872 setup_frame_without_minibuffer (f, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
873 else if (EQ (minibuf, Qonly))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
874 setup_minibuffer_frame (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
875 else if (WINDOWP (minibuf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
876 setup_frame_without_minibuffer (f, minibuf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
877 else if (EQ (minibuf, Qt) || UNBOUNDP (minibuf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
878 setup_normal_frame (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
879 else
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
880 invalid_argument ("Invalid value for `minibuffer'", minibuf);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
881
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
882 update_frame_window_mirror (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
883
4968
4d35e52790f8 fix crash in glyph-cachels
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
884 /* #### Do we need to be calling reset_face_cachels here, and then again
4d35e52790f8 fix crash in glyph-cachels
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
885 down below? */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
886 if (initialized && !DEVICE_STREAM_P (d))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
887 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
888 if (!NILP (f->minibuffer_window))
4207
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
889 reset_face_cachels (XWINDOW (f->minibuffer_window));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
890 reset_face_cachels (XWINDOW (f->root_window));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
891 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
892
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
893 /* If no frames on this device formerly existed, say this is the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
894 first frame. It kind of assumes that frameless devices don't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
895 exist, but it shouldn't be too harmful. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
896 if (NILP (DEVICE_FRAME_LIST (d)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
897 first_frame_on_device = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
898
546
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
899 /* It's possible for one of the init methods below to signal an error;
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
900 in that case, let's make sure the device isn't besmirched by
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
901 having a half-initialized frame attached to it */
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
902 speccount2 = specpdl_depth ();
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
903 record_unwind_protect (restore_frame_list_to_its_unbesmirched_state,
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
904 besmirched_cons =
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
905 Fcons (device, DEVICE_FRAME_LIST (d)));
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
906
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
907 /* This *must* go before the init_*() methods. Those functions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
908 call Lisp code, and if any of them causes a warning to be displayed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
909 and the *Warnings* buffer to be created, it won't get added to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
910 the frame-specific version of the buffer-alist unless the frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
911 is accessible from the device. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
912
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
913 #if 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
914 DEVICE_FRAME_LIST (d) = nconc2 (DEVICE_FRAME_LIST (d), Fcons (frame, Qnil));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
915 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
916 DEVICE_FRAME_LIST (d) = Fcons (frame, DEVICE_FRAME_LIST (d));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
917 RESET_CHANGED_SET_FLAGS;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
918
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
919 note_object_created (frame);
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
920
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
921 /* Now make sure that the initial cached values are set correctly.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
922 Do this after the init_frame method is called because that may
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
923 do things (e.g. create widgets) that are necessary for the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
924 specifier value-changed methods to work OK. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
925 recompute_all_cached_specifiers_in_frame (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
926
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
927 if (!DEVICE_STREAM_P (d))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
928 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
929 init_frame_faces (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
930
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
931 #ifdef HAVE_SCROLLBARS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
932 /* Finish up resourcing the scrollbars. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
933 init_frame_scrollbars (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
934 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
935
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
936 #ifdef HAVE_TOOLBARS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
937 /* Create the initial toolbars. We have to do this after the frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
938 methods are called because it may potentially call some things itself
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
939 which depend on the normal frame methods having initialized
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
940 things. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
941 init_frame_toolbars (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
942 #endif
4968
4d35e52790f8 fix crash in glyph-cachels
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
943 /* Added this assert recently (2-1-10); seems there should be only
4d35e52790f8 fix crash in glyph-cachels
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
944 two windows, root and minibufer. Probably we should just be
4d35e52790f8 fix crash in glyph-cachels
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
945 calling reset_*_cachels on the root window directly instead of the
4d35e52790f8 fix crash in glyph-cachels
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
946 selected window, but I want to make sure they are always the
4d35e52790f8 fix crash in glyph-cachels
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
947 same. --ben */
4d35e52790f8 fix crash in glyph-cachels
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
948 assert (EQ (FRAME_SELECTED_WINDOW (f), f->root_window));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
949 reset_face_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
950 reset_glyph_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f)));
4968
4d35e52790f8 fix crash in glyph-cachels
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
951 if (!NILP (f->minibuffer_window))
4d35e52790f8 fix crash in glyph-cachels
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
952 {
4d35e52790f8 fix crash in glyph-cachels
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
953 reset_face_cachels (XWINDOW (f->minibuffer_window));
4d35e52790f8 fix crash in glyph-cachels
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
954 reset_glyph_cachels (XWINDOW (f->minibuffer_window));
4d35e52790f8 fix crash in glyph-cachels
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
955 }
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
956
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
957 change_frame_size (f, f->width, f->height, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
958 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
959
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
960 MAYBE_FRAMEMETH (f, init_frame_2, (f, props));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
961 Fset_frame_properties (frame, props);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
962 MAYBE_FRAMEMETH (f, init_frame_3, (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
963
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
964 /* Hallelujah, praise the lord. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
965 f->init_finished = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
966
546
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
967 XCDR (besmirched_cons) = Qunbound;
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
968
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
969 unbind_to (speccount2);
546
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 545
diff changeset
970
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
971 /* If this is the first frame on the device, make it the selected one. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
972 if (first_frame_on_device && NILP (DEVICE_SELECTED_FRAME (d)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
973 set_device_selected_frame (d, frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
974
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
975 /* If at startup or if the current console is a stream console
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
976 (usually also at startup), make this console the selected one
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
977 so that messages show up on it. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
978 if (NILP (Fselected_console ()) ||
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
979 CONSOLE_STREAM_P (XCONSOLE (Fselected_console ())))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
980 Fselect_console (DEVICE_CONSOLE (d));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
981
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
982 first_frame_on_console =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
983 (first_frame_on_device &&
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
984 XINT (Flength (CONSOLE_DEVICE_LIST (XCONSOLE (DEVICE_CONSOLE (d)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
985 == 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
986
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
987 /* #### all this calling of frame methods at various odd times
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
988 is somewhat of a mess. It's necessary to do it this way due
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
989 to strange console-type-specific things that need to be done. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
990 MAYBE_FRAMEMETH (f, after_init_frame, (f, first_frame_on_device,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
991 first_frame_on_console));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
992
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
993 if (!DEVICE_STREAM_P (d))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
994 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
995 /* Now initialise the gutters. This won't change the frame size,
4207
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
996 but is needed as input to the layout that change_frame_size
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
997 will eventually do. Unfortunately gutter sizing code relies
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
998 on the frame in question being visible so we can't do this
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
999 earlier. */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1000 init_frame_gutters (f);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1001
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
1002 change_frame_size (f, f->width, f->height, 0);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1003 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1004
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1005 if (first_frame_on_device)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1006 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1007 if (first_frame_on_console)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1008 va_run_hook_with_args (Qcreate_console_hook, 1, DEVICE_CONSOLE (d));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1009 va_run_hook_with_args (Qcreate_device_hook, 1, device);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1010 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1011 va_run_hook_with_args (Qcreate_frame_hook, 1, frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1012
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1013 /* Initialize custom-specific stuff. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1014 if (!UNBOUNDP (symbol_function (XSYMBOL (Qcustom_initialize_frame))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1015 call1 (Qcustom_initialize_frame, frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1016
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
1017 UNGCPRO;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
1018 unbind_to (speccount);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1019
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1020 return frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1021 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1022
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1023
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1024 /* this function should be used in most cases when a Lisp function is passed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1025 a FRAME argument. Use this unless you don't accept nil == current frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1026 (in which case, do a CHECK_LIVE_FRAME() and then an XFRAME()) or you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1027 allow dead frames. Note that very few functions should accept dead
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1028 frames. It could be argued that functions should just do nothing when
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1029 given a dead frame, but the presence of a dead frame usually indicates
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1030 an oversight in the Lisp code that could potentially lead to strange
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1031 results and so it is better to catch the error early.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1032
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1033 If you only accept X frames, use decode_x_frame(), which does what this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1034 function does but also makes sure the frame is an X frame. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1035
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1036 struct frame *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1037 decode_frame (Lisp_Object frame)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1038 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1039 if (NILP (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1040 return selected_frame ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1041
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1042 CHECK_LIVE_FRAME (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1043 return XFRAME (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1044 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1045
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1046 struct frame *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1047 decode_frame_or_selected (Lisp_Object cdf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1048 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1049 if (CONSOLEP (cdf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1050 cdf = CONSOLE_SELECTED_DEVICE (decode_console (cdf));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1051 if (DEVICEP (cdf))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1052 cdf = DEVICE_SELECTED_FRAME (decode_device (cdf));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1053 return decode_frame (cdf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1054 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1055
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
1056 Lisp_Object
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
1057 frame_device (struct frame *f)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
1058 {
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
1059 return FRAME_DEVICE (f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
1060 }
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
1061
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
1062 int
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
1063 frame_live_p (struct frame *f)
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
1064 {
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
1065 return FRAME_LIVE_P (f);
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
1066 }
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 867
diff changeset
1067
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1068
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1069 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1070 invalidate_vertical_divider_cache_in_frame (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1071 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1072 /* Invalidate cached value of needs_vertical_divider_p in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1073 every and all windows */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1074 map_windows (f, invalidate_vertical_divider_cache_in_window, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1075 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1076
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1077 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1078 * Frame size may change due to changes in scrollbars, toolbars,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1079 * default font etc. These changes are applied early in redisplay
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1080 * frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1081 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1082 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1083 adjust_frame_size (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1084 {
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
1085 /* This can call Lisp. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1086 int keep_char_size = 0;
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
1087 Lisp_Object frame = wrap_frame (f);
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
1088
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1089 if (!f->size_slipped)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1090 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1091
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1092 /* Don't adjust tty frames. #### May break when TTY have menubars.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1093 Then, write an Vadjust_frame_function which will return t for TTY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1094 frames. Another solution is frame_size_fixed_p method for TTYs,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1095 which always returned yes it's fixed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1096 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1097 if (!FRAME_WIN_P (f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1098 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1099 CLEAR_FRAME_SIZE_SLIPPED (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1100 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1101 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1102
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1103 /* frame_size_fixed_p tells that frame size cannot currently
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1104 be changed change due to external conditions */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1105 if (!FRAMEMETH_OR_GIVEN (f, frame_size_fixed_p, (f), 0))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1106 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1107 if (NILP (Vadjust_frame_function))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1108 keep_char_size = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1109 else if (EQ (Vadjust_frame_function, Qt))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1110 keep_char_size = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1111 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1112 keep_char_size =
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
1113 NILP (call1_trapping_problems ("Error in adjust-frame-function",
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
1114 Vadjust_frame_function, frame,
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
1115 0));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1116
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1117 if (keep_char_size)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1118 Fset_frame_size (frame, make_int (FRAME_CHARWIDTH(f)),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1119 make_int (FRAME_CHARHEIGHT(f)), Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1120 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1121
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1122 if (!keep_char_size)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1123 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1124 int height, width;
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
1125 pixel_to_frame_unit_size (f, FRAME_PIXWIDTH(f), FRAME_PIXHEIGHT(f),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1126 &width, &height);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
1127 change_frame_size (f, width, height, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1128 CLEAR_FRAME_SIZE_SLIPPED (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1129 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1130 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1131
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1132 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1133 * This is a "specifier changed in frame" handler for various specifiers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1134 * changing which causes frame size adjustment
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1135 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1136 void
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 1726
diff changeset
1137 frame_size_slipped (Lisp_Object UNUSED (specifier), struct frame *f,
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 1726
diff changeset
1138 Lisp_Object UNUSED (oldval))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1139 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1140 MARK_FRAME_SIZE_SLIPPED(f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1141 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1142
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1143 DEFUN ("framep", Fframep, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1144 Return non-nil if OBJECT is a frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1145 Also see `frame-live-p'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1146 Note that FSF Emacs kludgily returns a value indicating what type of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1147 frame this is. Use the cleaner function `frame-type' for that.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1148 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1149 (object))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1150 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1151 return FRAMEP (object) ? Qt : Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1152 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1153
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1154 DEFUN ("frame-live-p", Fframe_live_p, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1155 Return non-nil if OBJECT is a frame which has not been deleted.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1156 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1157 (object))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1158 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1159 return FRAMEP (object) && FRAME_LIVE_P (XFRAME (object)) ? Qt : Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1160 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1161
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1162
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1163 DEFUN ("focus-frame", Ffocus_frame, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1164 Select FRAME and give it the window system focus.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1165 This function is not affected by the value of `focus-follows-mouse'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1166 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1167 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1168 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1169 CHECK_LIVE_FRAME (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1170
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1171 MAYBE_DEVMETH (XDEVICE (FRAME_DEVICE (XFRAME (frame))), focus_on_frame,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1172 (XFRAME (frame)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1173 /* FRAME will be selected by the time we receive the next event.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1174 However, it is better to select it explicitly now, in case the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1175 Lisp code depends on frame being selected. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1176 Fselect_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1177 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1178 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1179
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1180 /* Called from Fselect_window() */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1181 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1182 select_frame_1 (Lisp_Object frame)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1183 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1184 struct frame *f = XFRAME (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1185 Lisp_Object old_selected_frame = Fselected_frame (Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1186
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1187 if (EQ (frame, old_selected_frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1188 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1189
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1190 /* now select the frame's device */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1191 set_device_selected_frame (XDEVICE (FRAME_DEVICE (f)), frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1192 select_device_1 (FRAME_DEVICE (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1193
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1194 update_frame_window_mirror (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1195 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1196
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1197 DEFUN ("select-frame", Fselect_frame, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1198 Select the frame FRAME.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1199 Subsequent editing commands apply to its selected window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1200 The selection of FRAME lasts until the next time the user does
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1201 something to select a different frame, or until the next time this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1202 function is called.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1203
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1204 Note that this does not actually cause the window-system focus to be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1205 set to this frame, or the `select-frame-hook' or `deselect-frame-hook'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1206 to be run, until the next time that XEmacs is waiting for an event.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1207
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1208 Also note that when focus-follows-mouse is non-nil, the frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1209 selection is temporary and is reverted when the current command
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1210 terminates, much like the buffer selected by `set-buffer'. In order
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1211 to effect a permanent focus change, use `focus-frame'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1212 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1213 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1214 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1215 CHECK_LIVE_FRAME (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1216
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1217 /* select the frame's selected window. This will call
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1218 selected_frame_1(). */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1219 Fselect_window (FRAME_SELECTED_WINDOW (XFRAME (frame)), Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1220
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1221 /* Nothing should be depending on the return value of this function.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1222 But, of course, there is stuff out there which is. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1223 return frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1224 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1225
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1226 /* use this to retrieve the currently selected frame. You should use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1227 this in preference to Fselected_frame (Qnil) unless you are prepared
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1228 to handle the possibility of there being no selected frame (this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1229 happens at some points during startup). */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1230
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1231 struct frame *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1232 selected_frame (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1233 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1234 Lisp_Object device = Fselected_device (Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1235 Lisp_Object frame = DEVICE_SELECTED_FRAME (XDEVICE (device));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1236 if (NILP (frame))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
1237 gui_error ("No frames exist on device", device);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1238 return XFRAME (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1239 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1240
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1241 /* use this instead of XFRAME (DEVICE_SELECTED_FRAME (d)) to catch
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1242 the possibility of there being no frames on the device (just created).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1243 There is no point doing this inside of redisplay because errors
2500
3d8143fc88e1 [xemacs-hg @ 2005-01-24 23:33:30 by ben]
ben
parents: 2367
diff changeset
1244 cause an ABORT(), indicating a flaw in the logic, and error_check_frame()
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1245 will catch this just as well. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1246
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1247 struct frame *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1248 device_selected_frame (struct device *d)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1249 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1250 Lisp_Object frame = DEVICE_SELECTED_FRAME (d);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1251 if (NILP (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1252 {
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
1253 Lisp_Object device = wrap_device (d);
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
1254
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
1255 gui_error ("No frames exist on device", device);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1256 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1257 return XFRAME (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1258 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1259
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1260 #if 0 /* FSFmacs */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1261
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 800
diff changeset
1262 DEFUN ("handle-switch-frame", Fhandle_switch_frame, 1, 2, "e", /*
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1263 Handle a switch-frame event EVENT.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1264 Switch-frame events are usually bound to this function.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1265 A switch-frame event tells Emacs that the window manager has requested
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1266 that the user's events be directed to the frame mentioned in the event.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1267 This function selects the selected window of the frame of EVENT.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1268
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1269 If EVENT is frame object, handle it as if it were a switch-frame event
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1270 to that frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1271 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1272 (frame, no_enter))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1273 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1274 /* Preserve prefix arg that the command loop just cleared. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1275 XCONSOLE (Vselected_console)->prefix_arg = Vcurrent_prefix_arg;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1276 #if 0 /* unclean! */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1277 run_hook (Qmouse_leave_buffer_hook);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1278 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1279 return do_switch_frame (frame, no_enter, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1280 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1281
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1282 /* A load of garbage. */
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 800
diff changeset
1283 DEFUN ("ignore-event", Fignore_event, 0, 0, "", /*
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1284 Do nothing, but preserve any prefix argument already specified.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1285 This is a suitable binding for iconify-frame and make-frame-visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1286 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1287 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1288 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1289 struct console *c = XCONSOLE (Vselected_console);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1290
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1291 c->prefix_arg = Vcurrent_prefix_arg;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1292 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1293 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1294
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1295 #endif /* 0 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1296
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1297 DEFUN ("selected-frame", Fselected_frame, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1298 Return the frame that is now selected on device DEVICE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1299 If DEVICE is not specified, the selected device will be used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1300 If no frames exist on the device, nil is returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1301 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1302 (device))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1303 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1304 if (NILP (device) && NILP (Fselected_device (Qnil)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1305 return Qnil; /* happens early in temacs */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1306 return DEVICE_SELECTED_FRAME (decode_device (device));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1307 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1308
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1309 Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1310 frame_first_window (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1311 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1312 Lisp_Object w = f->root_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1313
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1314 while (1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1315 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1316 if (! NILP (XWINDOW (w)->hchild))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1317 w = XWINDOW (w)->hchild;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1318 else if (! NILP (XWINDOW (w)->vchild))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1319 w = XWINDOW (w)->vchild;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1320 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1321 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1322 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1323
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1324 return w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1325 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1326
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1327 DEFUN ("active-minibuffer-window", Factive_minibuffer_window, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1328 Return the currently active minibuffer window, or nil if none.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1329 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1330 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1331 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1332 return minibuf_level ? minibuf_window : Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1333 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1334
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1335 DEFUN ("last-nonminibuf-frame", Flast_nonminibuf_frame, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1336 Return the most-recently-selected non-minibuffer-only frame on CONSOLE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1337 This will always be the same as (selected-frame device) unless the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1338 selected frame is a minibuffer-only frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1339 CONSOLE defaults to the selected console if omitted.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1340 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1341 (console))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1342 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1343 Lisp_Object result;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1344
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
1345 console = wrap_console (decode_console (console));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1346 /* Just in case the machinations in delete_frame_internal() resulted
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1347 in the last-nonminibuf-frame getting out of sync, make sure and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1348 return the selected frame if it's acceptable. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1349 result = Fselected_frame (CONSOLE_SELECTED_DEVICE (XCONSOLE (console)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1350 if (!NILP (result) && !FRAME_MINIBUF_ONLY_P (XFRAME (result)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1351 return result;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1352 return CONSOLE_LAST_NONMINIBUF_FRAME (XCONSOLE (console));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1353 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1354
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1355 DEFUN ("frame-root-window", Fframe_root_window, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1356 Return the root-window of FRAME.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1357 If omitted, FRAME defaults to the currently selected frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1358 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1359 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1360 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1361 struct frame *f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1362 return FRAME_ROOT_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1363 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1364
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1365 DEFUN ("frame-selected-window", Fframe_selected_window, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1366 Return the selected window of frame object FRAME.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1367 If omitted, FRAME defaults to the currently selected frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1368 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1369 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1370 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1371 struct frame *f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1372 return FRAME_SELECTED_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1373 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1374
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1375 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1376 set_frame_selected_window (struct frame *f, Lisp_Object window)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1377 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1378 assert (XFRAME (WINDOW_FRAME (XWINDOW (window))) == f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1379 f->selected_window = window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1380 if (!MINI_WINDOW_P (XWINDOW (window)) || FRAME_MINIBUF_ONLY_P (f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1381 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1382 if (!EQ (f->last_nonminibuf_window, window))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1383 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1384 #ifdef HAVE_TOOLBARS
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1385 MARK_TOOLBAR_CHANGED;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1386 #endif
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1387 MARK_GUTTER_CHANGED;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1388 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1389 f->last_nonminibuf_window = window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1390 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1391 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1392
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1393 DEFUN ("set-frame-selected-window", Fset_frame_selected_window, 2, 2, 0, /*
460
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 450
diff changeset
1394 Set the selected window of FRAME to WINDOW.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1395 If FRAME is nil, the selected frame is used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1396 If FRAME is the selected frame, this makes WINDOW the selected window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1397 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1398 (frame, window))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1399 {
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
1400 frame = wrap_frame (decode_frame (frame));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1401 CHECK_LIVE_WINDOW (window);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1402
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1403 if (! EQ (frame, WINDOW_FRAME (XWINDOW (window))))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
1404 invalid_argument ("In `set-frame-selected-window', WINDOW is not on FRAME", Qunbound);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1405
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1406 if (XFRAME (frame) == selected_frame ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1407 return Fselect_window (window, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1408
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1409 set_frame_selected_window (XFRAME (frame), window);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1410 return window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1411 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1412
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1413
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1414 DEFUN ("frame-device", Fframe_device, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1415 Return the device that FRAME is on.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1416 If omitted, FRAME defaults to the currently selected frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1417 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1418 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1419 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1420 return FRAME_DEVICE (decode_frame (frame));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1421 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1422
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1423 int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1424 is_surrogate_for_selected_frame (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1425 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1426 struct device *d = XDEVICE (f->device);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1427 struct frame *dsf = device_selected_frame (d);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1429 /* Can't be a surrogate for ourselves. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1430 if (f == dsf)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1431 return 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1432
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1433 if (!FRAME_HAS_MINIBUF_P (dsf) &&
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1434 f == XFRAME (WINDOW_FRAME (XWINDOW (FRAME_MINIBUF_WINDOW (dsf)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1435 return 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1436 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1437 return 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1438 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1439
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1440 static int
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1441 frame_matches_frame_spec (Lisp_Object frame, Lisp_Object type)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1442 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1443 struct frame *f = XFRAME (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1444
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1445 if (WINDOWP (type))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1446 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1447 CHECK_LIVE_WINDOW (type);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1448
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1449 if (EQ (FRAME_MINIBUF_WINDOW (f), type)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1450 /* Check that F either is, or has forwarded
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1451 its focus to, TYPE's frame. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1452 && (EQ (WINDOW_FRAME (XWINDOW (type)), frame)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1453 || EQ (WINDOW_FRAME (XWINDOW (type)),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1454 FRAME_FOCUS_FRAME (f))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1455 return 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1456 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1457 return 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1458 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1459
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1460 #if 0 /* FSFmacs */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1461 if (EQ (type, Qvisible) || EQ (type, Qiconic) || EQ (type, Qvisible_iconic)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1462 || EQ (type, Qvisible_nomini) || EQ (type, Qiconic_nomini)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1463 || EQ (type, Qvisible_iconic_nomini))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1464 FRAME_SAMPLE_VISIBILITY (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1465 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1466
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1467 if (NILP (type))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1468 type = Qnomini;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1469 if (ZEROP (type))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1470 type = Qvisible_iconic;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1471
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1472 if (EQ (type, Qvisible))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1473 return FRAME_VISIBLE_P (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1474 if (EQ (type, Qiconic))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1475 return FRAME_ICONIFIED_P (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1476 if (EQ (type, Qinvisible))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1477 return !FRAME_VISIBLE_P (f) && !FRAME_ICONIFIED_P (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1478 if (EQ (type, Qvisible_iconic))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1479 return FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1480 if (EQ (type, Qinvisible_iconic))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1481 return !FRAME_VISIBLE_P (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1482
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1483 if (EQ (type, Qnomini))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1484 return !FRAME_MINIBUF_ONLY_P (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1485 if (EQ (type, Qvisible_nomini))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1486 return FRAME_VISIBLE_P (f) && !FRAME_MINIBUF_ONLY_P (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1487 if (EQ (type, Qiconic_nomini))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1488 return FRAME_ICONIFIED_P (f) && !FRAME_MINIBUF_ONLY_P (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1489 if (EQ (type, Qinvisible_nomini))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1490 return !FRAME_VISIBLE_P (f) && !FRAME_ICONIFIED_P (f) &&
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1491 !FRAME_MINIBUF_ONLY_P (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1492 if (EQ (type, Qvisible_iconic_nomini))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1493 return ((FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1494 && !FRAME_MINIBUF_ONLY_P (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1495 if (EQ (type, Qinvisible_iconic_nomini))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1496 return !FRAME_VISIBLE_P (f) && !FRAME_MINIBUF_ONLY_P (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1497
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1498 return 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1499 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1500
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1501 int
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1502 device_matches_device_spec (Lisp_Object device, Lisp_Object device_spec)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1503 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1504 if (EQ (device_spec, Qwindow_system))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1505 return DEVICE_WIN_P (XDEVICE (device));
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1506 if (DEVICEP (device_spec))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1507 return EQ (device, device_spec);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1508 if (CONSOLEP (device_spec))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1509 return EQ (DEVICE_CONSOLE (XDEVICE (device)), device_spec);
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1510 if (valid_console_type_p (device_spec))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1511 return EQ (DEVICE_TYPE (XDEVICE (device)), device_spec);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1512 return 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1513 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1514
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1515 /* Return the next frame in the frame list after FRAME.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1516 WHICH-FRAMES and WHICH-DEVICES control which frames and devices
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1517 are considered; see `next-frame'. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1518
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1519 Lisp_Object
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1520 next_frame (Lisp_Object frame, Lisp_Object which_frames, Lisp_Object which_devices)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1521 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1522 Lisp_Object first = Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1523 Lisp_Object devcons, concons;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1524 int passed = 0;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1525
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1526 CHECK_LIVE_FRAME (frame);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1527
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1528 DEVICE_LOOP_NO_BREAK (devcons, concons)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1529 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1530 Lisp_Object device = XCAR (devcons);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1531 Lisp_Object frmcons;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1532
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1533 if (!device_matches_device_spec (device, which_devices))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1534 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1535 if (EQ (device, FRAME_DEVICE (XFRAME (frame))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1536 passed = 1;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1537 continue;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1538 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1539
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1540 DEVICE_FRAME_LOOP (frmcons, XDEVICE (device))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1541 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1542 Lisp_Object f = XCAR (frmcons);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1543
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1544 if (passed)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1545 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1546 if (frame_matches_frame_spec (f, which_frames))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1547 return f;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1548 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1549 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1550 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1551 if (EQ (frame, f))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1552 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1553 passed = 1;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1554 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1555 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1556 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1557 if (NILP (first) && frame_matches_frame_spec (f, which_frames))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1558 first = f;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1559 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1560 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1561 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1562 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1563
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1564 if (NILP (first))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1565 /* We went through the whole frame list without finding a single
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1566 acceptable frame. Return the original frame. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1567 return frame;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1568 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1569 /* There were no acceptable frames in the list after FRAME; otherwise,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1570 we would have returned directly from the loop. Since FIRST is the last
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1571 acceptable frame in the list, return it. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1572 return first;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1573 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1574
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1575 /* Return the previous frame in the frame list before FRAME.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1576 WHICH-FRAMES and WHICH-DEVICES control which frames and devices
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1577 are considered; see `next-frame'. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1578
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1579 Lisp_Object
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1580 previous_frame (Lisp_Object frame, Lisp_Object which_frames, Lisp_Object which_devices)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1581 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1582 Lisp_Object devcons, concons;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1583 Lisp_Object last = Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1584
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1585 CHECK_LIVE_FRAME (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1586
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1587 DEVICE_LOOP_NO_BREAK (devcons, concons)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1588 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1589 Lisp_Object device = XCAR (devcons);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1590 Lisp_Object frmcons;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1591
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1592 if (!device_matches_device_spec (device, which_devices))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1593 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1594 if (EQ (device, FRAME_DEVICE (XFRAME (frame)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1595 && !NILP (last))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1596 return last;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1597 continue;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1598 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1599
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1600 DEVICE_FRAME_LOOP (frmcons, XDEVICE (device))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1601 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1602 Lisp_Object f = XCAR (frmcons);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1603
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1604 if (EQ (frame, f))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1605 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1606 if (!NILP (last))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1607 return last;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1608 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1609 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1610 {
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1611 if (frame_matches_frame_spec (f, which_frames))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1612 last = f;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1613 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1614 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1615 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1616
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1617 if (NILP (last))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1618 /* We went through the whole frame list without finding a single
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1619 acceptable frame. Return the original frame. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1620 return frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1621 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1622 /* There were no acceptable frames in the list before FRAME; otherwise,
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1623 we would have returned directly from the loop. Since LAST is the last
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1624 acceptable frame in the list, return it. */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1625 return last;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1626 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1627
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1628 DEFUN ("next-frame", Fnext_frame, 0, 3, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1629 Return the next frame of the right type in the frame list after FRAME.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1630 WHICH-FRAMES controls which frames are eligible to be returned; all
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1631 others will be skipped. Note that if there is only one eligible
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1632 frame, then `next-frame' called repeatedly will always return
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1633 the same frame, and if there is no eligible frame, then FRAME is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1634 returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1635
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1636 Possible values for WHICH-FRAMES are
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1637
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1638 `visible' Consider only frames that are visible.
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1639 `iconic' Consider only frames that are iconic.
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1640 `invisible' Consider only frames that are invisible
4207
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
1641 (this is different from iconic).
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1642 `visible-iconic' Consider frames that are visible or iconic.
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1643 `invisible-iconic' Consider frames that are invisible or iconic.
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1644 `nomini' Consider all frames except minibuffer-only ones.
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1645 `visible-nomini' Like `visible' but omits minibuffer-only frames.
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1646 `iconic-nomini' Like `iconic' but omits minibuffer-only frames.
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1647 `invisible-nomini' Like `invisible' but omits minibuffer-only frames.
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1648 `visible-iconic-nomini' Like `visible-iconic' but omits minibuffer-only
4207
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
1649 frames.
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1650 `invisible-iconic-nomini' Like `invisible-iconic' but omits minibuffer-only
4207
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
1651 frames.
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1652 any other value Consider all frames.
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1653
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1654 If WHICH-FRAMES is omitted, `nomini' is used. A value for WHICH-FRAMES
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
1655 of 0 (a number) is treated like `iconic', for backwards compatibility.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1656
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1657 If WHICH-FRAMES is a window, include only its own frame and any frame
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1658 now using that window as the minibuffer.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1659
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1660 The optional third argument WHICH-DEVICES further clarifies on which
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1661 devices to search for frames as specified by WHICH-FRAMES.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1662 If nil or omitted, search all devices on FRAME's console.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1663 If a device, only search that device.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1664 If a console, search all devices on that console.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1665 If a device type, search all devices of that type.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1666 If `window-system', search all window-system devices.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1667 Any other non-nil value means search all devices.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1668 */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1669 (frame, which_frames, which_devices))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1670 {
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
1671 frame = wrap_frame (decode_frame (frame));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1672
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1673 return next_frame (frame, which_frames, which_devices);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1674 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1675
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1676 DEFUN ("previous-frame", Fprevious_frame, 0, 3, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1677 Return the next frame of the right type in the frame list after FRAME.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1678 WHICH-FRAMES controls which frames are eligible to be returned; all
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1679 others will be skipped. Note that if there is only one eligible
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1680 frame, then `previous-frame' called repeatedly will always return
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1681 the same frame, and if there is no eligible frame, then FRAME is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1682 returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1683
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1684 See `next-frame' for an explanation of the WHICH-FRAMES and WHICH-DEVICES
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1685 arguments.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1686 */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1687 (frame, which_frames, which_devices))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1688 {
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
1689 frame = wrap_frame (decode_frame (frame));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1690
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1691 return previous_frame (frame, which_frames, which_devices);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1692 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1693
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1694 /* Return any frame for which PREDICATE is non-zero, or return Qnil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1695 if there aren't any. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1696
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1697 Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1698 find_some_frame (int (*predicate) (Lisp_Object, void *),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1699 void *closure)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1700 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1701 Lisp_Object framecons, devcons, concons;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1702
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1703 FRAME_LOOP_NO_BREAK (framecons, devcons, concons)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1704 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1705 Lisp_Object frame = XCAR (framecons);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1706
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1707 if ((predicate) (frame, closure))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1708 return frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1709 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1710
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1711 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1712 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1713
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1714
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1715
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1716 /* extern void free_line_insertion_deletion_costs (struct frame *f); */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1717
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1718 /* Return 1 if it is ok to delete frame F;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1719 0 if all frames aside from F are invisible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1720 (Exception: if F is a stream frame, it's OK to delete if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1721 any other frames exist.) */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1722
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1723 int
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1724 other_visible_frames (struct frame *f)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1725 {
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
1726 Lisp_Object frame = wrap_frame (f);
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
1727
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1728 if (FRAME_STREAM_P (f))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1729 return !EQ (frame, next_frame (frame, Qt, Qt));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1730 return !EQ (frame, next_frame (frame, Qvisible_iconic_nomini, Qt));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1731 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1732
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1733 /* Delete frame F.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1734
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1735 If FORCE is non-zero, allow deletion of the only frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1736
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1737 If CALLED_FROM_DELETE_DEVICE is non-zero, then, if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1738 deleting the last frame on a device, just delete it,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1739 instead of calling `delete-device'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1740
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1741 If FROM_IO_ERROR is non-zero, then the frame is gone due
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1742 to an I/O error. This affects what happens if we exit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1743 (we do an emergency exit instead of `save-buffers-kill-emacs'.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1744 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1745
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1746 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1747 delete_frame_internal (struct frame *f, int force,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1748 int called_from_delete_device,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1749 int from_io_error)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1750 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1751 /* This function can GC */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1752 int minibuffer_selected;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1753 struct device *d;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1754 struct console *con;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1755 Lisp_Object frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1756 Lisp_Object device;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1757 Lisp_Object console;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1758 struct gcpro gcpro1;
1313
671b65f2b075 [xemacs-hg @ 2003-02-20 01:12:25 by ben]
ben
parents: 1204
diff changeset
1759 int depth;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1760
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1761 /* OK to delete an already deleted frame. */
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
1762 if (!FRAME_LIVE_P (f))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1763 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1764
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
1765 frame = wrap_frame (f);
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
1766
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
1767 if (!force)
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
1768 check_allowed_operation (OPERATION_DELETE_OBJECT, frame, Qnil);
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
1769
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1770 GCPRO1 (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1771
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1772 device = FRAME_DEVICE (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1773 d = XDEVICE (device);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1774 console = DEVICE_CONSOLE (d);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1775 con = XCONSOLE (console);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1776
545
9a775fb11bb7 [xemacs-hg @ 2001-05-18 04:39:39 by kkm]
kkm
parents: 460
diff changeset
1777 if (!called_from_delete_device
9a775fb11bb7 [xemacs-hg @ 2001-05-18 04:39:39 by kkm]
kkm
parents: 460
diff changeset
1778 && !DEVICE_IMPL_FLAG (d, XDEVIMPF_FRAMELESS_OK))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1779 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1780 /* If we're deleting the only non-minibuffer frame on the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1781 device, delete the device. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1782 if (EQ (frame, next_frame (frame, Qnomini, FRAME_DEVICE (f))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1783 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1784 delete_device_internal (d, force, 0, from_io_error);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1785 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1786 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1787 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1788 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1789
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1790 /* In FSF, delete-frame will not normally allow you to delete the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1791 last visible frame. This was too annoying, so we changed it to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1792 only frame. However, this would let people shoot themselves by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1793 deleting all frames which were either visible or iconified and thus
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1794 losing any way of communicating with the still running XEmacs process.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1795 So we put it back. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1796 if (!force && !allow_deletion_of_last_visible_frame &&
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1797 !other_visible_frames (f))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
1798 invalid_operation ("Attempt to delete the sole visible or iconified frame", Qunbound);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1799
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1800 /* Does this frame have a minibuffer, and is it the surrogate
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1801 minibuffer for any other frame? */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1802 if (FRAME_HAS_MINIBUF_P (f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1803 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1804 Lisp_Object frmcons, devcons, concons;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1805
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1806 FRAME_LOOP_NO_BREAK (frmcons, devcons, concons)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1807 {
2552
166ed8151e62 [xemacs-hg @ 2005-02-03 16:30:33 by james]
james
parents: 2551
diff changeset
1808 Lisp_Object this_frame = XCAR (frmcons);
166ed8151e62 [xemacs-hg @ 2005-02-03 16:30:33 by james]
james
parents: 2551
diff changeset
1809
166ed8151e62 [xemacs-hg @ 2005-02-03 16:30:33 by james]
james
parents: 2551
diff changeset
1810 if (! EQ (this_frame, frame)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1811 && EQ (frame, (WINDOW_FRAME
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1812 (XWINDOW
2552
166ed8151e62 [xemacs-hg @ 2005-02-03 16:30:33 by james]
james
parents: 2551
diff changeset
1813 (FRAME_MINIBUF_WINDOW (XFRAME (this_frame)))))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1814 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1815 /* We've found another frame whose minibuffer is on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1816 this frame. */
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
1817 gui_error
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1818 ("Attempt to delete a surrogate minibuffer frame", frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1819 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1820 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1821 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1822
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1823 /* Test for popup frames hanging around. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1824 /* Deletion of a parent frame with popups is deadly. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1825 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1826 Lisp_Object frmcons, devcons, concons;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1827
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1828 FRAME_LOOP_NO_BREAK (frmcons, devcons, concons)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1829 {
2552
166ed8151e62 [xemacs-hg @ 2005-02-03 16:30:33 by james]
james
parents: 2551
diff changeset
1830 Lisp_Object this_frame = XCAR (frmcons);
166ed8151e62 [xemacs-hg @ 2005-02-03 16:30:33 by james]
james
parents: 2551
diff changeset
1831
166ed8151e62 [xemacs-hg @ 2005-02-03 16:30:33 by james]
james
parents: 2551
diff changeset
1832
166ed8151e62 [xemacs-hg @ 2005-02-03 16:30:33 by james]
james
parents: 2551
diff changeset
1833 if (! EQ (this_frame, frame))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1834 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1835 struct device *devcons_d = XDEVICE (XCAR (devcons));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1836 if (EQ (frame, DEVMETH_OR_GIVEN (devcons_d, get_frame_parent,
2552
166ed8151e62 [xemacs-hg @ 2005-02-03 16:30:33 by james]
james
parents: 2551
diff changeset
1837 (XFRAME (this_frame)),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1838 Qnil)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1839 /* We've found a popup frame whose parent is this frame. */
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
1840 gui_error
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1841 ("Attempt to delete a frame with live popups", frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1842 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1843 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1844 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1845
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1846 /* Before here, we haven't made any dangerous changes (just checked for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1847 error conditions). Now run the delete-frame-hook. Remember that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1848 user code there could do any number of dangerous things, including
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1849 signalling an error. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1850
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1851 va_run_hook_with_args (Qdelete_frame_hook, 1, frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1852
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1853 if (!FRAME_LIVE_P (f)) /* Make sure the delete-frame-hook didn't */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1854 { /* go ahead and delete anything. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1855 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1856 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1857 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1858
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1859 /* Call the delete-device-hook and delete-console-hook now if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1860 appropriate, before we do any dangerous things -- they too could
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1861 signal an error. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1862 if (XINT (Flength (DEVICE_FRAME_LIST (d))) == 1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1863 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1864 va_run_hook_with_args (Qdelete_device_hook, 1, device);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1865 if (!FRAME_LIVE_P (f)) /* Make sure the delete-device-hook didn't */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1866 { /* go ahead and delete anything. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1867 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1868 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1869 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1870
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1871 if (XINT (Flength (CONSOLE_DEVICE_LIST (con))) == 1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1872 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1873 va_run_hook_with_args (Qdelete_console_hook, 1, console);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1874 if (!FRAME_LIVE_P (f)) /* Make sure the delete-console-hook didn't */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1875 { /* go ahead and delete anything. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1876 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1877 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1878 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1879 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1880 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1881
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1882 minibuffer_selected = EQ (minibuf_window, Fselected_window (Qnil));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1883
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1884 /* If we were focused on this frame, then we're not any more.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1885 Assume that we lost the focus; that way, the call to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1886 Fselect_frame() below won't end up making us explicitly
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1887 focus on another frame, which is generally undesirable in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1888 a point-to-type world. If our mouse ends up sitting over
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1889 another frame, we will receive a FocusIn event and end up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1890 making that frame the selected frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1891
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1892 #### This may not be an ideal solution in a click-to-type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1893 world (in that case, we might want to explicitly choose
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1894 another frame to have the focus, rather than relying on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1895 the WM, which might focus on a frame in a different app
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1896 or focus on nothing at all). But there's no easy way
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1897 to detect which focus model we're running on, and the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1898 alternative is more heinous. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1899
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1900 if (EQ (frame, DEVICE_FRAME_WITH_FOCUS_REAL (d)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1901 DEVICE_FRAME_WITH_FOCUS_REAL (d) = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1902 if (EQ (frame, DEVICE_FRAME_WITH_FOCUS_FOR_HOOKS (d)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1903 DEVICE_FRAME_WITH_FOCUS_FOR_HOOKS (d) = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1904 if (EQ (frame, DEVICE_FRAME_THAT_OUGHT_TO_HAVE_FOCUS (d)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1905 DEVICE_FRAME_THAT_OUGHT_TO_HAVE_FOCUS (d) = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1906
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1907 /* Don't allow the deleted frame to remain selected.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1908 Note that in the former scheme of things, this would
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1909 have caused us to regain the focus. This no longer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1910 applies (see above); I think the new behavior is more
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1911 logical. If someone disagrees, it can always be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1912 changed (or a new user variable can be introduced, ugh.) */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1913 if (EQ (frame, DEVICE_SELECTED_FRAME (d)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1914 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1915 Lisp_Object next;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1916
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1917 /* If this is a popup frame, select its parent if possible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1918 Otherwise, find another visible frame; if none, just take any frame.
4207
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
1919 First try the same device, then the same console. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1920
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1921 next = DEVMETH_OR_GIVEN (d, get_frame_parent, (f), Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1922 if (NILP (next) || EQ (next, frame) || ! FRAME_LIVE_P (XFRAME (next)))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1923 next = next_frame (frame, Qvisible, device);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1924 if (NILP (next) || EQ (next, frame))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1925 next = next_frame (frame, Qvisible, console);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1926 if (NILP (next) || EQ (next, frame))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1927 next = next_frame (frame, Qvisible, Qt);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1928 if (NILP (next) || EQ (next, frame))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1929 next = next_frame (frame, Qt, device);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1930 if (NILP (next) || EQ (next, frame))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1931 next = next_frame (frame, Qt, console);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1932 if (NILP (next) || EQ (next, frame))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1933 next = next_frame (frame, Qt, Qt);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1934
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1935 /* if we haven't found another frame at this point
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1936 then there aren't any. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1937 if (NILP (next) || EQ (next, frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1938 ;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1939 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1940 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1941 int did_select = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1942 /* if this is the global selected frame, select another one. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1943 if (EQ (frame, Fselected_frame (Qnil)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1944 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1945 Fselect_frame (next);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1946 did_select = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1947 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1948 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1949 * If the new frame we just selected is on a different
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1950 * device then we still need to change DEVICE_SELECTED_FRAME(d)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1951 * to a live frame, if there are any left on this device.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1952 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1953 if (!EQ (device, FRAME_DEVICE(XFRAME(next))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1954 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1955 Lisp_Object next_f = next_frame (frame, Qt, device);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1956 if (NILP (next_f) || EQ (next_f, frame))
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
1957 set_device_selected_frame (d, Qnil);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1958 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1959 set_device_selected_frame (d, next_f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1960 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1961 else if (! did_select)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1962 set_device_selected_frame (d, next);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1963
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1964 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1965 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1966
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1967 /* Don't allow minibuf_window to remain on a deleted frame. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1968 if (EQ (f->minibuffer_window, minibuf_window))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1969 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1970 struct frame *sel_frame = selected_frame ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1971 Fset_window_buffer (sel_frame->minibuffer_window,
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
1972 XWINDOW (minibuf_window)->buffer, Qt);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1973 minibuf_window = sel_frame->minibuffer_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1974
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1975 /* If the dying minibuffer window was selected,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1976 select the new one. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1977 if (minibuffer_selected)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1978 Fselect_window (minibuf_window, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1979 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1980
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1981 /* After this point, no errors must be allowed to occur. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1982
1313
671b65f2b075 [xemacs-hg @ 2003-02-20 01:12:25 by ben]
ben
parents: 1204
diff changeset
1983 /* Checking for QUIT can run all sorts of weird code and may be deadly
671b65f2b075 [xemacs-hg @ 2003-02-20 01:12:25 by ben]
ben
parents: 1204
diff changeset
1984 so don't let it happen. */
671b65f2b075 [xemacs-hg @ 2003-02-20 01:12:25 by ben]
ben
parents: 1204
diff changeset
1985 depth = begin_dont_check_for_quit ();
671b65f2b075 [xemacs-hg @ 2003-02-20 01:12:25 by ben]
ben
parents: 1204
diff changeset
1986
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1987 #ifdef HAVE_MENUBARS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1988 free_frame_menubars (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1989 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1990 #ifdef HAVE_SCROLLBARS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1991 free_frame_scrollbars (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1992 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1993 #ifdef HAVE_TOOLBARS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1994 free_frame_toolbars (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1995 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1996 free_frame_gutters (f);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1997 /* Unfortunately deleting the frame will also delete the parent of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1998 all of the subwindow instances current on the frame. I think this
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1999 can lead to bad things when trying to finalize the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2000 instances. Thus we loop over all instance caches calling the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2001 finalize method for each instance. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2002 free_frame_subwindow_instances (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2003
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2004 /* This must be done before the window and window_mirror structures
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2005 are freed. The scrollbar information is attached to them. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2006 MAYBE_FRAMEMETH (f, delete_frame, (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2007
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2008 /* Mark all the windows that used to be on FRAME as deleted, and then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2009 remove the reference to them. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2010 delete_all_subwindows (XWINDOW (f->root_window));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2011 f->root_window = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2012
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2013 /* clear out the cached glyph information */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2014 f->subwindow_instance_cache = Qnil;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2015
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2016 /* Remove the frame now from the list. This way, any events generated
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2017 on this frame by the maneuvers below will disperse themselves. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2018
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2019 /* This used to be Fdelq(), but that will cause a seg fault if the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2020 QUIT checker happens to get invoked, because the frame list is in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2021 an inconsistent state. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2022 d->frame_list = delq_no_quit (frame, d->frame_list);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2023 RESET_CHANGED_SET_FLAGS;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2024
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2025 f->visible = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2026
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
2027 free_window_mirror (XWINDOW_MIRROR (f->root_mirror));
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
2028
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2029 /* free_line_insertion_deletion_costs (f); */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2030
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2031 /* If we've deleted the last non-minibuf frame, then try to find
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2032 another one. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2033 if (EQ (frame, CONSOLE_LAST_NONMINIBUF_FRAME (con)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2034 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2035 Lisp_Object frmcons, devcons;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2036
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2037 set_console_last_nonminibuf_frame (con, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2038
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2039 CONSOLE_FRAME_LOOP_NO_BREAK (frmcons, devcons, con)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2040 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2041 Lisp_Object ecran = XCAR (frmcons);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2042 if (!FRAME_MINIBUF_ONLY_P (XFRAME (ecran)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2043 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2044 set_console_last_nonminibuf_frame (con, ecran);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2045 goto double_break_1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2046 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2047 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2048 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2049 double_break_1:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2050
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2051 #if 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2052 /* The following test is degenerate FALSE */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2053 if (called_from_delete_device < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2054 /* then we're being called from delete-console, and we shouldn't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2055 try to find another default-minibuffer frame for the console.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2056 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2057 con->default_minibuffer_frame = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2058 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2059
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2060 /* If we've deleted this console's default_minibuffer_frame, try to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2061 find another one. Prefer minibuffer-only frames, but also notice
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2062 frames with other windows. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2063 if (EQ (frame, con->default_minibuffer_frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2064 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2065 Lisp_Object frmcons, devcons;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2066 /* The last frame we saw with a minibuffer, minibuffer-only or not. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2067 Lisp_Object frame_with_minibuf;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2068 /* Some frame we found on the same console, or nil if there are none. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2069 Lisp_Object frame_on_same_console;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2070
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2071 frame_on_same_console = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2072 frame_with_minibuf = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2073
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2074 set_console_last_nonminibuf_frame (con, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2075
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2076 CONSOLE_FRAME_LOOP_NO_BREAK (frmcons, devcons, con)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2077 {
2552
166ed8151e62 [xemacs-hg @ 2005-02-03 16:30:33 by james]
james
parents: 2551
diff changeset
2078 Lisp_Object this_frame;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2079 struct frame *f1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2080
2552
166ed8151e62 [xemacs-hg @ 2005-02-03 16:30:33 by james]
james
parents: 2551
diff changeset
2081 this_frame = XCAR (frmcons);
166ed8151e62 [xemacs-hg @ 2005-02-03 16:30:33 by james]
james
parents: 2551
diff changeset
2082 f1 = XFRAME (this_frame);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2083
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2084 /* Consider only frames on the same console
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2085 and only those with minibuffers. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2086 if (FRAME_HAS_MINIBUF_P (f1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2087 {
2552
166ed8151e62 [xemacs-hg @ 2005-02-03 16:30:33 by james]
james
parents: 2551
diff changeset
2088 frame_with_minibuf = this_frame;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2089 if (FRAME_MINIBUF_ONLY_P (f1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2090 goto double_break_2;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2091 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2092
2552
166ed8151e62 [xemacs-hg @ 2005-02-03 16:30:33 by james]
james
parents: 2551
diff changeset
2093 frame_on_same_console = this_frame;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2094 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2095 double_break_2:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2096
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2097 if (!NILP (frame_on_same_console))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2098 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2099 /* We know that there must be some frame with a minibuffer out
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2100 there. If this were not true, all of the frames present
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2101 would have to be minibuffer-less, which implies that at some
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2102 point their minibuffer frames must have been deleted, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2103 that is prohibited at the top; you can't delete surrogate
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2104 minibuffer frames. */
5050
6f2158fa75ed Fix quick-build, use asserts() in place of ABORT()
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
2105 assert (!NILP (frame_with_minibuf));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2106
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2107 con->default_minibuffer_frame = frame_with_minibuf;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2108 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2109 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2110 /* No frames left on this console--say no minibuffer either. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2111 con->default_minibuffer_frame = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2112 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2113
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
2114 /* Nobody should be accessing anything in this object any more, and
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
2115 making all Lisp_Objects Qnil allows for better GC'ing in case a
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
2116 pointer to the dead frame continues to hang around. Zero all
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
2117 other structs in case someone tries to access something through
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
2118 them. */
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
2119
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
2120 nuke_all_frame_slots (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2121 f->framemeths = dead_console_methods;
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
2122 f->frametype = dead_console;
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 563
diff changeset
2123
853
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
2124 note_object_deleted (frame);
2b6fa2618f76 [xemacs-hg @ 2002-05-28 08:44:22 by ben]
ben
parents: 826
diff changeset
2125
1313
671b65f2b075 [xemacs-hg @ 2003-02-20 01:12:25 by ben]
ben
parents: 1204
diff changeset
2126 unbind_to (depth);
671b65f2b075 [xemacs-hg @ 2003-02-20 01:12:25 by ben]
ben
parents: 1204
diff changeset
2127
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2128 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2129 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2130
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2131 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2132 io_error_delete_frame (Lisp_Object frame)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2133 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2134 delete_frame_internal (XFRAME (frame), 1, 0, 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2135 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2136
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2137 DEFUN ("delete-frame", Fdelete_frame, 0, 2, "", /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2138 Delete FRAME, permanently eliminating it from use.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2139 If omitted, FRAME defaults to the selected frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2140 A frame may not be deleted if its minibuffer is used by other frames.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2141 Normally, you cannot delete the last non-minibuffer-only frame (you must
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2142 use `save-buffers-kill-emacs' or `kill-emacs'). However, if optional
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2143 second argument FORCE is non-nil, you can delete the last frame. (This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2144 will automatically call `save-buffers-kill-emacs'.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2145 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2146 (frame, force))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2147 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2148 /* This function can GC */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2149 struct frame *f;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2150
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2151 if (NILP (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2152 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2153 f = selected_frame ();
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2154 frame = wrap_frame (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2155 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2156 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2157 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2158 CHECK_FRAME (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2159 f = XFRAME (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2160 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2161
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2162 delete_frame_internal (f, !NILP (force), 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2163 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2164 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2165
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2166
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2167 /* Return mouse position in character cell units. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2168
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2169 static int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2170 mouse_pixel_position_1 (struct device *d, Lisp_Object *frame,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2171 int *x, int *y)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2172 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2173 switch (DEVMETH_OR_GIVEN (d, get_mouse_position, (d, frame, x, y), -1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2174 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2175 case 1:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2176 return 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2177
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2178 case 0:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2179 *frame = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2180 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2181
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2182 case -1:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2183 *frame = DEVICE_SELECTED_FRAME (d);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2184 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2185
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2186 default:
2500
3d8143fc88e1 [xemacs-hg @ 2005-01-24 23:33:30 by ben]
ben
parents: 2367
diff changeset
2187 ABORT (); /* method is incorrectly written */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2188 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2189
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2190 return 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2191 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2192
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2193 DEFUN ("mouse-pixel-position", Fmouse_pixel_position, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2194 Return a list (WINDOW X . Y) giving the current mouse window and position.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2195 The position is given in pixel units, where (0, 0) is the upper-left corner
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2196 of the window.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2197
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2198 When the cursor is not over a window, the return value is a list (nil nil).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2199
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2200 DEVICE specifies the device on which to read the mouse position, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2201 defaults to the selected device. If the device is a mouseless terminal
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2202 or XEmacs hasn't been programmed to read its mouse position, it returns
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2203 the device's selected window for WINDOW and nil for X and Y.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2204 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2205 (device))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2206 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2207 struct device *d = decode_device (device);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2208 Lisp_Object frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2209 Lisp_Object window = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2210 Lisp_Object x = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2211 Lisp_Object y = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2212 int intx, inty;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2213
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2214 if (mouse_pixel_position_1 (d, &frame, &intx, &inty) > 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2215 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2216 struct window *w =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2217 find_window_by_pixel_pos (intx, inty, XFRAME (frame)->root_window);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2218 if (w)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2219 {
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2220 window = wrap_window (w);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2221
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2222 /* Adjust the position to be relative to the window. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2223 intx -= w->pixel_left;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2224 inty -= w->pixel_top;
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2225 x = make_int (intx);
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2226 y = make_int (inty);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2227 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2228 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2229 else if (FRAMEP (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2230 window = FRAME_SELECTED_WINDOW (XFRAME (frame));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2231
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2232 return Fcons (window, Fcons (x, y));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2233 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2234
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2235 DEFUN ("mouse-position", Fmouse_position, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2236 Return a list (WINDOW X . Y) giving the current mouse window and position.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2237 The position is of a character under cursor, where (0, 0) is the upper-left
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2238 corner of the window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2239
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2240 When the cursor is not over a character, or not over a window, the return
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2241 value is a list (nil nil).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2242
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2243 DEVICE specifies the device on which to read the mouse position, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2244 defaults to the selected device. If the device is a mouseless terminal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2245 or Emacs hasn't been programmed to read its mouse position, it returns
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2246 the device's selected window for WINDOW and nil for X and Y.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2247 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2248 (device))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2249 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2250 struct device *d = decode_device (device);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2251 struct window *w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2252 Lisp_Object frame, window = Qnil, lisp_x = Qnil, lisp_y = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2253 int x, y, obj_x, obj_y;
665
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 617
diff changeset
2254 Charbpos charbpos, closest;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2255 Charcount modeline_closest;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2256 Lisp_Object obj1, obj2;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2257
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2258 if (mouse_pixel_position_1 (d, &frame, &x, &y) > 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2259 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2260 int res = pixel_to_glyph_translation (XFRAME (frame), x, y, &x, &y,
665
fdefd0186b75 [xemacs-hg @ 2001-09-20 06:28:42 by ben]
ben
parents: 617
diff changeset
2261 &obj_x, &obj_y, &w, &charbpos,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2262 &closest, &modeline_closest,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2263 &obj1, &obj2);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2264 if (res == OVER_TEXT)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2265 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2266 lisp_x = make_int (x);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2267 lisp_y = make_int (y);
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2268 window = wrap_window (w);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2269 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2270 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2271 else if (FRAMEP (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2272 window = FRAME_SELECTED_WINDOW (XFRAME (frame));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2273
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2274 return Fcons (window, Fcons (lisp_x, lisp_y));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2275 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2276
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2277 DEFUN ("mouse-position-as-motion-event", Fmouse_position_as_motion_event, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2278 Return the current mouse position as a motion event.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2279 This allows you to call the standard event functions such as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2280 `event-over-toolbar-p' to determine where the mouse is.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2281
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2282 DEVICE specifies the device on which to read the mouse position, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2283 defaults to the selected device. If the mouse position can't be determined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2284 \(e.g. DEVICE is a TTY device), nil is returned instead of an event.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2285 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2286 (device))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2287 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2288 struct device *d = decode_device (device);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2289 Lisp_Object frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2290 int intx, inty;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2291
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2292 if (mouse_pixel_position_1 (d, &frame, &intx, &inty))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2293 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2294 Lisp_Object event = Fmake_event (Qnil, Qnil);
934
c925bacdda60 [xemacs-hg @ 2002-07-29 09:21:12 by michaels]
michaels
parents: 872
diff changeset
2295 XSET_EVENT_TYPE (event, pointer_motion_event);
c925bacdda60 [xemacs-hg @ 2002-07-29 09:21:12 by michaels]
michaels
parents: 872
diff changeset
2296 XSET_EVENT_CHANNEL (event, frame);
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
2297 XSET_EVENT_MOTION_X (event, intx);
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 1161
diff changeset
2298 XSET_EVENT_MOTION_Y (event, inty);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2299 return event;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2300 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2301 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2302 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2303 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2304
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2305 DEFUN ("set-mouse-position", Fset_mouse_position, 3, 3, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2306 Move the mouse pointer to the center of character cell (X,Y) in WINDOW.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2307 Note, this is a no-op for an X frame that is not visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2308 If you have just created a frame, you must wait for it to become visible
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2309 before calling this function on it, like this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2310 (while (not (frame-visible-p frame)) (sleep-for .5))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2311 Note also: Warping the mouse is contrary to the ICCCM, so be very sure
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2312 that the behavior won't end up being obnoxious!
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2313 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2314 (window, x, y))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2315 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2316 struct window *w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2317 int pix_x, pix_y;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2318
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2319 CHECK_LIVE_WINDOW (window);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2320 CHECK_INT (x);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2321 CHECK_INT (y);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2322
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2323 /* Warping the mouse will cause EnterNotify and Focus events under X. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2324 w = XWINDOW (window);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2325 glyph_to_pixel_translation (w, XINT (x), XINT (y), &pix_x, &pix_y);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2326
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2327 MAYBE_FRAMEMETH (XFRAME (w->frame), set_mouse_position, (w, pix_x, pix_y));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2328
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2329 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2330 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2331
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2332 DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position, 3, 3, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2333 Move the mouse pointer to pixel position (X,Y) in WINDOW.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2334 Note, this is a no-op for an X frame that is not visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2335 If you have just created a frame, you must wait for it to become visible
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2336 before calling this function on it, like this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2337 (while (not (frame-visible-p frame)) (sleep-for .5))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2338 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2339 (window, x, y))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2340 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2341 struct window *w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2342
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2343 CHECK_LIVE_WINDOW (window);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2344 CHECK_INT (x);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2345 CHECK_INT (y);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2346
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2347 /* Warping the mouse will cause EnterNotify and Focus events under X. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2348 w = XWINDOW (window);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2349 FRAMEMETH (XFRAME (w->frame), set_mouse_position, (w, XINT (x), XINT (y)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2350
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2351 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2352 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2353
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2354 DEFUN ("make-frame-visible", Fmake_frame_visible, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2355 Make the frame FRAME visible (assuming it is an X-window).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2356 If omitted, FRAME defaults to the currently selected frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2357 Also raises the frame so that nothing obscures it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2358 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2359 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2360 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2361 struct frame *f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2362
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2363 MAYBE_FRAMEMETH (f, make_frame_visible, (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2364 return frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2365 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2366
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2367 DEFUN ("make-frame-invisible", Fmake_frame_invisible, 0, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2368 Unconditionally removes frame from the display (assuming it is an X-window).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2369 If omitted, FRAME defaults to the currently selected frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2370 If what you want to do is iconify the frame (if the window manager uses
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2371 icons) then you should call `iconify-frame' instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2372 Normally you may not make FRAME invisible if all other frames are invisible
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2373 and uniconified, but if the second optional argument FORCE is non-nil,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2374 you may do so.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2375 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2376 (frame, force))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2377 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2378 struct frame *f, *sel_frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2379 struct device *d;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2380
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2381 f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2382 d = XDEVICE (FRAME_DEVICE (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2383 sel_frame = XFRAME (DEVICE_SELECTED_FRAME (d));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2384
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2385 if (NILP (force) && !other_visible_frames (f))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
2386 invalid_operation ("Attempt to make invisible the sole visible or iconified frame", Qunbound);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2387
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2388 /* Don't allow minibuf_window to remain on a deleted frame. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2389 if (EQ (f->minibuffer_window, minibuf_window))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2390 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2391 Fset_window_buffer (sel_frame->minibuffer_window,
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
2392 XWINDOW (minibuf_window)->buffer, Qt);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2393 minibuf_window = sel_frame->minibuffer_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2394 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2395
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2396 MAYBE_FRAMEMETH (f, make_frame_invisible, (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2397
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2398 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2399 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2400
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2401 DEFUN ("iconify-frame", Ficonify_frame, 0, 1, "", /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2402 Make the frame FRAME into an icon, if the window manager supports icons.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2403 If omitted, FRAME defaults to the currently selected frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2404 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2405 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2406 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2407 struct frame *f, *sel_frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2408 struct device *d;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2409
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2410 f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2411 d = XDEVICE (FRAME_DEVICE (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2412 sel_frame = XFRAME (DEVICE_SELECTED_FRAME (d));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2413
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2414 /* Don't allow minibuf_window to remain on a deleted frame. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2415 if (EQ (f->minibuffer_window, minibuf_window))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2416 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2417 Fset_window_buffer (sel_frame->minibuffer_window,
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
2418 XWINDOW (minibuf_window)->buffer, Qt);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2419 minibuf_window = sel_frame->minibuffer_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2420 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2421
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2422 MAYBE_FRAMEMETH (f, iconify_frame, (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2423
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2424 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2425 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2426
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2427 DEFUN ("deiconify-frame", Fdeiconify_frame, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2428 Open (de-iconify) the iconified frame FRAME.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2429 Under X, this is currently the same as `make-frame-visible'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2430 If omitted, FRAME defaults to the currently selected frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2431 Also raises the frame so that nothing obscures it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2432 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2433 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2434 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2435 return Fmake_frame_visible (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2436 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2437
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
2438 /* FSF returns `icon' for iconized frames. What a crock! */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2439
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2440 DEFUN ("frame-visible-p", Fframe_visible_p, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2441 Return non NIL if FRAME is now "visible" (actually in use for display).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2442 A frame that is not visible is not updated, and, if it works through a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2443 window system, may not show at all.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2444 N.B. Under X "visible" means Mapped. It the window is mapped but not
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 3017
diff changeset
2445 actually visible on screen then `frame-visible-p' returns `hidden'.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2446 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2447 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2448 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2449 struct frame *f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2450 int visible = FRAMEMETH_OR_GIVEN (f, frame_visible_p, (f), f->visible);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2451 return visible ? ( visible > 0 ? Qt : Qhidden ) : Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2452 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2453
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2454 DEFUN ("frame-totally-visible-p", Fframe_totally_visible_p, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2455 Return t if frame is not obscured by any other window system windows.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2456 Always returns t for tty frames.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2457 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2458 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2459 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2460 struct frame *f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2461 return (FRAMEMETH_OR_GIVEN (f, frame_totally_visible_p, (f), f->visible)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2462 ? Qt : Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2463 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2464
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2465 DEFUN ("frame-iconified-p", Fframe_iconified_p, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2466 Return t if FRAME is iconified.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2467 Not all window managers use icons; some merely unmap the window, so this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2468 function is not the inverse of `frame-visible-p'. It is possible for a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2469 frame to not be visible and not be iconified either. However, if the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2470 frame is iconified, it will not be visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2471 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2472 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2473 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2474 struct frame *f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2475 if (f->visible)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2476 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2477 f->iconified = FRAMEMETH_OR_GIVEN (f, frame_iconified_p, (f), 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2478 return f->iconified ? Qt : Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2479 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2480
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2481 DEFUN ("visible-frame-list", Fvisible_frame_list, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2482 Return a list of all frames now "visible" (being updated).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2483 If DEVICE is specified only frames on that device will be returned.
460
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 450
diff changeset
2484 Note that under virtual window managers not all these frames are
223736d75acb Import from CVS: tag r21-2-45
cvs
parents: 450
diff changeset
2485 necessarily really updated.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2486 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2487 (device))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2488 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2489 Lisp_Object devcons, concons;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2490 struct frame *f;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2491 Lisp_Object value;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2492
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2493 value = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2494
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2495 DEVICE_LOOP_NO_BREAK (devcons, concons)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2496 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2497 assert (DEVICEP (XCAR (devcons)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2498
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2499 if (NILP (device) || EQ (device, XCAR (devcons)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2500 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2501 Lisp_Object frmcons;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2502
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2503 DEVICE_FRAME_LOOP (frmcons, XDEVICE (XCAR (devcons)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2504 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2505 Lisp_Object frame = XCAR (frmcons);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2506 f = XFRAME (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2507 if (FRAME_VISIBLE_P(f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2508 value = Fcons (frame, value);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2509 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2510 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2511 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2512
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2513 return value;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2514 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2515
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2516
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2517 DEFUN ("raise-frame", Fraise_frame, 0, 1, "", /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2518 Bring FRAME to the front, so it occludes any frames it overlaps.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2519 If omitted, FRAME defaults to the currently selected frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2520 If FRAME is invisible, make it visible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2521 If Emacs is displaying on an ordinary terminal or some other device which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2522 doesn't support multiple overlapping frames, this function does nothing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2523 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2524 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2525 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2526 struct frame *f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2527
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2528 /* Do like the documentation says. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2529 Fmake_frame_visible (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2530 MAYBE_FRAMEMETH (f, raise_frame, (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2531 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2532 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2533
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2534 DEFUN ("lower-frame", Flower_frame, 0, 1, "", /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2535 Send FRAME to the back, so it is occluded by any frames that overlap it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2536 If omitted, FRAME defaults to the currently selected frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2537 If Emacs is displaying on an ordinary terminal or some other device which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2538 doesn't support multiple overlapping frames, this function does nothing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2539 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2540 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2541 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2542 struct frame *f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2543
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2544 MAYBE_FRAMEMETH (f, lower_frame, (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2545 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2546 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2547
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2548
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2549 DEFUN ("disable-frame", Fdisable_frame, 1, 1, 0, /*
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2550 Disable frame FRAME, so that it cannot have the focus or receive user input.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2551 This is normally used during modal dialog boxes.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2552 WARNING: Be very careful not to wedge XEmacs!
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2553 Use an `unwind-protect' that re-enables the frame to avoid this.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2554 */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2555 (frame))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2556 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2557 struct frame *f = decode_frame (frame);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2558
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2559 f->disabled = 1;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2560 MAYBE_FRAMEMETH (f, disable_frame, (f));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2561 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2562 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2563
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2564 DEFUN ("enable-frame", Fenable_frame, 1, 1, 0, /*
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2565 Enable frame FRAME, so that it can have the focus and receive user input.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2566 Frames are normally enabled, unless explicitly disabled using `disable-frame'.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2567 */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2568 (frame))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2569 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2570 struct frame *f = decode_frame (frame);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2571 f->disabled = 0;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2572 MAYBE_FRAMEMETH (f, enable_frame, (f));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2573 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2574 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2575
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2576 /* Ben thinks there is no need for `redirect-frame-focus' or `frame-focus',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2577 crockish FSFmacs functions. See summary on focus in event-stream.c. */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2578
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2579 DEFUN ("print-job-page-number", Fprint_job_page_number, 1, 1, 0, /*
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2580 Return current page number for the print job FRAME.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2581 */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2582 (frame))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2583 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2584 CHECK_PRINTER_FRAME (frame);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2585 return make_int (FRAME_PAGENUMBER (XFRAME (frame)));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2586 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2587
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2588 DEFUN ("print-job-eject-page", Fprint_job_eject_page, 1, 1, 0, /*
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2589 Eject page in the print job FRAME.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2590 */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2591 (frame))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2592 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2593 struct frame *f;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2594
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2595 CHECK_PRINTER_FRAME (frame);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2596 f = XFRAME (frame);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2597 FRAMEMETH (f, eject_page, (f));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2598 FRAME_SET_PAGENUMBER (f, 1 + FRAME_PAGENUMBER (f));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2599 f->clear = 1;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2600
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2601 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2602 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2603
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2604
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2605 /***************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2606 /* frame properties */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2607 /***************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2608
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2609 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2610 store_minibuf_frame_prop (struct frame *f, Lisp_Object val)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2611 {
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
2612 /* This can call Lisp. */
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2613 Lisp_Object frame = wrap_frame (f);
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2614
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2615 if (WINDOWP (val))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2616 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2617 if (! MINI_WINDOW_P (XWINDOW (val)))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
2618 gui_error
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2619 ("Surrogate minibuffer windows must be minibuffer windows",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2620 val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2621
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2622 if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
2623 gui_error
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2624 ("Can't change the surrogate minibuffer of a frame with its own minibuffer", frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2625
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2626 /* Install the chosen minibuffer window, with proper buffer. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2627 f->minibuffer_window = val;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2628 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2629 else if (EQ (val, Qt))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2630 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2631 if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f))
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
2632 gui_error
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2633 ("Frame already has its own minibuffer", frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2634 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2635 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2636 setup_normal_frame (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2637 f->mirror_dirty = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2638
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2639 update_frame_window_mirror (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2640 internal_set_frame_size (f, f->width, f->height, 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2641 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2642 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2643 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2644
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2645 #if 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2646
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2647 /* possible code if you want to have symbols such as `default-background'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2648 map to setting the background of `default', etc. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2649
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2650 static int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2651 dissect_as_face_setting (Lisp_Object sym, Lisp_Object *face_out,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2652 Lisp_Object *face_prop_out)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2653 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2654 Lisp_Object list = Vbuilt_in_face_specifiers;
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2655 Lisp_Object s;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2656
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2657 if (!SYMBOLP (sym))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2658 return 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2659
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2660 s = symbol_name (XSYMBOL (sym));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2661
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2662 while (!NILP (list))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2663 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2664 Lisp_Object prop = Fcar (list);
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2665 Lisp_Object prop_name;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2666
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2667 if (!SYMBOLP (prop))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2668 continue;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2669 prop_name = symbol_name (XSYMBOL (prop));
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2670 if (XSTRING_LENGTH (s) > XSTRING_LENGTH (prop_name) + 1
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2671 && !memcmp (XSTRING_DATA (prop_name),
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2672 XSTRING_DATA (s) + XSTRING_LENGTH (s)
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2673 - XSTRING_LENGTH (prop_name),
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2674 XSTRING_LENGTH (prop_name))
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2675 && XSTRING_DATA (s)[XSTRING_LENGTH (s) - XSTRING_LENGTH (prop_name)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2676 - 1] == '-')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2677 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2678 Lisp_Object face =
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2679 Ffind_face (make_string (XSTRING_DATA (s),
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2680 XSTRING_LENGTH (s)
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2681 - XSTRING_LENGTH (prop_name)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2682 - 1));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2683 if (!NILP (face))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2684 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2685 *face_out = face;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2686 *face_prop_out = prop;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2687 return 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2688 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2689 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2690
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2691 list = Fcdr (list);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2692 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2693
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2694 return 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2695 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2696
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2697 #endif /* 0 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2698
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2699 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2700 get_property_alias (Lisp_Object prop)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2701 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2702 while (1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2703 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2704 Lisp_Object alias = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2705
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2706 if (SYMBOLP (prop))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2707 alias = Fget (prop, Qframe_property_alias, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2708 if (NILP (alias))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2709 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2710 prop = alias;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2711 QUIT;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2712 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2713
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2714 return prop;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2715 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2716
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2717 /* #### Using this to modify the internal border width has no effect
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2718 because the change isn't propagated to the windows. Are there
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2719 other properties which this claims to handle, but doesn't?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2720
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2721 But of course. This stuff needs more work, but it's a lot closer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2722 to sanity now than before with the horrible frame-params stuff. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2723
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2724 DEFUN ("set-frame-properties", Fset_frame_properties, 2, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2725 Change some properties of a frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2726 PLIST is a property list.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2727 You can also change frame properties individually using `set-frame-property',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2728 but it may be more efficient to change many properties at once.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2729
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2730 Frame properties can be retrieved using `frame-property' or `frame-properties'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2731
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2732 The following symbols etc. have predefined meanings:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2733
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2734 name Name of the frame. Used with X resources.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2735 Unchangeable after creation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2736
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2737 height Height of the frame, in lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2738
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2739 width Width of the frame, in characters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2740
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2741 minibuffer Gives the minibuffer behavior for this frame. Either
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2742 t (frame has its own minibuffer), `only' (frame is
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2743 a minibuffer-only frame), `none' (frame has no minibuffer)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2744 or a window (frame uses that window, which is on another
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2745 frame, as the minibuffer).
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2746
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2747 unsplittable If non-nil, frame cannot be split by `display-buffer'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2748
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2749 current-display-table, menubar-visible-p, left-margin-width,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2750 right-margin-width, minimum-line-ascent, minimum-line-descent,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2751 use-left-overflow, use-right-overflow, scrollbar-width, scrollbar-height,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2752 default-toolbar, top-toolbar, bottom-toolbar, left-toolbar, right-toolbar,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2753 default-toolbar-height, default-toolbar-width, top-toolbar-height,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2754 bottom-toolbar-height, left-toolbar-width, right-toolbar-width,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2755 default-toolbar-visible-p, top-toolbar-visible-p, bottom-toolbar-visible-p,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2756 left-toolbar-visible-p, right-toolbar-visible-p, toolbar-buttons-captioned-p,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2757 top-toolbar-border-width, bottom-toolbar-border-width,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2758 left-toolbar-border-width, right-toolbar-border-width,
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2759 modeline-shadow-thickness, has-modeline-p,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2760 default-gutter, top-gutter, bottom-gutter, left-gutter, right-gutter,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2761 default-gutter-height, default-gutter-width, top-gutter-height,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2762 bottom-gutter-height, left-gutter-width, right-gutter-width,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2763 default-gutter-visible-p, top-gutter-visible-p, bottom-gutter-visible-p,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2764 left-gutter-visible-p, right-gutter-visible-p, top-gutter-border-width,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2765 bottom-gutter-border-width, left-gutter-border-width, right-gutter-border-width,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2766 [Giving the name of any built-in specifier variable is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2767 equivalent to calling `set-specifier' on the specifier,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2768 with a locale of FRAME. Giving the name to `frame-property'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2769 calls `specifier-instance' on the specifier.]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2770
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2771 text-pointer-glyph, nontext-pointer-glyph, modeline-pointer-glyph,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2772 selection-pointer-glyph, busy-pointer-glyph, toolbar-pointer-glyph,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2773 menubar-pointer-glyph, scrollbar-pointer-glyph, gc-pointer-glyph,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2774 octal-escape-glyph, control-arrow-glyph, invisible-text-glyph,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2775 hscroll-glyph, truncation-glyph, continuation-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2776 [Giving the name of any glyph variable is equivalent to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2777 calling `set-glyph-image' on the glyph, with a locale
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2778 of FRAME. Giving the name to `frame-property' calls
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2779 `glyph-image-instance' on the glyph.]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2780
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2781 [default foreground], [default background], [default font],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2782 [modeline foreground], [modeline background], [modeline font],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2783 etc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2784 [Giving a vector of a face and a property is equivalent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2785 to calling `set-face-property' on the face and property,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2786 with a locale of FRAME. Giving the vector to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2787 `frame-property' calls `face-property-instance' on the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2788 face and property.]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2789
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2790 Finally, if a frame property symbol has the property `frame-property-alias'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2791 on it, then the value will be used in place of that symbol when looking
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2792 up and setting frame property values. This allows you to alias one
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2793 frame property name to another.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2794
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2795 See the variables `default-x-frame-plist', `default-tty-frame-plist'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2796 and `default-mswindows-frame-plist' for a description of the properties
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2797 recognized for particular types of frames.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2798 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2799 (frame, plist))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2800 {
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
2801 /* This can call Lisp. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2802 struct frame *f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2803 Lisp_Object tail;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2804 Lisp_Object *tailp;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2805 struct gcpro gcpro1, gcpro2;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2806
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2807 frame = wrap_frame (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2808 GCPRO2 (frame, plist);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2809 Fcheck_valid_plist (plist);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2810 plist = Fcopy_sequence (plist);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2811 Fcanonicalize_lax_plist (plist, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2812 for (tail = plist; !NILP (tail); tail = Fcdr (Fcdr (tail)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2813 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2814 Lisp_Object prop = Fcar (tail);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2815 Lisp_Object val = Fcar (Fcdr (tail));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2816
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2817 prop = get_property_alias (prop);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2818
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2819 #if 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2820 /* mly wants this, but it's not reasonable to change the name of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2821 frame after it has been created, because the old name was used
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2822 for resource lookup. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2823 if (EQ (prop, Qname))
4207
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
2824 {
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
2825 CHECK_STRING (val);
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
2826 f->name = val;
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
2827 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2828 #endif /* 0 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2829 if (EQ (prop, Qminibuffer))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2830 store_minibuf_frame_prop (f, val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2831 if (EQ (prop, Qunsplittable))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2832 f->no_split = !NILP (val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2833 if (EQ (prop, Qbuffer_predicate))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2834 f->buffer_predicate = val;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2835 if (SYMBOLP (prop) && EQ (Fbuilt_in_variable_type (prop),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2836 Qconst_specifier))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2837 call3 (Qset_specifier, Fsymbol_value (prop), val, frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2838 if (SYMBOLP (prop) && !NILP (Fget (prop, Qconst_glyph_variable, Qnil)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2839 call3 (Qset_glyph_image, Fsymbol_value (prop), val, frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2840 if (VECTORP (prop) && XVECTOR_LENGTH (prop) == 2)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2841 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2842 Lisp_Object face_prop = XVECTOR_DATA (prop)[1];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2843 CHECK_SYMBOL (face_prop);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2844 call4 (Qset_face_property,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2845 Fget_face (XVECTOR_DATA (prop)[0]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2846 face_prop, val, frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2847 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2848 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2849
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2850 MAYBE_FRAMEMETH (f, set_frame_properties, (f, plist));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2851 for (tailp = &plist; !NILP (*tailp);)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2852 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2853 Lisp_Object *next_tailp;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2854 Lisp_Object next;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2855 Lisp_Object prop;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2856
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2857 next = Fcdr (*tailp);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2858 CHECK_CONS (next);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2859 next_tailp = &XCDR (next);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2860 prop = Fcar (*tailp);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2861
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2862 prop = get_property_alias (prop);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2863
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2864 if (EQ (prop, Qminibuffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2865 || EQ (prop, Qunsplittable)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2866 || EQ (prop, Qbuffer_predicate)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2867 || EQ (prop, Qheight)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2868 || EQ (prop, Qwidth)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2869 || (SYMBOLP (prop) && EQ (Fbuilt_in_variable_type (prop),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2870 Qconst_specifier))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2871 || (SYMBOLP (prop) && !NILP (Fget (prop, Qconst_glyph_variable,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2872 Qnil)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2873 || (VECTORP (prop) && XVECTOR_LENGTH (prop) == 2)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2874 || FRAMEMETH_OR_GIVEN (f, internal_frame_property_p, (f, prop), 0))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2875 *tailp = *next_tailp;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2876 tailp = next_tailp;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2877 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2878
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2879 f->plist = nconc2 (plist, f->plist);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2880 Fcanonicalize_lax_plist (f->plist, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2881 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2882 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2883 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2884
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2885 DEFUN ("frame-property", Fframe_property, 2, 3, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2886 Return FRAME's value for property PROPERTY.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
2887 Return DEFAULT if there is no such property.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2888 See `set-frame-properties' for the built-in property names.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2889 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2890 (frame, property, default_))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2891 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2892 struct frame *f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2893 Lisp_Object value;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2894
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2895 frame = wrap_frame (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2896
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2897 property = get_property_alias (property);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2898
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2899 if (EQ (Qname, property)) return f->name;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2900
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2901 if (EQ (Qheight, property) || EQ (Qwidth, property))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2902 {
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
2903 int width, height;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
2904 get_frame_char_size (f, &width, &height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
2905 return make_int (EQ (Qheight, property) ? height : width);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2906 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2907
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2908 /* NOTE: FSF returns Qnil instead of Qt for FRAME_HAS_MINIBUF_P.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2909 This is over-the-top bogosity, because it's inconsistent with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2910 the semantics of `minibuffer' when passed to `make-frame'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2911 Returning Qt makes things consistent. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2912 if (EQ (Qminibuffer, property))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2913 return (FRAME_MINIBUF_ONLY_P (f) ? Qonly :
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2914 FRAME_HAS_MINIBUF_P (f) ? Qt :
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2915 FRAME_MINIBUF_WINDOW (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2916 if (EQ (Qunsplittable, property))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2917 return FRAME_NO_SPLIT_P (f) ? Qt : Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2918 if (EQ (Qbuffer_predicate, property))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2919 return f->buffer_predicate;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2920
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2921 if (SYMBOLP (property))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2922 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2923 if (EQ (Fbuilt_in_variable_type (property), Qconst_specifier))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2924 return Fspecifier_instance (Fsymbol_value (property),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2925 frame, default_, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2926 if (!NILP (Fget (property, Qconst_glyph_variable, Qnil)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2927 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2928 Lisp_Object glyph = Fsymbol_value (property);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2929 CHECK_GLYPH (glyph);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2930 return Fspecifier_instance (XGLYPH_IMAGE (glyph),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2931 frame, default_, Qnil);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2932 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2933 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2934
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2935 if (VECTORP (property) && XVECTOR_LENGTH (property) == 2)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2936 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2937 Lisp_Object face_prop = XVECTOR_DATA (property)[1];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2938 CHECK_SYMBOL (face_prop);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2939 return call3 (Qface_property_instance,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2940 Fget_face (XVECTOR_DATA (property)[0]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2941 face_prop, frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2942 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2943
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2944 if (HAS_FRAMEMETH_P (f, frame_property))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2945 if (!UNBOUNDP (value = FRAMEMETH (f, frame_property, (f, property))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2946 return value;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2947
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2948 if (!UNBOUNDP (value = external_plist_get (&f->plist, property, 1, ERROR_ME)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2949 return value;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2950
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2951 return default_;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2952 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2953
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2954 DEFUN ("frame-properties", Fframe_properties, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2955 Return a property list of the properties of FRAME.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2956 Do not modify this list; use `set-frame-property' instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2957 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2958 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2959 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2960 struct frame *f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2961 Lisp_Object result = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2962 struct gcpro gcpro1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2963
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2964 GCPRO1 (result);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2965
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
2966 frame = wrap_frame (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2967
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2968 /* #### for the moment (since old code uses `frame-parameters'),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2969 we call `copy-sequence' on f->plist. That allows frame-parameters
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2970 to destructively convert the plist into an alist, which is more
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2971 efficient than doing it non-destructively. At some point we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2972 should remove the call to copy-sequence. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2973 result = Fcopy_sequence (f->plist);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2974
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2975 /* #### should we be adding all the specifiers and glyphs?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2976 That would entail having a list of them all. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2977 if (HAS_FRAMEMETH_P (f, frame_properties))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2978 result = nconc2 (FRAMEMETH (f, frame_properties, (f)), result);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2979
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2980 if (!NILP (f->buffer_predicate))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2981 result = cons3 (Qbuffer_predicate, f->buffer_predicate, result);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2982
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2983 if (FRAME_NO_SPLIT_P (f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2984 result = cons3 (Qunsplittable, Qt, result);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2985
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2986 /* NOTE: FSF returns Qnil instead of Qt for FRAME_HAS_MINIBUF_P.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2987 This is over-the-top bogosity, because it's inconsistent with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2988 the semantics of `minibuffer' when passed to `make-frame'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2989 Returning Qt makes things consistent. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2990 result = cons3 (Qminibuffer,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2991 (FRAME_MINIBUF_ONLY_P (f) ? Qonly :
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2992 FRAME_HAS_MINIBUF_P (f) ? Qt :
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2993 FRAME_MINIBUF_WINDOW (f)),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2994 result);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2995 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2996 int width, height;
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
2997 get_frame_char_size (f, &width, &height);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2998 result = cons3 (Qwidth , make_int (width), result);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2999 result = cons3 (Qheight, make_int (height), result);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3000 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3001
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3002 result = cons3 (Qname, f->name, result);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3003
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3004 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3005 return result;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3006 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3007
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3008
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3009 DEFUN ("frame-pixel-height", Fframe_pixel_height, 0, 1, 0, /*
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3010 Return the total height in pixels of FRAME.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3011 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3012 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3013 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3014 return make_int (decode_frame (frame)->pixheight);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3015 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3016
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3017 DEFUN ("frame-displayable-pixel-height", Fframe_displayable_pixel_height, 0, 1, 0, /*
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3018 Return the height of the displayable area in pixels of FRAME.
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3019 */
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3020 (frame))
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3021 {
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3022 struct frame *f = decode_frame (frame);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3023 int width, height;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3024
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3025 get_frame_displayable_pixel_size (f, &width, &height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3026 return make_int (height);
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3027 }
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3028
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3029 DEFUN ("frame-pixel-width", Fframe_pixel_width, 0, 1, 0, /*
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3030 Return the total width in pixels of FRAME.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3031 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3032 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3033 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3034 return make_int (decode_frame (frame)->pixwidth);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3035 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3036
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3037 DEFUN ("frame-displayable-pixel-width", Fframe_displayable_pixel_width, 0, 1, 0, /*
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3038 Return the width of the displayable area in pixels of FRAME.
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3039 */
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3040 (frame))
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3041 {
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3042 struct frame *f = decode_frame (frame);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3043 int width, height;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3044
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3045 get_frame_displayable_pixel_size (f, &width, &height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3046 return make_int (width);
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3047 }
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3048
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3049 DEFUN ("frame-name", Fframe_name, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3050 Return the name of FRAME (defaulting to the selected frame).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3051 This is not the same as the `title' of the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3052 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3053 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3054 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3055 return decode_frame (frame)->name;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3056 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3057
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3058 DEFUN ("frame-modified-tick", Fframe_modified_tick, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3059 Return FRAME's tick counter, incremented for each change to the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3060 Each frame has a tick counter which is incremented each time the frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3061 is resized, a window is resized, added, or deleted, a face is changed,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3062 `set-window-buffer' or `select-window' is called on a window in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3063 frame, the window-start of a window in the frame has changed, or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3064 anything else interesting has happened. It wraps around occasionally.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3065 No argument or nil as argument means use selected frame as FRAME.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3066 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3067 (frame))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3068 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3069 return make_int (decode_frame (frame)->modiff);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3070 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3071
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3072 void
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3073 internal_set_frame_size (struct frame *f, int cols, int rows, int pretend)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3074 {
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
3075 /* This can call Lisp. See mswindows_set_frame_size(). */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3076 /* An explicit size change cancels any pending frame size adjustment */
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
3077 CLEAR_FRAME_SIZE_SLIPPED (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3078
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3079 if (pretend || !HAS_FRAMEMETH_P (f, set_frame_size))
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3080 change_frame_size (f, cols, rows, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3081 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3082 FRAMEMETH (f, set_frame_size, (f, cols, rows));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3083 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3084
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3085 DEFUN ("set-frame-height", Fset_frame_height, 2, 3, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3086 Specify that the frame FRAME has LINES lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3087 Optional third arg non-nil means that redisplay should use LINES lines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3088 but that the idea of the actual height of the frame should not be changed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3089 */
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
3090 (frame, lines, pretend))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3091 {
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
3092 /* This can call Lisp. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3093 struct frame *f = decode_frame (frame);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3094 int cwidth, cheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3095 int guwidth, guheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3096
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
3097 CHECK_INT (lines);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3098 get_frame_char_size (f, &cwidth, &cheight);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3099 cheight = XINT (lines);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3100 frame_conversion_internal (f, SIZE_CHAR_CELL, cwidth, cheight,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3101 SIZE_FRAME_UNIT, &guwidth, &guheight);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3102 internal_set_frame_size (f, guwidth, guheight, !NILP (pretend));
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3103 return wrap_frame (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3104 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3105
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3106 DEFUN ("set-frame-pixel-height", Fset_frame_pixel_height, 2, 3, 0, /*
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3107 Specify that the frame FRAME is a total of HEIGHT pixels tall.
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3108 Optional third arg non-nil means that redisplay should be HEIGHT pixels tall
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3109 but that the idea of the actual height of the frame should not be changed.
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3110 */
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3111 (frame, height, pretend))
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3112 {
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
3113 /* This can call Lisp. */
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3114 struct frame *f = decode_frame (frame);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3115 int pwidth, pheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3116 int guwidth, guheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3117
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3118 CHECK_INT (height);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3119 pheight = XINT (height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3120 pwidth = FRAME_PIXWIDTH (f);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3121 frame_conversion_internal (f, SIZE_TOTAL_PIXEL, pwidth, pheight,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3122 SIZE_FRAME_UNIT, &guwidth, &guheight);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3123 internal_set_frame_size (f, guwidth, guheight, !NILP (pretend));
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3124 return wrap_frame (f);
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3125 }
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3126
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3127 DEFUN ("set-frame-displayable-pixel-height", Fset_frame_displayable_pixel_height, 2, 3, 0, /*
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3128 Specify that the displayable area of frame FRAME is HEIGHT pixels tall.
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3129 Optional third arg non-nil means that redisplay should be HEIGHT pixels tall
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3130 but that the idea of the actual height of the frame should not be changed.
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3131 */
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3132 (frame, height, pretend))
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3133 {
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
3134 /* This can call Lisp. */
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3135 struct frame *f = decode_frame (frame);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3136 int pwidth, pheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3137 int guwidth, guheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3138
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3139 CHECK_INT (height);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3140 get_frame_displayable_pixel_size (f, &pwidth, &pheight);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3141 pheight = XINT (height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3142 frame_conversion_internal (f, SIZE_DISPLAYABLE_PIXEL, pwidth, pheight,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3143 SIZE_FRAME_UNIT, &guwidth, &guheight);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3144 internal_set_frame_size (f, guwidth, guheight, !NILP (pretend));
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3145 return wrap_frame (f);
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3146 }
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3147
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3148
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3149 DEFUN ("set-frame-width", Fset_frame_width, 2, 3, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3150 Specify that the frame FRAME has COLS columns.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3151 Optional third arg non-nil means that redisplay should use COLS columns
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3152 but that the idea of the actual width of the frame should not be changed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3153 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3154 (frame, cols, pretend))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3155 {
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
3156 /* This can call Lisp. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3157 struct frame *f = decode_frame (frame);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3158 int cwidth, cheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3159 int guwidth, guheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3160
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3161 CHECK_INT (cols);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3162 get_frame_char_size (f, &cwidth, &cheight);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3163 cwidth = XINT (cols);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3164 frame_conversion_internal (f, SIZE_CHAR_CELL, cwidth, cheight,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3165 SIZE_FRAME_UNIT, &guwidth, &guheight);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3166 internal_set_frame_size (f, guwidth, guheight, !NILP (pretend));
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3167 return wrap_frame (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3168 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3169
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3170 DEFUN ("set-frame-pixel-width", Fset_frame_pixel_width, 2, 3, 0, /*
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3171 Specify that the frame FRAME is a total of WIDTH pixels wide.
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3172 Optional third arg non-nil means that redisplay should be WIDTH wide
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3173 but that the idea of the actual height of the frame should not be changed.
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3174 */
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3175 (frame, width, pretend))
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3176 {
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
3177 /* This can call Lisp. */
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3178 struct frame *f = decode_frame (frame);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3179 int pwidth, pheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3180 int guwidth, guheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3181
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3182 CHECK_INT (width);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3183 pwidth = XINT (width);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3184 pheight = FRAME_PIXHEIGHT (f);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3185 frame_conversion_internal (f, SIZE_TOTAL_PIXEL, pwidth, pheight,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3186 SIZE_FRAME_UNIT, &guwidth, &guheight);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3187 internal_set_frame_size (f, guwidth, guheight, !NILP (pretend));
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3188 return wrap_frame (f);
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3189 }
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3190
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3191 DEFUN ("set-frame-displayable-pixel-width", Fset_frame_displayable_pixel_width, 2, 3, 0, /*
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3192 Specify that the displayable area of frame FRAME is WIDTH pixels wide.
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3193 Optional third arg non-nil means that redisplay should be WIDTH wide
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3194 but that the idea of the actual height of the frame should not be changed.
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3195 */
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3196 (frame, width, pretend))
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3197 {
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
3198 /* This can call Lisp. */
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3199 struct frame *f = decode_frame (frame);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3200 int pwidth, pheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3201 int guwidth, guheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3202
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3203 CHECK_INT (width);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3204 get_frame_displayable_pixel_size (f, &pwidth, &pheight);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3205 pwidth = XINT (width);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3206 frame_conversion_internal (f, SIZE_DISPLAYABLE_PIXEL, pwidth, pheight,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3207 SIZE_FRAME_UNIT, &guwidth, &guheight);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3208 internal_set_frame_size (f, guwidth, guheight, !NILP (pretend));
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3209 return wrap_frame (f);
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3210 }
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3211
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3212 DEFUN ("set-frame-size", Fset_frame_size, 3, 4, 0, /*
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
3213 Set the size of FRAME to COLS by ROWS, measured in characters.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3214 Optional fourth arg non-nil means that redisplay should use COLS by ROWS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3215 but that the idea of the actual size of the frame should not be changed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3216 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3217 (frame, cols, rows, pretend))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3218 {
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
3219 /* This can call Lisp. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3220 struct frame *f = decode_frame (frame);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3221 int guwidth, guheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3222
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3223 CHECK_INT (cols);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3224 CHECK_INT (rows);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3225 frame_conversion_internal (f, SIZE_CHAR_CELL, XINT (cols), XINT (rows),
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3226 SIZE_FRAME_UNIT, &guwidth, &guheight);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3227 internal_set_frame_size (f, guwidth, guheight, !NILP (pretend));
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3228 return wrap_frame (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3229 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3230
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3231 DEFUN ("set-frame-pixel-size", Fset_frame_pixel_size, 3, 4, 0, /*
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3232 Set the total size of FRAME to WIDTH by HEIGHT, measured in pixels.
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3233 Optional fourth arg non-nil means that redisplay should use WIDTH by HEIGHT
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3234 but that the idea of the actual size of the frame should not be changed.
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3235 */
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3236 (frame, width, height, pretend))
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3237 {
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
3238 /* This can call Lisp. */
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3239 struct frame *f = decode_frame (frame);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3240 int guwidth, guheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3241
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3242 CHECK_INT (width);
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3243 CHECK_INT (height);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3244 frame_conversion_internal (f, SIZE_TOTAL_PIXEL, XINT (width), XINT (height),
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3245 SIZE_FRAME_UNIT, &guwidth, &guheight);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3246 internal_set_frame_size (f, guwidth, guheight, !NILP (pretend));
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3247 return wrap_frame (f);
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3248 }
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3249
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3250 DEFUN ("set-frame-displayable-pixel-size", Fset_frame_displayable_pixel_size, 3, 4, 0, /*
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3251 Set the displayable size of FRAME to WIDTH by HEIGHT, measured in pixels.
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3252 Optional fourth arg non-nil means that redisplay should use WIDTH by HEIGHT
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3253 but that the idea of the actual size of the frame should not be changed.
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3254 */
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3255 (frame, width, height, pretend))
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3256 {
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
3257 /* This can call Lisp. */
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3258 struct frame *f = decode_frame (frame);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3259 int guwidth, guheight;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3260
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3261 CHECK_INT (width);
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3262 CHECK_INT (height);
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3263 frame_conversion_internal (f, SIZE_DISPLAYABLE_PIXEL,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3264 XINT (width), XINT (height),
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3265 SIZE_FRAME_UNIT, &guwidth, &guheight);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3266 internal_set_frame_size (f, guwidth, guheight, !NILP (pretend));
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3267 return wrap_frame (f);
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3268 }
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3269
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3270 DEFUN ("set-frame-position", Fset_frame_position, 3, 3, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3271 Set position of FRAME in pixels to XOFFSET by YOFFSET.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3272 This is actually the position of the upper left corner of the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3273 Negative values for XOFFSET or YOFFSET are interpreted relative to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3274 the rightmost or bottommost possible position (that stays within the screen).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3275 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3276 (frame, xoffset, yoffset))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3277 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3278 struct frame *f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3279 CHECK_INT (xoffset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3280 CHECK_INT (yoffset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3281
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3282 MAYBE_FRAMEMETH (f, set_frame_position, (f, XINT (xoffset), XINT (yoffset)));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3283
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3284 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3285 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3286
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3287
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3288
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3289 /* Frame size conversion functions moved here from EmacsFrame.c
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3290 because they're generic and really don't belong in that file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3291 Function get_default_char_pixel_size() removed because it's
5047
07dcc7000bbf put width before height consistently, fix a real bug found in the process
Ben Wing <ben@xemacs.org>
parents: 5046
diff changeset
3292 exactly the same as default_face_width_and_height().
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3293
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3294 Convert between total pixel size, displayable pixel size and
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3295 character-cell size. Variables are either "in" or "out"
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3296 depending on the value of PIXEL_TO_CHAR.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3297 */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3298 static void
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3299 frame_conversion_internal_1 (struct frame *f,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3300 pixel_to_char_mode_t pixel_to_char,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3301 int *total_pixel_width, int *total_pixel_height,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3302 int *disp_pixel_width, int *disp_pixel_height,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3303 int *char_width, int *char_height)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3304 {
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3305 int cpw, cph;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3306 int egw;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3307 int obw, obh, bdr;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3308 Lisp_Object frame, window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3309
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
3310 frame = wrap_frame (f);
5047
07dcc7000bbf put width before height consistently, fix a real bug found in the process
Ben Wing <ben@xemacs.org>
parents: 5046
diff changeset
3311 default_face_width_and_height (frame, &cpw, &cph);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3312
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3313 window = FRAME_SELECTED_WINDOW (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3314
5045
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3315 /* #### It really seems like we should also be subtracting out the
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3316 theoretical gutter width and height, just like we do for toolbars.
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3317 There is currently a bug where if you call `set-frame-pixel-width'
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3318 on MS Windows (at least, possibly also X) things get confused and
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3319 the top of the root window overlaps the top gutter instead of being
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3320 below it. This gets fixed next time you resize the frame using the
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3321 mouse. Possibly this is caused by not handling the gutter height
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3322 here? */
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3323 egw = max (glyph_width (Vcontinuation_glyph, window),
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3324 glyph_width (Vtruncation_glyph, window));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3325 egw = max (egw, cpw);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3326 bdr = 2 * f->internal_border_width;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3327 obw = FRAME_SCROLLBAR_WIDTH (f) + FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH (f) +
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3328 FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH (f) +
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3329 2 * FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH (f) +
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3330 2 * FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3331 obh = FRAME_SCROLLBAR_HEIGHT (f) + FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT (f) +
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3332 FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT (f) +
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3333 2 * FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH (f) +
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3334 2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3335
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3336 /* Convert to chars so that the displayable area is pixel_width x
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3337 pixel_height.
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3338
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3339 #### Consider rounding up to 0.5 characters to avoid adding too
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3340 much space. */
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3341 switch (pixel_to_char)
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3342 {
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3343 case DISPLAYABLE_PIXEL_TO_CHAR:
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3344 if (char_width)
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3345 *char_width = ROUND_UP (*disp_pixel_width, cpw) / cpw;
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3346 if (char_height)
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3347 *char_height = ROUND_UP (*disp_pixel_height, cph) / cph;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3348 break;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3349 case CHAR_TO_DISPLAYABLE_PIXEL:
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3350 if (disp_pixel_width)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3351 *disp_pixel_width = *char_width * cpw;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3352 if (disp_pixel_height)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3353 *disp_pixel_height = *char_height * cph;
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3354 break;
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3355 case TOTAL_PIXEL_TO_CHAR:
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3356 /* Convert to chars so that the total frame size is pixel_width x
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3357 pixel_height. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3358 if (char_width)
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3359 *char_width = 1 + ((*total_pixel_width - egw) - bdr - obw) / cpw;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3360 if (char_height)
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3361 *char_height = (*total_pixel_height - bdr - obh) / cph;
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3362 break;
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3363 case CHAR_TO_TOTAL_PIXEL:
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3364 if (total_pixel_width)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3365 *total_pixel_width = (*char_width - 1) * cpw + egw + bdr + obw;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3366 if (total_pixel_height)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3367 *total_pixel_height = *char_height * cph + bdr + obh;
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3368 break;
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3369 case TOTAL_PIXEL_TO_DISPLAYABLE_PIXEL:
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3370 /* Convert to chars so that the total frame size is pixel_width x
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3371 pixel_height. */
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3372 if (disp_pixel_width)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3373 *disp_pixel_width = cpw + (*total_pixel_width - egw) - bdr - obw;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3374 if (disp_pixel_height)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3375 *disp_pixel_height = *total_pixel_height - bdr - obh;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3376 break;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3377 case DISPLAYABLE_PIXEL_TO_TOTAL_PIXEL:
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3378 if (total_pixel_width)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3379 *total_pixel_width = *disp_pixel_width - cpw + egw + bdr + obw;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3380 if (total_pixel_height)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3381 *total_pixel_height = *disp_pixel_height + bdr + obh;
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3382 break;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3383 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3384 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3385
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3386
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3387 static enum frame_size_type
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3388 canonicalize_frame_size_type (enum frame_size_type type, int pixgeom)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3389 {
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3390 if (type == SIZE_FRAME_UNIT)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3391 {
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3392 if (pixgeom)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3393 type = SIZE_DISPLAYABLE_PIXEL;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3394 else
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3395 type = SIZE_CHAR_CELL;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3396 }
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3397 return type;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3398 }
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3399
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3400 /* Basic frame conversion function. Convert source size to destination
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3401 size, where either of them can be in total pixels, displayable pixels,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3402 frame units or character-cell units. */
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3403
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3404 static void
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3405 frame_conversion_internal (struct frame *f,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3406 enum frame_size_type source,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3407 int source_width, int source_height,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3408 enum frame_size_type dest,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3409 int *dest_width, int *dest_height)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3410 {
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3411 int pixgeom = window_system_pixelated_geometry (wrap_frame (f));
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3412 dest = canonicalize_frame_size_type (dest, pixgeom);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3413 source = canonicalize_frame_size_type (source, pixgeom);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3414 if (source == dest)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3415 {
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3416 *dest_width = source_width;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3417 *dest_height = source_height;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3418 }
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3419 else if (source == SIZE_TOTAL_PIXEL && dest == SIZE_CHAR_CELL)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3420 frame_conversion_internal_1 (f, TOTAL_PIXEL_TO_CHAR,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3421 &source_width, &source_height, 0, 0,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3422 dest_width, dest_height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3423 else if (source == SIZE_DISPLAYABLE_PIXEL && dest == SIZE_CHAR_CELL)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3424 frame_conversion_internal_1 (f, DISPLAYABLE_PIXEL_TO_CHAR, 0, 0,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3425 &source_width, &source_height,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3426 dest_width, dest_height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3427 else if (source == SIZE_TOTAL_PIXEL && dest == SIZE_DISPLAYABLE_PIXEL)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3428 frame_conversion_internal_1 (f, TOTAL_PIXEL_TO_DISPLAYABLE_PIXEL,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3429 &source_width, &source_height,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3430 dest_width, dest_height, 0, 0);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3431 else if (dest == SIZE_TOTAL_PIXEL && source == SIZE_CHAR_CELL)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3432 frame_conversion_internal_1 (f, CHAR_TO_TOTAL_PIXEL,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3433 dest_width, dest_height, 0, 0,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3434 &source_width, &source_height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3435 else if (dest == SIZE_DISPLAYABLE_PIXEL && source == SIZE_CHAR_CELL)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3436 frame_conversion_internal_1 (f, CHAR_TO_DISPLAYABLE_PIXEL, 0, 0,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3437 dest_width, dest_height,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3438 &source_width, &source_height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3439 else if (dest == SIZE_TOTAL_PIXEL && source == SIZE_DISPLAYABLE_PIXEL)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3440 frame_conversion_internal_1 (f, DISPLAYABLE_PIXEL_TO_TOTAL_PIXEL,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3441 dest_width, dest_height,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3442 &source_width, &source_height, 0, 0);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3443 else
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3444 {
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3445 ABORT ();
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3446 if (dest_width)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3447 *dest_width = 0;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3448 if (dest_height)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3449 *dest_height = 0;
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3450 }
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3451 }
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3452
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3453 /* This takes the size in pixels of the client area, and returns the number
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3454 of characters that will fit there, taking into account the internal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3455 border width, and the pixel width of the line terminator glyphs (which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3456 always count as one "character" wide, even if they are not the same size
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3457 as the default character size of the default font). The frame scrollbar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3458 width and left and right toolbar widths are also subtracted out of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3459 available width. The frame scrollbar height and top and bottom toolbar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3460 heights are subtracted out of the available height.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3461
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3462 Therefore the result is not necessarily a multiple of anything in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3463 particular. */
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3464
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3465 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3466 pixel_to_char_size (struct frame *f, int pixel_width, int pixel_height,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3467 int *char_width, int *char_height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3468 {
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3469 frame_conversion_internal (f, SIZE_TOTAL_PIXEL, pixel_width, pixel_height,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3470 SIZE_CHAR_CELL, char_width, char_height);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3471 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3472
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3473 /* Given a character size, this returns the minimum pixel size of the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3474 client area necessary to display that many characters, taking into
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3475 account the internal border width, scrollbar height and width, toolbar
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3476 heights and widths and the size of the line terminator glyphs (assuming
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3477 the line terminators take up exactly one character position).
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3478
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3479 Therefore the result is not necessarily a multiple of anything in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3480 particular. */
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3481
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3482 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3483 char_to_pixel_size (struct frame *f, int char_width, int char_height,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3484 int *pixel_width, int *pixel_height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3485 {
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3486 frame_conversion_internal (f, SIZE_CHAR_CELL, char_width, char_height,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3487 SIZE_TOTAL_PIXEL, pixel_width, pixel_height);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3488 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3489
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3490 /* Versions of the above that operate in "frame units" instead of
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3491 characters. frame units are the same as characters except on
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3492 MS Windows and MS Printer frames, where they are displayable-area
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3493 pixels. */
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3494
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3495 void
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3496 pixel_to_frame_unit_size (struct frame *f, int pixel_width, int pixel_height,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3497 int *frame_unit_width, int *frame_unit_height)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3498 {
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3499 frame_conversion_internal (f, SIZE_TOTAL_PIXEL, pixel_width, pixel_height,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3500 SIZE_FRAME_UNIT, frame_unit_width,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3501 frame_unit_height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3502 }
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3503
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3504 void
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3505 frame_unit_to_pixel_size (struct frame *f, int frame_unit_width,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3506 int frame_unit_height,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3507 int *pixel_width, int *pixel_height)
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3508 {
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3509 frame_conversion_internal (f, SIZE_FRAME_UNIT, frame_unit_width,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3510 frame_unit_height,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3511 SIZE_TOTAL_PIXEL, pixel_width, pixel_height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3512 }
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3513
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3514 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3515 round_size_to_char (struct frame *f, int in_width, int in_height,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3516 int *out_width, int *out_height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3517 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3518 int char_width;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3519 int char_height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3520 pixel_to_char_size (f, in_width, in_height, &char_width, &char_height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3521 char_to_pixel_size (f, char_width, char_height, out_width, out_height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3522 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3523
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3524 /* Get the frame size in character cells, recalculating on the fly.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3525 #### The logic of this function follows former logic elsewhere,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3526 which used FRAME_PIXWIDTH() on pixelated-geometry systems but
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3527 FRAME_WIDTH() on non-pixelated-geometry systems. Not clear why not
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3528 always just use one or the other.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3529
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3530 Why don't we just use FRAME_CHARWIDTH() etc. in get_frame_char_size()?
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3531 That wouldn't work because change_frame_size_1() depends on the
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3532 following function to *set* the values of FRAME_CHARWIDTH() etc.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3533
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3534 But elsewhere I suppose we could use it.
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3535 */
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3536
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3537 static void
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3538 get_frame_char_size (struct frame *f, int *out_width, int *out_height)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3539 {
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3540 if (window_system_pixelated_geometry (wrap_frame (f)))
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3541 pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f),
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3542 out_width, out_height);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3543 else
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3544 {
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3545 *out_width = FRAME_WIDTH (f);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3546 *out_height = FRAME_HEIGHT (f);
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3547 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3548 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3549
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3550 static void
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3551 get_frame_displayable_pixel_size (struct frame *f, int *out_width,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3552 int *out_height)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3553 {
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3554 frame_conversion_internal (f, SIZE_FRAME_UNIT, FRAME_WIDTH (f),
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3555 FRAME_HEIGHT (f), SIZE_DISPLAYABLE_PIXEL,
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3556 out_width, out_height);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3557 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3558
5045
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3559 /* Change the frame height and/or width. Values passed in are in
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3560 frame units (character cells on X/GTK, displayable-area pixels
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3561 on MS Windows or generally on pixelated-geometry window systems). */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3562 static void
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3563 change_frame_size_1 (struct frame *f, int newwidth, int newheight)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3564 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3565 int new_pixheight, new_pixwidth;
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3566 int real_font_height, real_font_width;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3567
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3568 /* #### Chuck -- shouldn't we be checking to see if the frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3569 is being "changed" to its existing size, and do nothing if so? */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3570 /* No, because it would hose toolbar updates. The toolbar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3571 update code relies on this function to cause window `top' and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3572 `left' coordinates to be recomputed even though no frame size
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3573 change occurs. --kyle */
5050
6f2158fa75ed Fix quick-build, use asserts() in place of ABORT()
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3574 assert (!in_display && !hold_frame_size_changes);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3575
5044
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3576 /* We no longer allow bogus values passed in. */
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3577 assert (newheight && newwidth);
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3578
5047
07dcc7000bbf put width before height consistently, fix a real bug found in the process
Ben Wing <ben@xemacs.org>
parents: 5046
diff changeset
3579 default_face_width_and_height (wrap_frame (f), &real_font_width,
07dcc7000bbf put width before height consistently, fix a real bug found in the process
Ben Wing <ben@xemacs.org>
parents: 5046
diff changeset
3580 &real_font_height);
5044
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3581
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3582 frame_conversion_internal (f, SIZE_FRAME_UNIT, newwidth, newheight,
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3583 SIZE_TOTAL_PIXEL, &new_pixwidth,
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3584 &new_pixheight);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3585
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3586 /* This size-change overrides any pending one for this frame. */
4307
1bdc3bc255a4 [xemacs-hg @ 2007-12-05 08:26:00 by stephent]
stephent
parents: 4207
diff changeset
3587 f->size_change_pending = 0;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3588 FRAME_NEW_HEIGHT (f) = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3589 FRAME_NEW_WIDTH (f) = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3590
5045
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3591 /* We need to remove the boundaries of the paned area (see top of file)
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3592 from the total-area pixel size, which is what we have now.
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3593
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3594 #### We should also be subtracting the internal borders. */
5044
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3595 new_pixheight -=
5045
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3596 (FRAME_REAL_TOP_TOOLBAR_BOUNDS (f)
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3597 + FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS (f)
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3598 + FRAME_TOP_GUTTER_BOUNDS (f)
5044
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3599 + FRAME_BOTTOM_GUTTER_BOUNDS (f));
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3600
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3601 new_pixwidth -=
5045
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3602 (FRAME_REAL_LEFT_TOOLBAR_BOUNDS (f)
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3603 + FRAME_REAL_RIGHT_TOOLBAR_BOUNDS (f)
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3604 + FRAME_LEFT_GUTTER_BOUNDS (f)
5044
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3605 + FRAME_RIGHT_GUTTER_BOUNDS (f));
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3606
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3607 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3608 = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f);
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3609
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3610 if (FRAME_HAS_MINIBUF_P (f)
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3611 && ! FRAME_MINIBUF_ONLY_P (f))
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3612 /* Frame has both root and minibuffer. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3613 {
5044
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3614 /*
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3615 * Leave the minibuffer height the same if the frame has
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3616 * been initialized, and the minibuffer height is tall
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3617 * enough to display at least one line of text in the default
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3618 * font, and the old minibuffer height is a multiple of the
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3619 * default font height. This should cause the minibuffer
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3620 * height to be recomputed on font changes but not for
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3621 * other frame size changes, which seems reasonable.
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3622 */
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3623 int old_minibuf_height =
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3624 XWINDOW(FRAME_MINIBUF_WINDOW(f))->pixel_height;
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3625 int minibuf_height =
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3626 f->init_finished && (old_minibuf_height % real_font_height) == 0 ?
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3627 max(old_minibuf_height, real_font_height) :
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3628 real_font_height;
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3629 set_window_pixheight (FRAME_ROOT_WINDOW (f),
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3630 /* - font_height for minibuffer */
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3631 new_pixheight - minibuf_height, 0);
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3632
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3633 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top =
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3634 FRAME_TOP_BORDER_END (f) +
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3635 FRAME_TOP_GUTTER_BOUNDS (f) +
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3636 FRAME_BOTTOM_GUTTER_BOUNDS (f) +
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3637 new_pixheight - minibuf_height;
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3638
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3639 set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3640 }
5044
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3641 else
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3642 /* Frame has just one top-level window. */
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3643 set_window_pixheight (FRAME_ROOT_WINDOW (f), new_pixheight, 0);
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3644
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3645 FRAME_HEIGHT (f) = newheight;
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3646 if (FRAME_TTY_P (f))
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3647 f->pixheight = newheight;
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3648
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3649 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left =
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3650 FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f);
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3651 set_window_pixwidth (FRAME_ROOT_WINDOW (f), new_pixwidth, 0);
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3652
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3653 if (FRAME_HAS_MINIBUF_P (f))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3654 {
5044
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3655 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_left =
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
3656 FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f);
5044
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3657 set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), new_pixwidth, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3658 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3659
5044
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3660 FRAME_WIDTH (f) = newwidth;
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3661 if (FRAME_TTY_P (f))
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3662 f->pixwidth = newwidth;
e84a30b0e4a2 remove duplicative code in change_frame_size()
Ben Wing <ben@xemacs.org>
parents: 5043
diff changeset
3663
5045
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3664 /* #### On MS Windows, this references FRAME_PIXWIDTH() and FRAME_PIXHEIGHT().
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3665 I'm not sure we can count on those values being set. Instead we should
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3666 use the total pixel size we got near the top by calling
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3667 frame_conversion_internal(). We should inline the logic in
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3668 get_frame_char_size() here and change that function so it just looks
c3cc3fa503a2 more frame-sizing cleanups
Ben Wing <ben@xemacs.org>
parents: 5044
diff changeset
3669 at FRAME_CHARWIDTH() and FRAME_CHARHEIGHT(). */
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3670 get_frame_char_size (f, &FRAME_CHARWIDTH (f), &FRAME_CHARHEIGHT (f));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3671
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3672 MARK_FRAME_TOOLBARS_CHANGED (f);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
3673 MARK_FRAME_GUTTERS_CHANGED (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3674 MARK_FRAME_CHANGED (f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3675 f->echo_area_garbaged = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3676 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3677
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3678 void
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3679 change_frame_size (struct frame *f, int newwidth, int newheight, int delay)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3680 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3681 /* sometimes we get passed a size that's too small (esp. when a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3682 client widget gets resized, since we have no control over this).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3683 So deal. */
5047
07dcc7000bbf put width before height consistently, fix a real bug found in the process
Ben Wing <ben@xemacs.org>
parents: 5046
diff changeset
3684 check_frame_size (f, &newwidth, &newheight);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3685
450
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 444
diff changeset
3686 /* Unconditionally mark that the frame has changed size. This is
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 444
diff changeset
3687 because many things need to know after the
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 444
diff changeset
3688 fact. f->size_change_pending will get reset below. The most that
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 444
diff changeset
3689 can happen is that we will cycle through redisplay once more
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 444
diff changeset
3690 --andy. */
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 444
diff changeset
3691 MARK_FRAME_SIZE_CHANGED (f);
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 444
diff changeset
3692
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
3693 #ifdef NEW_GC
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
3694 if (delay || hold_frame_size_changes)
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
3695 #else /* not NEW_GC */
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 1313
diff changeset
3696 if (delay || hold_frame_size_changes || gc_in_progress)
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
3697 #endif /* not NEW_GC */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3698 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3699 f->new_width = newwidth;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3700 f->new_height = newheight;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3701 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3702 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3703
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3704 /* For TTY frames, it's like one, like all ...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3705 Can't have two TTY frames of different sizes on the same device. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3706 if (FRAME_TTY_P (f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3707 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3708 Lisp_Object frmcons;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3709
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3710 DEVICE_FRAME_LOOP (frmcons, XDEVICE (FRAME_DEVICE (f)))
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3711 change_frame_size_1 (XFRAME (XCAR (frmcons)), newwidth, newheight);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3712 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3713 else
5043
d0c14ea98592 various frame-geometry fixes
Ben Wing <ben@xemacs.org>
parents: 4976
diff changeset
3714 change_frame_size_1 (f, newwidth, newheight);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3715 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3716
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3717
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3718 /* The caller is responsible for freeing the returned string. */
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 863
diff changeset
3719 static Ibyte *
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3720 generate_title_string (struct window *w, Lisp_Object format_str,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3721 face_index findex, int type)
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3722 {
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3723 struct display_line *dl;
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3724 struct display_block *db;
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3725 int elt = 0;
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3726
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3727 dl = &title_string_display_line;
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3728 db = get_display_block_from_line (dl, TEXT);
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3729 Dynarr_reset (db->runes);
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3730
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3731 generate_formatted_string_db (format_str, Qnil, w, dl, db, findex, 0,
4207
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
3732 -1, type);
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3733
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 863
diff changeset
3734 Dynarr_reset (title_string_ichar_dynarr);
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3735 while (elt < Dynarr_length (db->runes))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3736 {
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3737 if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR)
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 863
diff changeset
3738 Dynarr_add (title_string_ichar_dynarr,
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3739 Dynarr_atp (db->runes, elt)->object.chr.ch);
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3740 elt++;
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3741 }
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3742
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3743 return
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 863
diff changeset
3744 convert_ichar_string_into_malloced_string
4967
0d4c9d0f6a8d rewrite dynarr code
Ben Wing <ben@xemacs.org>
parents: 4952
diff changeset
3745 (Dynarr_begin (title_string_ichar_dynarr),
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 863
diff changeset
3746 Dynarr_length (title_string_ichar_dynarr), 0);
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3747 }
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3748
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3749 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3750 update_frame_title (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3751 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3752 struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3753 Lisp_Object title_format;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3754 Lisp_Object icon_format;
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 863
diff changeset
3755 Ibyte *title;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3756
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3757 /* We don't change the title for the minibuffer unless the frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3758 only has a minibuffer. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3759 if (MINI_WINDOW_P (w) && !FRAME_MINIBUF_ONLY_P (f))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3760 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3761
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3762 /* And we don't want dead buffers to blow up on us. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3763 if (!BUFFER_LIVE_P (XBUFFER (w->buffer)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3764 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3765
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3766 title = NULL;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3767 title_format = symbol_value_in_buffer (Qframe_title_format, w->buffer);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3768 icon_format = symbol_value_in_buffer (Qframe_icon_title_format, w->buffer);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3769
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 863
diff changeset
3770 if (HAS_FRAMEMETH_P (f, set_title_from_ibyte))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3771 {
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3772 title = generate_title_string (w, title_format,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3773 DEFAULT_INDEX, CURRENT_DISP);
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 863
diff changeset
3774 FRAMEMETH (f, set_title_from_ibyte, (f, title));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3775 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3776
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 863
diff changeset
3777 if (HAS_FRAMEMETH_P (f, set_icon_name_from_ibyte))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3778 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3779 if (!EQ (icon_format, title_format) || !title)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3780 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3781 if (title)
4976
16112448d484 Rename xfree(FOO, TYPE) -> xfree(FOO)
Ben Wing <ben@xemacs.org>
parents: 4968
diff changeset
3782 xfree (title);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3783
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3784 title = generate_title_string (w, icon_format,
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3785 DEFAULT_INDEX, CURRENT_DISP);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3786 }
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 863
diff changeset
3787 FRAMEMETH (f, set_icon_name_from_ibyte, (f, title));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3788 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3789
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3790 if (title)
4976
16112448d484 Rename xfree(FOO, TYPE) -> xfree(FOO)
Ben Wing <ben@xemacs.org>
parents: 4968
diff changeset
3791 xfree (title);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3792 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3793
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3794
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3795 DEFUN ("set-frame-pointer", Fset_frame_pointer, 2, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3796 Set the mouse pointer of FRAME to the given pointer image instance.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3797 You should not call this function directly. Instead, set one of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3798 the variables `text-pointer-glyph', `nontext-pointer-glyph',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3799 `modeline-pointer-glyph', `selection-pointer-glyph',
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3800 `busy-pointer-glyph', or `toolbar-pointer-glyph'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3801 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3802 (frame, image_instance))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3803 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3804 struct frame *f = decode_frame (frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3805 CHECK_POINTER_IMAGE_INSTANCE (image_instance);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3806 if (!EQ (f->pointer, image_instance))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3807 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3808 f->pointer = image_instance;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3809 MAYBE_FRAMEMETH (f, set_frame_pointer, (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3810 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3811 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3812 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3813
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3814
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3815 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3816 update_frame_icon (struct frame *f)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3817 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3818 if (f->icon_changed || f->windows_changed)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3819 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3820 Lisp_Object frame;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3821 Lisp_Object new_icon;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3822
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
3823 frame = wrap_frame (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3824 new_icon = glyph_image_instance (Vframe_icon_glyph, frame,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3825 ERROR_ME_WARN, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3826 if (!EQ (new_icon, f->icon))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3827 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3828 f->icon = new_icon;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3829 MAYBE_FRAMEMETH (f, set_frame_icon, (f));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3830 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3831 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3832
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3833 f->icon_changed = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3834 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3835
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3836 static void
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 1726
diff changeset
3837 icon_glyph_changed (Lisp_Object UNUSED (glyph), Lisp_Object UNUSED (property),
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 1726
diff changeset
3838 Lisp_Object UNUSED (locale))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3839 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3840 MARK_ICON_CHANGED;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3841 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3842
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3843
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3844 /***************************************************************************/
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3845 /* */
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3846 /* initialization */
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3847 /* */
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3848 /***************************************************************************/
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3849
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3850 void
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3851 init_frame (void)
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3852 {
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3853 #ifndef PDUMP
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3854 if (!initialized)
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3855 #endif
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3856 {
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 863
diff changeset
3857 title_string_ichar_dynarr = Dynarr_new (Ichar);
4207
62d532188a28 [xemacs-hg @ 2007-10-03 10:06:39 by didierv]
didierv
parents: 3577
diff changeset
3858 DISPLAY_LINE_INIT (title_string_display_line);
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3859 }
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3860 }
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
3861
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3862 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3863 syms_of_frame (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3864 {
5117
3742ea8250b5 Checking in final CVS version of workspace 'ben-lisp-object'
Ben Wing <ben@xemacs.org>
parents: 3025
diff changeset
3865 INIT_LISP_OBJECT (frame);
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
3866 #ifdef NEW_GC
5118
e0db3c197671 merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents: 5117 4790
diff changeset
3867 INIT_LISP_OBJECT (expose_ignore);
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 3025
diff changeset
3868 #endif /* NEW_GC */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
3869
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3870 DEFSYMBOL (Qdelete_frame_hook);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3871 DEFSYMBOL (Qselect_frame_hook);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3872 DEFSYMBOL (Qdeselect_frame_hook);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3873 DEFSYMBOL (Qcreate_frame_hook);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3874 DEFSYMBOL (Qcustom_initialize_frame);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3875 DEFSYMBOL (Qmouse_enter_frame_hook);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3876 DEFSYMBOL (Qmouse_leave_frame_hook);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3877 DEFSYMBOL (Qmap_frame_hook);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3878 DEFSYMBOL (Qunmap_frame_hook);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3879
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3880 DEFSYMBOL (Qframep);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3881 DEFSYMBOL (Qframe_live_p);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3882 DEFSYMBOL (Qdelete_frame);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3883 DEFSYMBOL (Qsynchronize_minibuffers);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3884 DEFSYMBOL (Qbuffer_predicate);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3885 DEFSYMBOL (Qframe_being_created);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3886 DEFSYMBOL (Qmake_initial_minibuffer_frame);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3887
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3888 DEFSYMBOL (Qframe_title_format);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3889 DEFSYMBOL (Qframe_icon_title_format);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3890
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3891 DEFSYMBOL (Qhidden);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3892 DEFSYMBOL (Qvisible);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3893 DEFSYMBOL (Qiconic);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3894 DEFSYMBOL (Qinvisible);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3895 DEFSYMBOL (Qvisible_iconic);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3896 DEFSYMBOL (Qinvisible_iconic);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3897 DEFSYMBOL (Qnomini);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3898 DEFSYMBOL (Qvisible_nomini);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3899 DEFSYMBOL (Qiconic_nomini);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3900 DEFSYMBOL (Qinvisible_nomini);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3901 DEFSYMBOL (Qvisible_iconic_nomini);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3902 DEFSYMBOL (Qinvisible_iconic_nomini);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3903
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3904 DEFSYMBOL (Qminibuffer);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3905 DEFSYMBOL (Qunsplittable);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3906 DEFSYMBOL (Qinternal_border_width);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3907 DEFSYMBOL (Qtop_toolbar_shadow_color);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3908 DEFSYMBOL (Qbottom_toolbar_shadow_color);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3909 DEFSYMBOL (Qbackground_toolbar_color);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3910 DEFSYMBOL (Qtop_toolbar_shadow_pixmap);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3911 DEFSYMBOL (Qbottom_toolbar_shadow_pixmap);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3912 DEFSYMBOL (Qtoolbar_shadow_thickness);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3913 DEFSYMBOL (Qscrollbar_placement);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3914 DEFSYMBOL (Qinter_line_space);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3915 /* Qiconic already in this function. */
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3916 DEFSYMBOL (Qvisual_bell);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3917 DEFSYMBOL (Qbell_volume);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3918 DEFSYMBOL (Qpointer_background);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3919 DEFSYMBOL (Qpointer_color);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3920 DEFSYMBOL (Qtext_pointer);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3921 DEFSYMBOL (Qspace_pointer);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3922 DEFSYMBOL (Qmodeline_pointer);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3923 DEFSYMBOL (Qgc_pointer);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3924 DEFSYMBOL (Qinitially_unmapped);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3925 DEFSYMBOL (Quse_backing_store);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3926 DEFSYMBOL (Qborder_color);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3927 DEFSYMBOL (Qborder_width);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3928 /* Qwidth, Qheight, Qleft, Qtop in general.c */
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3929 DEFSYMBOL (Qset_specifier);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3930 DEFSYMBOL (Qset_face_property);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3931 DEFSYMBOL (Qface_property_instance);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 558
diff changeset
3932 DEFSYMBOL (Qframe_property_alias);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3933
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3934 DEFSUBR (Fmake_frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3935 DEFSUBR (Fframep);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3936 DEFSUBR (Fframe_live_p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3937 #if 0 /* FSFmacs */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3938 DEFSUBR (Fignore_event);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3939 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3940 DEFSUBR (Ffocus_frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3941 DEFSUBR (Fselect_frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3942 DEFSUBR (Fselected_frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3943 DEFSUBR (Factive_minibuffer_window);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3944 DEFSUBR (Flast_nonminibuf_frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3945 DEFSUBR (Fframe_root_window);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3946 DEFSUBR (Fframe_selected_window);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3947 DEFSUBR (Fset_frame_selected_window);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3948 DEFSUBR (Fframe_device);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3949 DEFSUBR (Fnext_frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3950 DEFSUBR (Fprevious_frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3951 DEFSUBR (Fdelete_frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3952 DEFSUBR (Fmouse_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3953 DEFSUBR (Fmouse_pixel_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3954 DEFSUBR (Fmouse_position_as_motion_event);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3955 DEFSUBR (Fset_mouse_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3956 DEFSUBR (Fset_mouse_pixel_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3957 DEFSUBR (Fmake_frame_visible);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3958 DEFSUBR (Fmake_frame_invisible);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3959 DEFSUBR (Ficonify_frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3960 DEFSUBR (Fdeiconify_frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3961 DEFSUBR (Fframe_visible_p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3962 DEFSUBR (Fframe_totally_visible_p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3963 DEFSUBR (Fframe_iconified_p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3964 DEFSUBR (Fvisible_frame_list);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3965 DEFSUBR (Fraise_frame);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3966 DEFSUBR (Flower_frame);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
3967 DEFSUBR (Fdisable_frame);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
3968 DEFSUBR (Fenable_frame);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3969 DEFSUBR (Fframe_property);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3970 DEFSUBR (Fframe_properties);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3971 DEFSUBR (Fset_frame_properties);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3972 DEFSUBR (Fframe_pixel_height);
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3973 DEFSUBR (Fframe_displayable_pixel_height);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3974 DEFSUBR (Fframe_pixel_width);
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3975 DEFSUBR (Fframe_displayable_pixel_width);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3976 DEFSUBR (Fframe_name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3977 DEFSUBR (Fframe_modified_tick);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3978 DEFSUBR (Fset_frame_height);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3979 DEFSUBR (Fset_frame_width);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3980 DEFSUBR (Fset_frame_size);
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3981 DEFSUBR (Fset_frame_pixel_height);
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3982 DEFSUBR (Fset_frame_displayable_pixel_height);
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3983 DEFSUBR (Fset_frame_pixel_width);
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3984 DEFSUBR (Fset_frame_displayable_pixel_width);
863
42375619fa45 [xemacs-hg @ 2002-06-04 06:03:59 by andyp]
andyp
parents: 853
diff changeset
3985 DEFSUBR (Fset_frame_pixel_size);
1125
ecb17ab2f7ab [xemacs-hg @ 2002-11-28 12:30:09 by michaels]
michaels
parents: 1123
diff changeset
3986 DEFSUBR (Fset_frame_displayable_pixel_size);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3987 DEFSUBR (Fset_frame_position);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3988 DEFSUBR (Fset_frame_pointer);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
3989 DEFSUBR (Fprint_job_page_number);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
3990 DEFSUBR (Fprint_job_eject_page);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3991 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3992
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3993 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3994 vars_of_frame (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3995 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3996 /* */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3997 Vframe_being_created = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3998 staticpro (&Vframe_being_created);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3999
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4000 #ifdef HAVE_CDE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4001 Fprovide (intern ("cde"));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4002 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4003
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4004 #if 0 /* FSFmacs stupidity */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4005 xxDEFVAR_LISP ("emacs-iconified", &Vemacs_iconified /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4006 Non-nil if all of emacs is iconified and frame updates are not needed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4007 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4008 Vemacs_iconified = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4009 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4010
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4011 DEFVAR_LISP ("select-frame-hook", &Vselect_frame_hook /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4012 Function or functions to run just after a new frame is given the focus.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4013 Note that calling `select-frame' does not necessarily set the focus:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4014 The actual window-system focus will not be changed until the next time
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4015 that XEmacs is waiting for an event, and even then, the window manager
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4016 may refuse the focus-change request.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4017 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4018 Vselect_frame_hook = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4019
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4020 DEFVAR_LISP ("deselect-frame-hook", &Vdeselect_frame_hook /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4021 Function or functions to run just before a frame loses the focus.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4022 See `select-frame-hook'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4023 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4024 Vdeselect_frame_hook = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4025
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4026 DEFVAR_LISP ("delete-frame-hook", &Vdelete_frame_hook /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4027 Function or functions to call when a frame is deleted.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4028 One argument, the about-to-be-deleted frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4029 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4030 Vdelete_frame_hook = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4031
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4032 DEFVAR_LISP ("create-frame-hook", &Vcreate_frame_hook /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4033 Function or functions to call when a frame is created.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4034 One argument, the newly-created frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4035 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4036 Vcreate_frame_hook = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4037
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4038 DEFVAR_LISP ("mouse-enter-frame-hook", &Vmouse_enter_frame_hook /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4039 Function or functions to call when the mouse enters a frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4040 One argument, the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4041 Be careful not to make assumptions about the window manager's focus model.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4042 In most cases, the `deselect-frame-hook' is more appropriate.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4043 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4044 Vmouse_enter_frame_hook = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4045
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4046 DEFVAR_LISP ("mouse-leave-frame-hook", &Vmouse_leave_frame_hook /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4047 Function or functions to call when the mouse leaves a frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4048 One argument, the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4049 Be careful not to make assumptions about the window manager's focus model.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4050 In most cases, the `select-frame-hook' is more appropriate.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4051 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4052 Vmouse_leave_frame_hook = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4053
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4054 DEFVAR_LISP ("map-frame-hook", &Vmap_frame_hook /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4055 Function or functions to call when a frame is mapped.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4056 One argument, the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4057 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4058 Vmap_frame_hook = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4059
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4060 DEFVAR_LISP ("unmap-frame-hook", &Vunmap_frame_hook /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4061 Function or functions to call when a frame is unmapped.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4062 One argument, the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4063 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4064 Vunmap_frame_hook = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4065
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4066 DEFVAR_BOOL ("allow-deletion-of-last-visible-frame",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4067 &allow_deletion_of_last_visible_frame /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4068 *Non-nil means to assume the force option to delete-frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4069 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4070 allow_deletion_of_last_visible_frame = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4071
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4072 DEFVAR_LISP ("adjust-frame-function", &Vadjust_frame_function /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4073 Function or constant controlling adjustment of frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4074 When scrollbars, toolbars, default font etc. change in frame, the frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4075 needs to be adjusted. The adjustment is controlled by this variable.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4076 Legal values are:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4077 nil to keep character frame size unchanged when possible (resize)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4078 t to keep pixel size unchanged (never resize)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4079 function symbol or lambda form. This function must return boolean
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4080 value which is treated as above. Function is passed one parameter,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4081 the frame being adjusted. It function should not modify or delete
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4082 the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4083 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4084 Vadjust_frame_function = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4085
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4086 DEFVAR_LISP ("mouse-motion-handler", &Vmouse_motion_handler /*
3577
91950589598c [xemacs-hg @ 2006-08-29 14:10:51 by stephent]
stephent
parents: 3092
diff changeset
4087 Handler for motion events. Must be a function taking one argument, the event.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4088 For most applications, you should use `mode-motion-hook' instead of this.
3577
91950589598c [xemacs-hg @ 2006-08-29 14:10:51 by stephent]
stephent
parents: 3092
diff changeset
4089 The default value is `default-mouse-motion-handler'.
91950589598c [xemacs-hg @ 2006-08-29 14:10:51 by stephent]
stephent
parents: 3092
diff changeset
4090
91950589598c [xemacs-hg @ 2006-08-29 14:10:51 by stephent]
stephent
parents: 3092
diff changeset
4091 Note that this is NOT a hook variable, so there is no standard way to remove
91950589598c [xemacs-hg @ 2006-08-29 14:10:51 by stephent]
stephent
parents: 3092
diff changeset
4092 actions from it. Instead, when adding a new kind of action, a hook variable
91950589598c [xemacs-hg @ 2006-08-29 14:10:51 by stephent]
stephent
parents: 3092
diff changeset
4093 should be defined and initialized to the current value of this variable, then
91950589598c [xemacs-hg @ 2006-08-29 14:10:51 by stephent]
stephent
parents: 3092
diff changeset
4094 this variable set to a function that runs the new hook. To disable the new
91950589598c [xemacs-hg @ 2006-08-29 14:10:51 by stephent]
stephent
parents: 3092
diff changeset
4095 actions, use `remove-hook' rather than setting `mouse-motion-handler'.
91950589598c [xemacs-hg @ 2006-08-29 14:10:51 by stephent]
stephent
parents: 3092
diff changeset
4096
91950589598c [xemacs-hg @ 2006-08-29 14:10:51 by stephent]
stephent
parents: 3092
diff changeset
4097 `mouse-motion-hook' in the balloon-help library exemplifies this pattern.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4098 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4099 Vmouse_motion_handler = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4100
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4101 DEFVAR_LISP ("synchronize-minibuffers",&Vsynchronize_minibuffers /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4102 Set to t if all minibuffer windows are to be synchronized.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4103 This will cause echo area messages to appear in the minibuffers of all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4104 visible frames.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4105 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4106 Vsynchronize_minibuffers = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4107
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4108 DEFVAR_LISP ("frame-title-format", &Vframe_title_format /*
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
4109 Controls the title of the window-system window of the selected frame.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4110 This is the same format as `modeline-format' with the exception that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4111 %- is ignored.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4112 */ );
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
4113 /* #### I would change this unilaterally but for the wrath of the Kyles
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
4114 of the world. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
4115 #ifdef WIN32_NATIVE
4952
19a72041c5ed Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents: 4846
diff changeset
4116 Vframe_title_format = build_ascstring ("%b - XEmacs");
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
4117 #else
4952
19a72041c5ed Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents: 4846
diff changeset
4118 Vframe_title_format = build_ascstring ("%S: %b");
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
4119 #endif
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4120
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4121 DEFVAR_LISP ("frame-icon-title-format", &Vframe_icon_title_format /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4122 Controls the title of the icon corresponding to the selected frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4123 See also the variable `frame-title-format'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4124 */ );
4952
19a72041c5ed Mule-izing, various fixes related to char * arguments
Ben Wing <ben@xemacs.org>
parents: 4846
diff changeset
4125 Vframe_icon_title_format = build_ascstring ("%b");
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4126
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4127 DEFVAR_LISP ("default-frame-name", &Vdefault_frame_name /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4128 The default name to assign to newly-created frames.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
4129 This can be overridden by arguments to `make-frame'. This must be a string.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
4130 This is used primarily for picking up X resources, and is *not* the title
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
4131 of the frame. (See `frame-title-format'.)
2681
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
4132
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
4133 Previous to 21.5.21, this defaulted to `emacs'; since that release, it has
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
4134 defaulted to `XEmacs'. In the short term you can restore the old default by
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
4135 setting the environment variable USE_EMACS_AS_DEFAULT_APPLICATION_CLASS
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
4136 (which does affect the frame name, despite what it's called) to some value
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
4137 before starting XEmacs, but this is deprecated.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4138 */ );
2681
f15523a6da7a [xemacs-hg @ 2005-03-24 12:17:51 by aidan]
aidan
parents: 2552
diff changeset
4139 Vdefault_frame_name = Qnil;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4140
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4141 DEFVAR_LISP ("default-frame-plist", &Vdefault_frame_plist /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4142 Plist of default values for frame creation, other than the first one.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4143 These may be set in your init file, like this:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4144
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4145 \(setq default-frame-plist '(width 80 height 55))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4146
2747
0882ede40b55 [xemacs-hg @ 2005-04-27 09:01:43 by stephent]
stephent
parents: 2720
diff changeset
4147 Predefined properties are described in `set-frame-properties'.
0882ede40b55 [xemacs-hg @ 2005-04-27 09:01:43 by stephent]
stephent
parents: 2720
diff changeset
4148
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4149 The properties may be in alist format for backward compatibility
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4150 but you should not rely on this behavior.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4151
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4152 These override values given in window system configuration data,
2747
0882ede40b55 [xemacs-hg @ 2005-04-27 09:01:43 by stephent]
stephent
parents: 2720
diff changeset
4153 including X Windows' defaults database.
0882ede40b55 [xemacs-hg @ 2005-04-27 09:01:43 by stephent]
stephent
parents: 2720
diff changeset
4154
0882ede40b55 [xemacs-hg @ 2005-04-27 09:01:43 by stephent]
stephent
parents: 2720
diff changeset
4155 Values for the first Emacs frame are taken from `initial-frame-plist'.
0882ede40b55 [xemacs-hg @ 2005-04-27 09:01:43 by stephent]
stephent
parents: 2720
diff changeset
4156 Since the first X frame is created before loading your .emacs file, you
0882ede40b55 [xemacs-hg @ 2005-04-27 09:01:43 by stephent]
stephent
parents: 2720
diff changeset
4157 may wish use the X resource database to avoid flashing.
0882ede40b55 [xemacs-hg @ 2005-04-27 09:01:43 by stephent]
stephent
parents: 2720
diff changeset
4158
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4159 For values specific to the separate minibuffer frame, see
2747
0882ede40b55 [xemacs-hg @ 2005-04-27 09:01:43 by stephent]
stephent
parents: 2720
diff changeset
4160 `minibuffer-frame-plist'. See also the variables `default-x-frame-plist'
0882ede40b55 [xemacs-hg @ 2005-04-27 09:01:43 by stephent]
stephent
parents: 2720
diff changeset
4161 and `default-tty-frame-plist', which are like `default-frame-plist'
0882ede40b55 [xemacs-hg @ 2005-04-27 09:01:43 by stephent]
stephent
parents: 2720
diff changeset
4162 except that they apply only to X or tty frames, respectively \(whereas
0882ede40b55 [xemacs-hg @ 2005-04-27 09:01:43 by stephent]
stephent
parents: 2720
diff changeset
4163 `default-frame-plist' applies to all types of frames).
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4164 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4165 Vdefault_frame_plist = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4166
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4167 DEFVAR_LISP ("frame-icon-glyph", &Vframe_icon_glyph /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4168 Icon glyph used to iconify a frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4169 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4170 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4171
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4172 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4173 complex_vars_of_frame (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4174 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4175 Vframe_icon_glyph = allocate_glyph (GLYPH_ICON, icon_glyph_changed);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4176 }