annotate lisp/utils/floating-toolbar.el @ 22:8fc7fe29b841 r19-15b94

Import from CVS: tag r19-15b94
author cvs
date Mon, 13 Aug 2007 08:50:29 +0200
parents
children c53a95d3c46d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
1 ;;; floating-toolbar.el -- popup toolbar support for XEmacs.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
2 ;; Copyright (C) 1997 Kyle E. Jones
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
3
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
4 ;; Author: Kyle Jones <kyle_jones@wonderworks.com>
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
5 ;; Keywords: lisp
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
6
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
7 ;; This file is part of XEmacs.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
8
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
9 ;; XEmacs is free software; you can redistribute it and/or modify
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 1, or (at your option)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
12 ;; any later version.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
13
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
14 ;; XEmacs is distributed in the hope that it will be useful,
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
17 ;; GNU General Public License for more details.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
18
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
19 ;; A copy of the GNU General Public License can be obtained from this
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
20 ;; program's author (send electronic mail to kyle@uunet.uu.net) or from
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
21 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
22 ;; Boston, MA 02111-1307, USA.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
23
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
24 ;;; Commentary:
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
25
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
26 ;; Popup toolbar for XEmacs (probably require XEmacs 19.14 or later)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
27 ;; Send bug reports to kyle_jones@wonderworks.com
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
28
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
29 ;; The command `floating-toolbar' pops up a small frame
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
30 ;; containing a toolbar. The command should be bound to a
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
31 ;; button-press event. If the mouse press happens over an
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
32 ;; extent that has a non-nil 'floating-toolbar property, the
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
33 ;; value of that property is the toolbar instantiator that will
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
34 ;; be displayed. Otherwise the toolbar displayed is taken from
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
35 ;; the variable `floating-toolbar'. This variable can be made
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
36 ;; buffer local to produce buffer local floating toolbars.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
37 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
38 ;; `floating-toolbar-or-popup-mode-menu' works like `floating-toolbar'
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
39 ;; except that if no toolbar is found, `popup-mode-menu' is called.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
40 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
41 ;; `floating-toolbar-from-extent-or-popup-mode-menu' works like
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
42 ;; `floating-toolbar-or-popup-mode-menu' except only extent local
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
43 ;; toolbars are used; the value of floating-toolbar is not used.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
44 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
45 ;; Installation:
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
46 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
47 ;; Byte-compile the file floating-toolbar.el (with M-x byte-compile-file)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
48 ;; and put the .elc file in a directory in your load-path. Add the
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
49 ;; following line to your .emacs:
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
50 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
51 ;; (require 'floating-toolbar)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
52 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
53 ;; You will also need to bind a mouse click to `floating-toolbar' or to
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
54 ;; `floating-toolbar-or-popup-mode-menu'.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
55 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
56 ;; For 19.12 users:
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
57 ;; If you are using fvwm, [tv]twm or ol[v]wm, you can also add
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
58 ;; the following lines to various configuration file to use
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
59 ;; minimal decorations on the toolbar frame.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
60 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
61 ;; In .emacs:
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
62 ;; (setq floating-toolbar-frame-name "floating-toolbar")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
63 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
64 ;; For ol[v]wm use this in .Xdefaults:
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
65 ;; olvwm.NoDecor: floating-toolbar
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
66 ;; or
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
67 ;; olwm.MinimalDecor: floating-toolbar
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
68 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
69 ;; For fvvm use this in your .fvwmrc:
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
70 ;; NoTitle floating-toolbar
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
71 ;; or
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
72 ;; Style "floating-toolbar" NoTitle, NoHandles, BorderWidth 0
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
73 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
74 ;; For twm use this in your .twmrc:
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
75 ;; NoTitle { "floating-toolbar" }
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
76 ;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
77 ;; Under 19.13 and later versions the floating-toolbar frame uses a
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
78 ;; transient window that is not normally decorated by window
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
79 ;; managers. So the window manager directives should not be
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
80 ;; needed for XEmacs 19.13 and beyond.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
81
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
82 ;;; Code:
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
83
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
84 (provide 'floating-toolbar)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
85
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
86 (require 'toolbar)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
87 (require 'x)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
88
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
89 (defvar floating-toolbar-version "1.01"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
90 "Version string for the floating-toolbar package.")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
91
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
92 (defvar floating-toolbar-use-sound nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
93 "*Non-nil value means play a sound to herald the appearance
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
94 and disappearance of the floating toolbar.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
95
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
96 `floating-toolbar-appears' will be played when the toolbar appears.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
97 `floating-toolbar-disappears' will be played when the toolbar disappears.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
98
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
99 See the documentation for the function `load-sound-file' to see how
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
100 define sounds.")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
101
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
102 (defvar floating-toolbar nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
103 "*Toolbar instantiator used if mouse event is not over an extent
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
104 with a non-nil 'floating-toolbar property. This variable can be
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
105 made local to a buffer to have buffer local floating toolbars.")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
106
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
107 (defvar floating-toolbar-help-font nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
108 "*Non-nil value should be a font to be used to display toolbar help
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
109 messages. The floating toolbar frame will have a minibuffer window
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
110 so that it can display any help text that is attached to the toolbar
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
111 buttons.")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
112
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
113 (defvar floating-toolbar-frame-name nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
114 "*The frame name for the frame used to display the floating toolbar.")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
115
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
116 ;;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
117 ;;; End of user variables.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
118 ;;;
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
119
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
120 (defvar floating-toolbar-frame nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
121 "The floating toolbar is displayed in this frame.")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
122
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
123 (defvar floating-toolbar-display-pending nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
124 "Non-nil value means the toolbar frame will be visible as soon
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
125 as the X server gets around to displaying it. Nil means it
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
126 will be invisible as soon as the X server decides to hide it.")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
127
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
128 (defun floating-toolbar-displayed ()
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
129 (and (frame-live-p floating-toolbar-frame)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
130 (frame-visible-p floating-toolbar-frame)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
131
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
132 ;;;###autoload
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
133 (defun floating-toolbar (event &optional extent-local-only)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
134 "Popup a toolbar near the current mouse position.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
135 The toolbar instantiator used is taken from the 'floating-toolbar
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
136 property of any extent under the mouse. If no such non-nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
137 property exists for any extent under the mouse, then the value of the
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
138 variable `floating-toolbar' is checked. If its value si nil, then
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
139 no toolbar will be displayed.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
140
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
141 This command should be bound to a button press event.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
142
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
143 When called from a program, first arg EVENT should be the button
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
144 press event. Optional second arg EXTENT-LOCAL-ONLY specifies
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
145 that only extent local toolbars should be used; this means the
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
146 `floating-toolbar' variable will not be consulted."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
147 (interactive "_e")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
148 (if (not (mouse-event-p event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
149 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
150 (let* ((buffer (event-buffer event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
151 (window (event-window event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
152 (frame (event-frame event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
153 (point (and buffer (event-point event)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
154 (glyph-extent (event-glyph-extent event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
155 (glyph-extent (if (and glyph-extent
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
156 (extent-property glyph-extent
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
157 'floating-toolbar))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
158 glyph-extent))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
159 (extent (or glyph-extent
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
160 (and point
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
161 (extent-at point buffer 'floating-toolbar))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
162 (toolbar (or (and extent (get extent 'floating-toolbar))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
163 (and (not extent-local-only)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
164 (symbol-value-in-buffer 'floating-toolbar
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
165 buffer nil))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
166 (x nil)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
167 (y nil)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
168 (echo-keystrokes 0)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
169 (awaiting-release t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
170 (done nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
171 (if (not (consp toolbar))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
172 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
173 ;; event-[xy]-pixel are relative to the top left corner
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
174 ;; of the frame. The presence of top and left toolbar
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
175 ;; and the menubar can move this position down and
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
176 ;; leftward, but XEmacs doesn't compensate for this in
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
177 ;; the values returned. So we do it here, as best we
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
178 ;; can.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
179 (let* ((params (frame-parameters frame))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
180 (top (cdr (assq 'top params)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
181 (left (cdr (assq 'left params)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
182 (xtop-toolbar-height
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
183 (if (specifier-instance top-toolbar)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
184 (specifier-instance top-toolbar-height)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
185 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
186 (xleft-toolbar-width
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
187 (if (specifier-instance left-toolbar)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
188 (specifier-instance left-toolbar-width)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
189 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
190 ;; better than nothing
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
191 (menubar-height (if current-menubar 22 0)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
192 (setq x (+ left xleft-toolbar-width (event-x-pixel event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
193 y (+ top xtop-toolbar-height menubar-height
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
194 (event-y-pixel event))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
195 ;; for toolbar spec buffer local variable values
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
196 (and buffer (set-buffer buffer))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
197 (floating-toolbar-display-toolbar toolbar x y)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
198 (while (not done)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
199 (setq event (next-command-event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
200 (cond ((and awaiting-release (button-release-event-p event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
201 (setq awaiting-release nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
202 ((and (button-release-event-p event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
203 (event-over-toolbar-p event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
204 (eq floating-toolbar-frame (event-frame event)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
205 (floating-toolbar-undisplay-toolbar)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
206 (and window (select-frame (window-frame window)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
207 (and window (select-window window))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
208 (dispatch-event event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
209 (setq done t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
210 ((and (button-press-event-p event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
211 (event-over-toolbar-p event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
212 (eq floating-toolbar-frame (event-frame event)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
213 (setq awaiting-release nil)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
214 (dispatch-event event))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
215 (t
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
216 ;; push back the event if it was in another frame.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
217 ;; eat it if it was in the toolbar frame.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
218 (if (and (event-frame event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
219 (not (eq floating-toolbar-frame
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
220 (event-frame event))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
221 (setq unread-command-events
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
222 (cons event unread-command-events)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
223 (floating-toolbar-undisplay-toolbar)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
224 (setq done t))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
225 t ))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
226
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
227 ;;;###autoload
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
228 (defun floating-toolbar-or-popup-mode-menu (event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
229 "Like floating-toolbar, but if no toolbar is displayed
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
230 run popup-mode-menu."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
231 (interactive "_e")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
232 (or (floating-toolbar event) (popup-mode-menu)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
233
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
234 ;;;###autoload
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
235 (defun floating-toolbar-from-extent-or-popup-mode-menu (event)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
236 "Like floating-toolbar-or-popup-mode-menu, but search only for an
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
237 extent local toolbar."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
238 (interactive "_e")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
239 (or (floating-toolbar event t) (popup-mode-menu)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
240
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
241 (defun floating-toolbar-display-toolbar (toolbar x y)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
242 (if (not (frame-live-p floating-toolbar-frame))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
243 (setq floating-toolbar-frame (floating-toolbar-make-toolbar-frame x y)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
244 (set-specifier top-toolbar
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
245 (cons (window-buffer
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
246 (frame-selected-window floating-toolbar-frame))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
247 toolbar))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
248 (floating-toolbar-resize-toolbar-frame toolbar)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
249 ;; fiddle with the x value to try to center the toolbar relative to
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
250 ;; the mouse position.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
251 (setq x (max 0 (- x (/ (frame-pixel-width floating-toolbar-frame) 2))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
252 (floating-toolbar-set-toolbar-frame-position x y)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
253 (floating-toolbar-expose-toolbar-frame))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
254
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
255 (defun floating-toolbar-undisplay-toolbar ()
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
256 (floating-toolbar-hide-toolbar-frame))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
257
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
258 (defun floating-toolbar-hide-toolbar-frame ()
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
259 (if (floating-toolbar-displayed)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
260 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
261 (make-frame-invisible floating-toolbar-frame)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
262 (if (and floating-toolbar-use-sound floating-toolbar-display-pending)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
263 (play-sound 'floating-toolbar-disappears))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
264 (setq floating-toolbar-display-pending nil))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
265
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
266 (defun floating-toolbar-expose-toolbar-frame ()
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
267 (if (not (floating-toolbar-displayed))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
268 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
269 (make-frame-visible floating-toolbar-frame)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
270 (if (and floating-toolbar-use-sound
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
271 (null floating-toolbar-display-pending))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
272 (play-sound 'floating-toolbar-appears))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
273 (setq floating-toolbar-display-pending t))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
274
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
275 (defun floating-toolbar-resize-toolbar-frame (toolbar)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
276 (let ((width 0)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
277 (height nil)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
278 (bevel (* 2 (or (cdr (assq 'toolbar-shadow-thickness (frame-parameters)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
279 0)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
280 (captioned (specifier-instance toolbar-buttons-captioned-p))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
281 button glyph glyph-list)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
282 (while toolbar
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
283 (setq button (car toolbar))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
284 (cond ((null button)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
285 (setq width (+ width 8)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
286 ((eq (elt button 0) ':size)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
287 (setq width (+ width (elt button 1))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
288 ((and (eq (elt button 0) ':style)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
289 (= (length button) 4)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
290 (eq (elt button 2) ':size))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
291 (setq width (+ width bevel (elt button 3))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
292 (t
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
293 (setq glyph-list (elt button 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
294 (if (symbolp glyph-list)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
295 (setq glyph-list (symbol-value glyph-list)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
296 (if (and captioned (> (length glyph-list) 3))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
297 (setq glyph (or (nth 3 glyph-list)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
298 (nth 4 glyph-list)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
299 (nth 5 glyph-list)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
300 (setq glyph (car glyph-list)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
301 (setq width (+ width bevel (glyph-width glyph)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
302 (or height (setq height (+ bevel (glyph-height glyph))))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
303 (setq toolbar (cdr toolbar)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
304 (set-specifier top-toolbar-height height floating-toolbar-frame)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
305 (set-frame-width floating-toolbar-frame
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
306 (1+ (/ width (font-width (face-font 'default)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
307 floating-toolbar-frame))))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
308
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
309 (defun floating-toolbar-set-toolbar-frame-position (x y)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
310 (set-frame-position floating-toolbar-frame x y))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
311
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
312 (defun floating-toolbar-make-junk-frame ()
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
313 (let ((window-min-height 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
314 (window-min-width 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
315 (make-frame '(minibuffer t initially-unmapped t width 1 height 1))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
316
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
317 (defun floating-toolbar-make-toolbar-frame (x y)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
318 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
319 (let ((window-min-height 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
320 (window-min-width 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
321 (bg-color (or (x-get-resource "backgroundToolBarColor"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
322 "BackgroundToolBarColor"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
323 'string
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
324 'global
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
325 (selected-device)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
326 t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
327 "grey75"))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
328 (buffer (get-buffer-create " *floating-toolbar-buffer*"))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
329 (frame nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
330 (set-buffer buffer)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
331 (set-buffer-menubar nil)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
332 (if floating-toolbar-help-font
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
333 (progn (set-buffer (window-buffer (minibuffer-window)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
334 (set-buffer-menubar nil)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
335 (setq frame (make-frame (list
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
336 '(initially-unmapped . t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
337 ;; try to evade frame decorations
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
338 (cons 'name (or floating-toolbar-frame-name
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
339 "xclock"))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
340 '(border-width . 2)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
341 (cons 'border-color bg-color)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
342 (cons 'top y)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
343 (cons 'left x)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
344 (cons 'popup
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
345 (floating-toolbar-make-junk-frame))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
346 (if floating-toolbar-help-font
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
347 '(minibuffer . only)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
348 '(minibuffer . nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
349 '(width . 3)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
350 '(height . 1))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
351 (set-specifier text-cursor-visible-p (cons frame nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
352 (if floating-toolbar-help-font
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
353 (set-face-font 'default floating-toolbar-help-font frame)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
354 (set-face-font 'default "nil2" frame))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
355 (set-face-background 'default bg-color frame)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
356 (set-face-background 'modeline bg-color frame)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
357 (set-specifier modeline-shadow-thickness (cons frame 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
358 (set-specifier has-modeline-p (cons frame nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
359 (set-face-background-pixmap 'default "" frame)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
360 (set-window-buffer (frame-selected-window frame) buffer)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
361 (set-specifier top-toolbar-height (cons frame 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
362 (set-specifier left-toolbar-width (cons frame 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
363 (set-specifier right-toolbar-width (cons frame 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
364 (set-specifier bottom-toolbar-height (cons frame 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
365 (set-specifier top-toolbar (cons frame nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
366 (set-specifier left-toolbar (cons frame nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
367 (set-specifier right-toolbar (cons frame nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
368 (set-specifier bottom-toolbar (cons frame nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
369 (set-specifier scrollbar-width (cons frame 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
370 (set-specifier scrollbar-height (cons frame 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
371 frame )))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
372
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
373 ;; first popup should be faster if we go ahead and make the frame now.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
374 (or floating-toolbar-frame
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
375 (not (eq (device-type) 'x))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
376 (setq floating-toolbar-frame (floating-toolbar-make-toolbar-frame 0 0)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
377
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents:
diff changeset
378 ;;; floating-toolbar.el ends here