Mercurial > emacs
annotate src/xfns.c @ 2352:8c8fe9da1f5e
(lm-last-modified-date) Fixed return bug.
(lm-uthor, lm-maintainer) These now return cons pairs, not strings.
author | Eric S. Raymond <esr@snark.thyrsus.com> |
---|---|
date | Thu, 25 Mar 1993 01:57:43 +0000 |
parents | 1982e2983822 |
children | cec8c9490d8a |
rev | line source |
---|---|
389 | 1 /* Functions for the X window system. |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2 Copyright (C) 1989, 1992, 1993 Free Software Foundation. |
389 | 3 |
4 This file is part of GNU Emacs. | |
5 | |
6 GNU Emacs is free software; you can redistribute it and/or modify | |
7 it under the terms of the GNU General Public License as published by | |
708 | 8 the Free Software Foundation; either version 2, or (at your option) |
389 | 9 any later version. |
10 | |
11 GNU Emacs is distributed in the hope that it will be useful, | |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 GNU General Public License for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
17 along with GNU Emacs; see the file COPYING. If not, write to | |
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | |
20 /* Completely rewritten by Richard Stallman. */ | |
21 | |
22 /* Rewritten for X11 by Joseph Arceneaux */ | |
23 | |
24 #if 0 | |
25 #include <stdio.h> | |
26 #endif | |
27 #include <signal.h> | |
28 #include "config.h" | |
29 #include "lisp.h" | |
30 #include "xterm.h" | |
771 | 31 #include "frame.h" |
389 | 32 #include "window.h" |
33 #include "buffer.h" | |
34 #include "dispextern.h" | |
515 | 35 #include "keyboard.h" |
389 | 36 |
37 #ifdef HAVE_X_WINDOWS | |
38 extern void abort (); | |
39 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
40 #include <X11/bitmaps/gray> |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
41 |
389 | 42 #define min(a,b) ((a) < (b) ? (a) : (b)) |
43 #define max(a,b) ((a) > (b) ? (a) : (b)) | |
44 | |
45 #ifdef HAVE_X11 | |
46 /* X Resource data base */ | |
47 static XrmDatabase xrdb; | |
48 | |
49 /* The class of this X application. */ | |
50 #define EMACS_CLASS "Emacs" | |
51 | |
52 /* Title name and application name for X stuff. */ | |
398 | 53 extern char *x_id_name; |
389 | 54 |
55 /* The background and shape of the mouse pointer, and shape when not | |
56 over text or in the modeline. */ | |
57 Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape; | |
58 | |
59 /* Color of chars displayed in cursor box. */ | |
60 Lisp_Object Vx_cursor_fore_pixel; | |
61 | |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
62 /* The screen being used. */ |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
63 static Screen *x_screen; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
64 |
389 | 65 /* The X Visual we are using for X windows (the default) */ |
66 Visual *screen_visual; | |
67 | |
68 /* Height of this X screen in pixels. */ | |
69 int x_screen_height; | |
70 | |
71 /* Width of this X screen in pixels. */ | |
72 int x_screen_width; | |
73 | |
74 /* Number of planes for this screen. */ | |
75 int x_screen_planes; | |
76 | |
77 /* Non nil if no window manager is in use. */ | |
78 Lisp_Object Vx_no_window_manager; | |
79 | |
80 /* `t' if a mouse button is depressed. */ | |
81 | |
82 Lisp_Object Vmouse_depressed; | |
83 | |
700
6a15fb0422ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
697
diff
changeset
|
84 extern unsigned int x_mouse_x, x_mouse_y, x_mouse_grabbed; |
6a15fb0422ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
697
diff
changeset
|
85 |
389 | 86 /* Atom for indicating window state to the window manager. */ |
2197
fb5a1caebef6
(Xatom_wm_change_state): Just declare.
Richard M. Stallman <rms@gnu.org>
parents:
2136
diff
changeset
|
87 extern Atom Xatom_wm_change_state; |
389 | 88 |
641 | 89 /* Communication with window managers. */ |
90 extern Atom Xatom_wm_protocols; | |
91 | |
92 /* Kinds of protocol things we may receive. */ | |
93 extern Atom Xatom_wm_take_focus; | |
94 extern Atom Xatom_wm_save_yourself; | |
95 extern Atom Xatom_wm_delete_window; | |
96 | |
97 /* Other WM communication */ | |
642 | 98 extern Atom Xatom_wm_configure_denied; /* When our config request is denied */ |
99 extern Atom Xatom_wm_window_moved; /* When the WM moves us. */ | |
641 | 100 |
389 | 101 #else /* X10 */ |
102 | |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
103 /* Default size of an Emacs window. */ |
389 | 104 static char *default_window = "=80x24+0+0"; |
105 | |
106 #define MAXICID 80 | |
107 char iconidentity[MAXICID]; | |
108 #define ICONTAG "emacs@" | |
109 char minibuffer_iconidentity[MAXICID]; | |
110 #define MINIBUFFER_ICONTAG "minibuffer@" | |
111 | |
112 #endif /* X10 */ | |
113 | |
114 /* The last 23 bits of the timestamp of the last mouse button event. */ | |
115 Time mouse_timestamp; | |
116 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
117 /* Evaluate this expression to rebuild the section of syms_of_xfns |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
118 that initializes and staticpros the symbols declared below. Note |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
119 that Emacs 18 has a bug that keeps C-x C-e from being able to |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
120 evaluate this expression. |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
121 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
122 (progn |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
123 ;; Accumulate a list of the symbols we want to initialize from the |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
124 ;; declarations at the top of the file. |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
125 (goto-char (point-min)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
126 (search-forward "/\*&&& symbols declared here &&&*\/\n") |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
127 (let (symbol-list) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
128 (while (looking-at "Lisp_Object \\(Q[a-z_]+\\)") |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
129 (setq symbol-list |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
130 (cons (buffer-substring (match-beginning 1) (match-end 1)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
131 symbol-list)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
132 (forward-line 1)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
133 (setq symbol-list (nreverse symbol-list)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
134 ;; Delete the section of syms_of_... where we initialize the symbols. |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
135 (search-forward "\n /\*&&& init symbols here &&&*\/\n") |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
136 (let ((start (point))) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
137 (while (looking-at "^ Q") |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
138 (forward-line 2)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
139 (kill-region start (point))) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
140 ;; Write a new symbol initialization section. |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
141 (while symbol-list |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
142 (insert (format " %s = intern (\"" (car symbol-list))) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
143 (let ((start (point))) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
144 (insert (substring (car symbol-list) 1)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
145 (subst-char-in-region start (point) ?_ ?-)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
146 (insert (format "\");\n staticpro (&%s);\n" (car symbol-list))) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
147 (setq symbol-list (cdr symbol-list))))) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
148 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
149 */ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
150 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
151 /*&&& symbols declared here &&&*/ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
152 Lisp_Object Qauto_raise; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
153 Lisp_Object Qauto_lower; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
154 Lisp_Object Qbackground_color; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
155 Lisp_Object Qbar; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
156 Lisp_Object Qborder_color; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
157 Lisp_Object Qborder_width; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
158 Lisp_Object Qbox; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
159 Lisp_Object Qcursor_color; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
160 Lisp_Object Qcursor_type; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
161 Lisp_Object Qfont; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
162 Lisp_Object Qforeground_color; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
163 Lisp_Object Qgeometry; |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
164 Lisp_Object Qicon; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
165 Lisp_Object Qicon_left; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
166 Lisp_Object Qicon_top; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
167 Lisp_Object Qicon_type; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
168 Lisp_Object Qinternal_border_width; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
169 Lisp_Object Qleft; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
170 Lisp_Object Qmouse_color; |
1874
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
171 Lisp_Object Qnone; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
172 Lisp_Object Qparent_id; |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
173 Lisp_Object Qsuppress_icon; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
174 Lisp_Object Qtop; |
389 | 175 Lisp_Object Qundefined_color; |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
176 Lisp_Object Qvertical_scroll_bars; |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
177 Lisp_Object Qvisibility; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
178 Lisp_Object Qwindow_id; |
771 | 179 Lisp_Object Qx_frame_parameter; |
389 | 180 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
181 /* The below are defined in frame.c. */ |
1874
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
182 extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth; |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
183 extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qicon; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
184 |
389 | 185 extern Lisp_Object Vwindow_system_version; |
186 | |
187 /* Mouse map for clicks in windows. */ | |
188 extern Lisp_Object Vglobal_mouse_map; | |
189 | |
190 /* Points to table of defined typefaces. */ | |
191 struct face *x_face_table[MAX_FACES_AND_GLYPHS]; | |
192 | |
771 | 193 /* Return the Emacs frame-object corresponding to an X window. |
194 It could be the frame's main window or an icon window. */ | |
195 | |
196 struct frame * | |
197 x_window_to_frame (wdesc) | |
389 | 198 int wdesc; |
199 { | |
771 | 200 Lisp_Object tail, frame; |
201 struct frame *f; | |
202 | |
203 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) | |
389 | 204 { |
771 | 205 frame = XCONS (tail)->car; |
206 if (XTYPE (frame) != Lisp_Frame) | |
389 | 207 continue; |
771 | 208 f = XFRAME (frame); |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
209 if (FRAME_X_WINDOW (f) == wdesc |
771 | 210 || f->display.x->icon_desc == wdesc) |
211 return f; | |
389 | 212 } |
213 return 0; | |
214 } | |
215 | |
216 | |
771 | 217 /* Connect the frame-parameter names for X frames |
389 | 218 to the ways of passing the parameter values to the window system. |
219 | |
220 The name of a parameter, as a Lisp symbol, | |
771 | 221 has an `x-frame-parameter' property which is an integer in Lisp |
222 but can be interpreted as an `enum x_frame_parm' in C. */ | |
223 | |
224 enum x_frame_parm | |
389 | 225 { |
226 X_PARM_FOREGROUND_COLOR, | |
227 X_PARM_BACKGROUND_COLOR, | |
228 X_PARM_MOUSE_COLOR, | |
229 X_PARM_CURSOR_COLOR, | |
230 X_PARM_BORDER_COLOR, | |
231 X_PARM_ICON_TYPE, | |
232 X_PARM_FONT, | |
233 X_PARM_BORDER_WIDTH, | |
234 X_PARM_INTERNAL_BORDER_WIDTH, | |
235 X_PARM_NAME, | |
236 X_PARM_AUTORAISE, | |
237 X_PARM_AUTOLOWER, | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
238 X_PARM_VERT_SCROLL_BAR, |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
239 X_PARM_VISIBILITY, |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
240 X_PARM_MENU_BAR_LINES |
389 | 241 }; |
242 | |
243 | |
771 | 244 struct x_frame_parm_table |
389 | 245 { |
246 char *name; | |
771 | 247 void (*setter)( /* struct frame *frame, Lisp_Object val, oldval */ ); |
389 | 248 }; |
249 | |
250 void x_set_foreground_color (); | |
251 void x_set_background_color (); | |
252 void x_set_mouse_color (); | |
253 void x_set_cursor_color (); | |
254 void x_set_border_color (); | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
255 void x_set_cursor_type (); |
389 | 256 void x_set_icon_type (); |
257 void x_set_font (); | |
258 void x_set_border_width (); | |
259 void x_set_internal_border_width (); | |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
260 void x_explicitly_set_name (); |
389 | 261 void x_set_autoraise (); |
262 void x_set_autolower (); | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
263 void x_set_vertical_scroll_bars (); |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
264 void x_set_visibility (); |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
265 void x_set_menu_bar_lines (); |
389 | 266 |
771 | 267 static struct x_frame_parm_table x_frame_parms[] = |
389 | 268 { |
269 "foreground-color", x_set_foreground_color, | |
270 "background-color", x_set_background_color, | |
271 "mouse-color", x_set_mouse_color, | |
272 "cursor-color", x_set_cursor_color, | |
273 "border-color", x_set_border_color, | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
274 "cursor-type", x_set_cursor_type, |
389 | 275 "icon-type", x_set_icon_type, |
276 "font", x_set_font, | |
277 "border-width", x_set_border_width, | |
278 "internal-border-width", x_set_internal_border_width, | |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
279 "name", x_explicitly_set_name, |
1874
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
280 "auto-raise", x_set_autoraise, |
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
281 "auto-lower", x_set_autolower, |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
282 "vertical-scroll-bars", x_set_vertical_scroll_bars, |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
283 "visibility", x_set_visibility, |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
284 "menu-bar-lines", x_set_menu_bar_lines, |
389 | 285 }; |
286 | |
771 | 287 /* Attach the `x-frame-parameter' properties to |
389 | 288 the Lisp symbol names of parameters relevant to X. */ |
289 | |
290 init_x_parm_symbols () | |
291 { | |
292 int i; | |
293 | |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
294 for (i = 0; i < sizeof (x_frame_parms) / sizeof (x_frame_parms[0]); i++) |
771 | 295 Fput (intern (x_frame_parms[i].name), Qx_frame_parameter, |
389 | 296 make_number (i)); |
297 } | |
298 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
299 /* Change the parameters of FRAME as specified by ALIST. |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
300 If a parameter is not specially recognized, do nothing; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
301 otherwise call the `x_set_...' function for that parameter. */ |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
302 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
303 void |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
304 x_set_frame_parameters (f, alist) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
305 FRAME_PTR f; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
306 Lisp_Object alist; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
307 { |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
308 Lisp_Object tail; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
309 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
310 /* If both of these parameters are present, it's more efficient to |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
311 set them both at once. So we wait until we've looked at the |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
312 entire list before we set them. */ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
313 Lisp_Object width, height; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
314 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
315 /* Same here. */ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
316 Lisp_Object left, top; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
317 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
318 XSET (width, Lisp_Int, FRAME_WIDTH (f)); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
319 XSET (height, Lisp_Int, FRAME_HEIGHT (f)); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
320 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
321 XSET (top, Lisp_Int, f->display.x->top_pos); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
322 XSET (left, Lisp_Int, f->display.x->left_pos); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
323 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
324 for (tail = alist; CONSP (tail); tail = Fcdr (tail)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
325 { |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
326 Lisp_Object elt, prop, val; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
327 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
328 elt = Fcar (tail); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
329 prop = Fcar (elt); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
330 val = Fcdr (elt); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
331 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
332 if (EQ (prop, Qwidth)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
333 width = val; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
334 else if (EQ (prop, Qheight)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
335 height = val; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
336 else if (EQ (prop, Qtop)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
337 top = val; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
338 else if (EQ (prop, Qleft)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
339 left = val; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
340 else |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
341 { |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
342 register Lisp_Object tem; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
343 tem = Fget (prop, Qx_frame_parameter); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
344 if (XTYPE (tem) == Lisp_Int |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
345 && XINT (tem) >= 0 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
346 && XINT (tem) < sizeof (x_frame_parms)/sizeof (x_frame_parms[0])) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
347 (*x_frame_parms[XINT (tem)].setter)(f, val, |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
348 get_frame_param (f, prop)); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
349 store_frame_param (f, prop, val); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
350 } |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
351 } |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
352 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
353 /* Don't call these unless they've changed; the window may not actually |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
354 exist yet. */ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
355 { |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
356 Lisp_Object frame; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
357 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
358 XSET (frame, Lisp_Frame, f); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
359 if (XINT (width) != FRAME_WIDTH (f) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
360 || XINT (height) != FRAME_HEIGHT (f)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
361 Fset_frame_size (frame, width, height); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
362 if (XINT (left) != f->display.x->left_pos |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
363 || XINT (top) != f->display.x->top_pos) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
364 Fset_frame_position (frame, left, top); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
365 } |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
366 } |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
367 |
771 | 368 /* Insert a description of internally-recorded parameters of frame X |
389 | 369 into the parameter alist *ALISTPTR that is to be given to the user. |
370 Only parameters that are specific to the X window system | |
771 | 371 and whose values are not correctly recorded in the frame's |
389 | 372 param_alist need to be considered here. */ |
373 | |
771 | 374 x_report_frame_params (f, alistptr) |
375 struct frame *f; | |
389 | 376 Lisp_Object *alistptr; |
377 { | |
378 char buf[16]; | |
379 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
380 store_in_alist (alistptr, Qleft, make_number (f->display.x->left_pos)); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
381 store_in_alist (alistptr, Qtop, make_number (f->display.x->top_pos)); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
382 store_in_alist (alistptr, Qborder_width, |
771 | 383 make_number (f->display.x->border_width)); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
384 store_in_alist (alistptr, Qinternal_border_width, |
771 | 385 make_number (f->display.x->internal_border_width)); |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
386 sprintf (buf, "%d", FRAME_X_WINDOW (f)); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
387 store_in_alist (alistptr, Qwindow_id, |
389 | 388 build_string (buf)); |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
389 store_in_alist (alistptr, Qvisibility, |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
390 (FRAME_VISIBLE_P (f) ? Qt |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
391 : FRAME_ICONIFIED_P (f) ? Qicon : Qnil)); |
389 | 392 } |
393 | |
394 /* Decide if color named COLOR is valid for the display | |
771 | 395 associated with the selected frame. */ |
389 | 396 int |
397 defined_color (color, color_def) | |
398 char *color; | |
399 Color *color_def; | |
400 { | |
401 register int foo; | |
402 Colormap screen_colormap; | |
403 | |
404 BLOCK_INPUT; | |
405 #ifdef HAVE_X11 | |
406 screen_colormap | |
407 = DefaultColormap (x_current_display, XDefaultScreen (x_current_display)); | |
408 | |
409 foo = XParseColor (x_current_display, screen_colormap, | |
410 color, color_def) | |
411 && XAllocColor (x_current_display, screen_colormap, color_def); | |
412 #else | |
413 foo = XParseColor (color, color_def) && XGetHardwareColor (color_def); | |
414 #endif /* not HAVE_X11 */ | |
415 UNBLOCK_INPUT; | |
416 | |
417 if (foo) | |
418 return 1; | |
419 else | |
420 return 0; | |
421 } | |
422 | |
423 /* Given a string ARG naming a color, compute a pixel value from it | |
771 | 424 suitable for screen F. |
425 If F is not a color screen, return DEF (default) regardless of what | |
389 | 426 ARG says. */ |
427 | |
428 int | |
429 x_decode_color (arg, def) | |
430 Lisp_Object arg; | |
431 int def; | |
432 { | |
433 Color cdef; | |
434 | |
435 CHECK_STRING (arg, 0); | |
436 | |
437 if (strcmp (XSTRING (arg)->data, "black") == 0) | |
438 return BLACK_PIX_DEFAULT; | |
439 else if (strcmp (XSTRING (arg)->data, "white") == 0) | |
440 return WHITE_PIX_DEFAULT; | |
441 | |
442 #ifdef HAVE_X11 | |
1528
924c8a609582
* xfns.c (x_decode_color, Fx_color_display_p): x_screen_planes is
Jim Blandy <jimb@redhat.com>
parents:
1438
diff
changeset
|
443 if (x_screen_planes == 1) |
389 | 444 return def; |
445 #else | |
485 | 446 if (DISPLAY_CELLS == 1) |
389 | 447 return def; |
448 #endif | |
449 | |
450 if (defined_color (XSTRING (arg)->data, &cdef)) | |
451 return cdef.pixel; | |
452 else | |
453 Fsignal (Qundefined_color, Fcons (arg, Qnil)); | |
454 } | |
455 | |
771 | 456 /* Functions called only from `x_set_frame_param' |
389 | 457 to set individual parameters. |
458 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
459 If FRAME_X_WINDOW (f) is 0, |
771 | 460 the frame is being created and its X-window does not exist yet. |
389 | 461 In that case, just record the parameter's new value |
462 in the standard place; do not attempt to change the window. */ | |
463 | |
464 void | |
771 | 465 x_set_foreground_color (f, arg, oldval) |
466 struct frame *f; | |
389 | 467 Lisp_Object arg, oldval; |
468 { | |
771 | 469 f->display.x->foreground_pixel = x_decode_color (arg, BLACK_PIX_DEFAULT); |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
470 if (FRAME_X_WINDOW (f) != 0) |
389 | 471 { |
472 #ifdef HAVE_X11 | |
473 BLOCK_INPUT; | |
771 | 474 XSetForeground (x_current_display, f->display.x->normal_gc, |
475 f->display.x->foreground_pixel); | |
476 XSetBackground (x_current_display, f->display.x->reverse_gc, | |
477 f->display.x->foreground_pixel); | |
389 | 478 UNBLOCK_INPUT; |
479 #endif /* HAVE_X11 */ | |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
480 if (FRAME_VISIBLE_P (f)) |
771 | 481 redraw_frame (f); |
389 | 482 } |
483 } | |
484 | |
485 void | |
771 | 486 x_set_background_color (f, arg, oldval) |
487 struct frame *f; | |
389 | 488 Lisp_Object arg, oldval; |
489 { | |
490 Pixmap temp; | |
491 int mask; | |
492 | |
771 | 493 f->display.x->background_pixel = x_decode_color (arg, WHITE_PIX_DEFAULT); |
494 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
495 if (FRAME_X_WINDOW (f) != 0) |
389 | 496 { |
497 BLOCK_INPUT; | |
498 #ifdef HAVE_X11 | |
771 | 499 /* The main frame area. */ |
500 XSetBackground (x_current_display, f->display.x->normal_gc, | |
501 f->display.x->background_pixel); | |
502 XSetForeground (x_current_display, f->display.x->reverse_gc, | |
503 f->display.x->background_pixel); | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
504 XSetWindowBackground (x_current_display, FRAME_X_WINDOW (f), |
771 | 505 f->display.x->background_pixel); |
389 | 506 |
507 #else | |
771 | 508 temp = XMakeTile (f->display.x->background_pixel); |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
509 XChangeBackground (FRAME_X_WINDOW (f), temp); |
389 | 510 XFreePixmap (temp); |
511 #endif /* not HAVE_X11 */ | |
512 UNBLOCK_INPUT; | |
513 | |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
514 if (FRAME_VISIBLE_P (f)) |
771 | 515 redraw_frame (f); |
389 | 516 } |
517 } | |
518 | |
519 void | |
771 | 520 x_set_mouse_color (f, arg, oldval) |
521 struct frame *f; | |
389 | 522 Lisp_Object arg, oldval; |
523 { | |
524 Cursor cursor, nontext_cursor, mode_cursor; | |
525 int mask_color; | |
526 | |
527 if (!EQ (Qnil, arg)) | |
771 | 528 f->display.x->mouse_pixel = x_decode_color (arg, BLACK_PIX_DEFAULT); |
529 mask_color = f->display.x->background_pixel; | |
389 | 530 /* No invisible pointers. */ |
771 | 531 if (mask_color == f->display.x->mouse_pixel |
532 && mask_color == f->display.x->background_pixel) | |
533 f->display.x->mouse_pixel = f->display.x->foreground_pixel; | |
389 | 534 |
535 BLOCK_INPUT; | |
536 #ifdef HAVE_X11 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
537 |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
538 /* It's not okay to crash if the user selects a screwey cursor. */ |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
539 x_catch_errors (); |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
540 |
389 | 541 if (!EQ (Qnil, Vx_pointer_shape)) |
542 { | |
543 CHECK_NUMBER (Vx_pointer_shape, 0); | |
544 cursor = XCreateFontCursor (x_current_display, XINT (Vx_pointer_shape)); | |
545 } | |
546 else | |
547 cursor = XCreateFontCursor (x_current_display, XC_xterm); | |
1528
924c8a609582
* xfns.c (x_decode_color, Fx_color_display_p): x_screen_planes is
Jim Blandy <jimb@redhat.com>
parents:
1438
diff
changeset
|
548 x_check_errors ("bad text pointer cursor: %s"); |
389 | 549 |
550 if (!EQ (Qnil, Vx_nontext_pointer_shape)) | |
551 { | |
552 CHECK_NUMBER (Vx_nontext_pointer_shape, 0); | |
553 nontext_cursor = XCreateFontCursor (x_current_display, | |
554 XINT (Vx_nontext_pointer_shape)); | |
555 } | |
556 else | |
557 nontext_cursor = XCreateFontCursor (x_current_display, XC_left_ptr); | |
1528
924c8a609582
* xfns.c (x_decode_color, Fx_color_display_p): x_screen_planes is
Jim Blandy <jimb@redhat.com>
parents:
1438
diff
changeset
|
558 x_check_errors ("bad nontext pointer cursor: %s"); |
389 | 559 |
560 if (!EQ (Qnil, Vx_mode_pointer_shape)) | |
561 { | |
562 CHECK_NUMBER (Vx_mode_pointer_shape, 0); | |
563 mode_cursor = XCreateFontCursor (x_current_display, | |
564 XINT (Vx_mode_pointer_shape)); | |
565 } | |
566 else | |
567 mode_cursor = XCreateFontCursor (x_current_display, XC_xterm); | |
568 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
569 /* Check and report errors with the above calls. */ |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
570 x_check_errors ("can't set cursor shape: %s"); |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
571 x_uncatch_errors (); |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
572 |
389 | 573 { |
574 XColor fore_color, back_color; | |
575 | |
771 | 576 fore_color.pixel = f->display.x->mouse_pixel; |
389 | 577 back_color.pixel = mask_color; |
578 XQueryColor (x_current_display, | |
579 DefaultColormap (x_current_display, | |
580 DefaultScreen (x_current_display)), | |
581 &fore_color); | |
582 XQueryColor (x_current_display, | |
583 DefaultColormap (x_current_display, | |
584 DefaultScreen (x_current_display)), | |
585 &back_color); | |
586 XRecolorCursor (x_current_display, cursor, | |
587 &fore_color, &back_color); | |
588 XRecolorCursor (x_current_display, nontext_cursor, | |
589 &fore_color, &back_color); | |
590 XRecolorCursor (x_current_display, mode_cursor, | |
591 &fore_color, &back_color); | |
592 } | |
593 #else /* X10 */ | |
594 cursor = XCreateCursor (16, 16, MouseCursor, MouseMask, | |
595 0, 0, | |
771 | 596 f->display.x->mouse_pixel, |
597 f->display.x->background_pixel, | |
389 | 598 GXcopy); |
599 #endif /* X10 */ | |
600 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
601 if (FRAME_X_WINDOW (f) != 0) |
389 | 602 { |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
603 XDefineCursor (XDISPLAY FRAME_X_WINDOW (f), cursor); |
389 | 604 } |
605 | |
771 | 606 if (cursor != f->display.x->text_cursor && f->display.x->text_cursor != 0) |
607 XFreeCursor (XDISPLAY f->display.x->text_cursor); | |
608 f->display.x->text_cursor = cursor; | |
389 | 609 #ifdef HAVE_X11 |
771 | 610 if (nontext_cursor != f->display.x->nontext_cursor |
611 && f->display.x->nontext_cursor != 0) | |
612 XFreeCursor (XDISPLAY f->display.x->nontext_cursor); | |
613 f->display.x->nontext_cursor = nontext_cursor; | |
614 | |
615 if (mode_cursor != f->display.x->modeline_cursor | |
616 && f->display.x->modeline_cursor != 0) | |
617 XFreeCursor (XDISPLAY f->display.x->modeline_cursor); | |
618 f->display.x->modeline_cursor = mode_cursor; | |
389 | 619 #endif /* HAVE_X11 */ |
620 | |
621 XFlushQueue (); | |
622 UNBLOCK_INPUT; | |
623 } | |
624 | |
625 void | |
771 | 626 x_set_cursor_color (f, arg, oldval) |
627 struct frame *f; | |
389 | 628 Lisp_Object arg, oldval; |
629 { | |
630 unsigned long fore_pixel; | |
631 | |
632 if (!EQ (Vx_cursor_fore_pixel, Qnil)) | |
633 fore_pixel = x_decode_color (Vx_cursor_fore_pixel, WHITE_PIX_DEFAULT); | |
634 else | |
771 | 635 fore_pixel = f->display.x->background_pixel; |
636 f->display.x->cursor_pixel = x_decode_color (arg, BLACK_PIX_DEFAULT); | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
637 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
638 /* Make sure that the cursor color differs from the background color. */ |
771 | 639 if (f->display.x->cursor_pixel == f->display.x->background_pixel) |
389 | 640 { |
771 | 641 f->display.x->cursor_pixel == f->display.x->mouse_pixel; |
642 if (f->display.x->cursor_pixel == fore_pixel) | |
643 fore_pixel = f->display.x->background_pixel; | |
389 | 644 } |
645 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
646 if (FRAME_X_WINDOW (f) != 0) |
389 | 647 { |
648 #ifdef HAVE_X11 | |
649 BLOCK_INPUT; | |
771 | 650 XSetBackground (x_current_display, f->display.x->cursor_gc, |
651 f->display.x->cursor_pixel); | |
652 XSetForeground (x_current_display, f->display.x->cursor_gc, | |
389 | 653 fore_pixel); |
654 UNBLOCK_INPUT; | |
655 #endif /* HAVE_X11 */ | |
656 | |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
657 if (FRAME_VISIBLE_P (f)) |
389 | 658 { |
771 | 659 x_display_cursor (f, 0); |
660 x_display_cursor (f, 1); | |
389 | 661 } |
662 } | |
663 } | |
664 | |
771 | 665 /* Set the border-color of frame F to value described by ARG. |
389 | 666 ARG can be a string naming a color. |
667 The border-color is used for the border that is drawn by the X server. | |
668 Note that this does not fully take effect if done before | |
771 | 669 F has an x-window; it must be redone when the window is created. |
389 | 670 |
671 Note: this is done in two routines because of the way X10 works. | |
672 | |
673 Note: under X11, this is normally the province of the window manager, | |
674 and so emacs' border colors may be overridden. */ | |
675 | |
676 void | |
771 | 677 x_set_border_color (f, arg, oldval) |
678 struct frame *f; | |
389 | 679 Lisp_Object arg, oldval; |
680 { | |
681 unsigned char *str; | |
682 int pix; | |
683 | |
684 CHECK_STRING (arg, 0); | |
685 str = XSTRING (arg)->data; | |
686 | |
687 #ifndef HAVE_X11 | |
688 if (!strcmp (str, "grey") || !strcmp (str, "Grey") | |
689 || !strcmp (str, "gray") || !strcmp (str, "Gray")) | |
690 pix = -1; | |
691 else | |
692 #endif /* X10 */ | |
693 | |
694 pix = x_decode_color (arg, BLACK_PIX_DEFAULT); | |
695 | |
771 | 696 x_set_border_pixel (f, pix); |
389 | 697 } |
698 | |
771 | 699 /* Set the border-color of frame F to pixel value PIX. |
389 | 700 Note that this does not fully take effect if done before |
771 | 701 F has an x-window. */ |
702 | |
703 x_set_border_pixel (f, pix) | |
704 struct frame *f; | |
389 | 705 int pix; |
706 { | |
771 | 707 f->display.x->border_pixel = pix; |
708 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
709 if (FRAME_X_WINDOW (f) != 0 && f->display.x->border_width > 0) |
389 | 710 { |
711 Pixmap temp; | |
712 int mask; | |
713 | |
714 BLOCK_INPUT; | |
715 #ifdef HAVE_X11 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
716 XSetWindowBorder (x_current_display, FRAME_X_WINDOW (f), |
389 | 717 pix); |
718 #else | |
719 if (pix < 0) | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
720 temp = XMakePixmap ((Bitmap) XStoreBitmap (gray_width, gray_height, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
721 gray_bits), |
389 | 722 BLACK_PIX_DEFAULT, WHITE_PIX_DEFAULT); |
723 else | |
724 temp = XMakeTile (pix); | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
725 XChangeBorder (FRAME_X_WINDOW (f), temp); |
389 | 726 XFreePixmap (XDISPLAY temp); |
727 #endif /* not HAVE_X11 */ | |
728 UNBLOCK_INPUT; | |
729 | |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
730 if (FRAME_VISIBLE_P (f)) |
771 | 731 redraw_frame (f); |
389 | 732 } |
733 } | |
734 | |
735 void | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
736 x_set_cursor_type (f, arg, oldval) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
737 FRAME_PTR f; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
738 Lisp_Object arg, oldval; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
739 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
740 if (EQ (arg, Qbar)) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
741 FRAME_DESIRED_CURSOR (f) = bar_cursor; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
742 else if (EQ (arg, Qbox)) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
743 FRAME_DESIRED_CURSOR (f) = filled_box_cursor; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
744 else |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
745 error |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
746 ("the `cursor-type' frame parameter should be either `bar' or `box'"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
747 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
748 /* Make sure the cursor gets redrawn. This is overkill, but how |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
749 often do people change cursor types? */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
750 update_mode_lines++; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
751 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
752 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
753 void |
771 | 754 x_set_icon_type (f, arg, oldval) |
755 struct frame *f; | |
389 | 756 Lisp_Object arg, oldval; |
757 { | |
758 Lisp_Object tem; | |
759 int result; | |
760 | |
761 if (EQ (oldval, Qnil) == EQ (arg, Qnil)) | |
762 return; | |
763 | |
764 BLOCK_INPUT; | |
485 | 765 if (NILP (arg)) |
771 | 766 result = x_text_icon (f, 0); |
389 | 767 else |
1932
56dd1fbd33c2
* xfns.c (x_set_icon_type): Pass the proper number of arguments to
Jim Blandy <jimb@redhat.com>
parents:
1874
diff
changeset
|
768 result = x_bitmap_icon (f); |
389 | 769 |
770 if (result) | |
771 { | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
772 UNBLOCK_INPUT; |
389 | 773 error ("No icon window available."); |
774 } | |
775 | |
776 /* If the window was unmapped (and its icon was mapped), | |
777 the new icon is not mapped, so map the window in its stead. */ | |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
778 if (FRAME_VISIBLE_P (f)) |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
779 XMapWindow (XDISPLAY FRAME_X_WINDOW (f)); |
389 | 780 |
781 XFlushQueue (); | |
782 UNBLOCK_INPUT; | |
783 } | |
784 | |
785 void | |
771 | 786 x_set_font (f, arg, oldval) |
787 struct frame *f; | |
389 | 788 Lisp_Object arg, oldval; |
789 { | |
790 unsigned char *name; | |
791 int result; | |
792 | |
793 CHECK_STRING (arg, 1); | |
794 name = XSTRING (arg)->data; | |
795 | |
796 BLOCK_INPUT; | |
771 | 797 result = x_new_font (f, name); |
389 | 798 UNBLOCK_INPUT; |
799 | |
800 if (result) | |
801 error ("Font \"%s\" is not defined", name); | |
802 } | |
803 | |
804 void | |
771 | 805 x_set_border_width (f, arg, oldval) |
806 struct frame *f; | |
389 | 807 Lisp_Object arg, oldval; |
808 { | |
809 CHECK_NUMBER (arg, 0); | |
810 | |
771 | 811 if (XINT (arg) == f->display.x->border_width) |
389 | 812 return; |
813 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
814 if (FRAME_X_WINDOW (f) != 0) |
389 | 815 error ("Cannot change the border width of a window"); |
816 | |
771 | 817 f->display.x->border_width = XINT (arg); |
389 | 818 } |
819 | |
820 void | |
771 | 821 x_set_internal_border_width (f, arg, oldval) |
822 struct frame *f; | |
389 | 823 Lisp_Object arg, oldval; |
824 { | |
825 int mask; | |
771 | 826 int old = f->display.x->internal_border_width; |
389 | 827 |
828 CHECK_NUMBER (arg, 0); | |
771 | 829 f->display.x->internal_border_width = XINT (arg); |
830 if (f->display.x->internal_border_width < 0) | |
831 f->display.x->internal_border_width = 0; | |
832 | |
833 if (f->display.x->internal_border_width == old) | |
389 | 834 return; |
835 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
836 if (FRAME_X_WINDOW (f) != 0) |
389 | 837 { |
838 BLOCK_INPUT; | |
771 | 839 x_set_window_size (f, f->width, f->height); |
389 | 840 #if 0 |
771 | 841 x_set_resize_hint (f); |
389 | 842 #endif |
843 XFlushQueue (); | |
844 UNBLOCK_INPUT; | |
771 | 845 SET_FRAME_GARBAGED (f); |
389 | 846 } |
847 } | |
848 | |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
849 void |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
850 x_set_visibility (f, value, oldval) |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
851 struct frame *f; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
852 Lisp_Object value, oldval; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
853 { |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
854 Lisp_Object frame; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
855 XSET (frame, Lisp_Frame, f); |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
856 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
857 if (NILP (value)) |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
858 Fmake_frame_invisible (frame); |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
859 else if (EQ (value, Qicon)) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
860 Ficonify_frame (frame); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
861 else |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
862 Fmake_frame_visible (frame); |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
863 } |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
864 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
865 static void |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
866 x_set_menu_bar_lines_1 (window, n) |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
867 Lisp_Object window; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
868 int n; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
869 { |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
870 for (; !NILP (window); window = XWINDOW (window)->next) |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
871 { |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
872 struct window *w = XWINDOW (window); |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
873 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
874 w->top += n; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
875 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
876 if (!NILP (w->vchild)) |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
877 x_set_menu_bar_lines_1 (w->vchild); |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
878 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
879 if (!NILP (w->hchild)) |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
880 x_set_menu_bar_lines_1 (w->hchild); |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
881 } |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
882 } |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
883 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
884 void |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
885 x_set_menu_bar_lines (f, value, oldval) |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
886 struct frame *f; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
887 Lisp_Object value, oldval; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
888 { |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
889 int nlines; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
890 int olines = FRAME_MENU_BAR_LINES (f); |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
891 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
892 if (XTYPE (value) == Lisp_Int) |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
893 nlines = XINT (value); |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
894 else |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
895 nlines = 0; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
896 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
897 FRAME_MENU_BAR_LINES (f) = nlines; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
898 x_set_menu_bar_lines_1 (f->root_window, nlines - olines); |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
899 x_set_window_size (f, FRAME_WIDTH (f), |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
900 FRAME_HEIGHT (f) + nlines - olines); |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
901 } |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
902 |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
903 /* Change the name of frame F to ARG. If ARG is nil, set F's name to |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
904 x_id_name. |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
905 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
906 If EXPLICIT is non-zero, that indicates that lisp code is setting the |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
907 name; if ARG is a string, set F's name to ARG and set |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
908 F->explicit_name; if ARG is Qnil, then clear F->explicit_name. |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
909 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
910 If EXPLICIT is zero, that indicates that Emacs redisplay code is |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
911 suggesting a new name, which lisp code should override; if |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
912 F->explicit_name is set, ignore the new name; otherwise, set it. */ |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
913 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
914 void |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
915 x_set_name (f, name, explicit) |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
916 struct frame *f; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
917 Lisp_Object name; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
918 int explicit; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
919 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
920 /* Make sure that requests from lisp code override requests from |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
921 Emacs redisplay code. */ |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
922 if (explicit) |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
923 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
924 /* If we're switching from explicit to implicit, we had better |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
925 update the mode lines and thereby update the title. */ |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
926 if (f->explicit_name && NILP (name)) |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
927 update_mode_lines = 1; |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
928 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
929 f->explicit_name = ! NILP (name); |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
930 } |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
931 else if (f->explicit_name) |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
932 return; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
933 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
934 /* If NAME is nil, set the name to the x_id_name. */ |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
935 if (NILP (name)) |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
936 name = build_string (x_id_name); |
833 | 937 else |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
938 CHECK_STRING (name, 0); |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
939 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
940 /* Don't change the name if it's already NAME. */ |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
941 if (! NILP (Fstring_equal (name, f->name))) |
727 | 942 return; |
943 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
944 if (FRAME_X_WINDOW (f)) |
389 | 945 { |
708 | 946 BLOCK_INPUT; |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
947 |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
948 #ifdef HAVE_X11R4 |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
949 { |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
950 XTextProperty text; |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
951 text.value = XSTRING (name)->data; |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
952 text.encoding = XA_STRING; |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
953 text.format = 8; |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
954 text.nitems = XSTRING (name)->size; |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
955 XSetWMName (x_current_display, FRAME_X_WINDOW (f), &text); |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
956 XSetWMIconName (x_current_display, FRAME_X_WINDOW (f), &text); |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
957 } |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
958 #else |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
959 XSetIconName (XDISPLAY FRAME_X_WINDOW (f), |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
960 XSTRING (name)->data); |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
961 XStoreName (XDISPLAY FRAME_X_WINDOW (f), |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
962 XSTRING (name)->data); |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
963 #endif |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
964 |
708 | 965 UNBLOCK_INPUT; |
389 | 966 } |
727 | 967 |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
968 f->name = name; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
969 } |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
970 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
971 /* This function should be called when the user's lisp code has |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
972 specified a name for the frame; the name will override any set by the |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
973 redisplay code. */ |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
974 void |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
975 x_explicitly_set_name (f, arg, oldval) |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
976 FRAME_PTR f; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
977 Lisp_Object arg, oldval; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
978 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
979 x_set_name (f, arg, 1); |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
980 } |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
981 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
982 /* This function should be called by Emacs redisplay code to set the |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
983 name; names set this way will never override names set by the user's |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
984 lisp code. */ |
1125
059624bf9bf0
Declare x_implicitly_set_name to be void.
Jim Blandy <jimb@redhat.com>
parents:
1096
diff
changeset
|
985 void |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
986 x_implicitly_set_name (f, arg, oldval) |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
987 FRAME_PTR f; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
988 Lisp_Object arg, oldval; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
989 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
990 x_set_name (f, arg, 0); |
389 | 991 } |
992 | |
993 void | |
771 | 994 x_set_autoraise (f, arg, oldval) |
995 struct frame *f; | |
389 | 996 Lisp_Object arg, oldval; |
997 { | |
771 | 998 f->auto_raise = !EQ (Qnil, arg); |
389 | 999 } |
1000 | |
1001 void | |
771 | 1002 x_set_autolower (f, arg, oldval) |
1003 struct frame *f; | |
389 | 1004 Lisp_Object arg, oldval; |
1005 { | |
771 | 1006 f->auto_lower = !EQ (Qnil, arg); |
389 | 1007 } |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1008 |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1009 void |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1010 x_set_vertical_scroll_bars (f, arg, oldval) |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1011 struct frame *f; |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1012 Lisp_Object arg, oldval; |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1013 { |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1014 if (NILP (arg) != ! FRAME_HAS_VERTICAL_SCROLL_BARS (f)) |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1015 { |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1016 FRAME_HAS_VERTICAL_SCROLL_BARS (f) = ! NILP (arg); |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1017 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1018 /* We set this parameter before creating the X window for the |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1019 frame, so we can get the geometry right from the start. |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1020 However, if the window hasn't been created yet, we shouldn't |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1021 call x_set_window_size. */ |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1022 if (FRAME_X_WINDOW (f)) |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1023 x_set_window_size (f, FRAME_WIDTH (f), FRAME_HEIGHT (f)); |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1024 } |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1025 } |
389 | 1026 |
1027 #ifdef HAVE_X11 | |
1028 int n_faces; | |
1029 | |
1438
57f20a185901
Same. * xfns.c (x_set_face): Dyked out this function; it has no callers,
Jim Blandy <jimb@redhat.com>
parents:
1125
diff
changeset
|
1030 #if 0 |
57f20a185901
Same. * xfns.c (x_set_face): Dyked out this function; it has no callers,
Jim Blandy <jimb@redhat.com>
parents:
1125
diff
changeset
|
1031 /* I believe this function is obsolete with respect to the new face display |
57f20a185901
Same. * xfns.c (x_set_face): Dyked out this function; it has no callers,
Jim Blandy <jimb@redhat.com>
parents:
1125
diff
changeset
|
1032 changes. */ |
389 | 1033 x_set_face (scr, font, background, foreground, stipple) |
771 | 1034 struct frame *scr; |
389 | 1035 XFontStruct *font; |
1036 unsigned long background, foreground; | |
1037 Pixmap stipple; | |
1038 { | |
1039 XGCValues gc_values; | |
1040 GC temp_gc; | |
1041 unsigned long gc_mask; | |
1042 struct face *new_face; | |
1043 unsigned int width = 16; | |
1044 unsigned int height = 16; | |
1045 | |
1046 if (n_faces == MAX_FACES_AND_GLYPHS) | |
1047 return 1; | |
1048 | |
1049 /* Create the Graphics Context. */ | |
1050 gc_values.font = font->fid; | |
1051 gc_values.foreground = foreground; | |
1052 gc_values.background = background; | |
1053 gc_values.line_width = 0; | |
1054 gc_mask = GCLineWidth | GCFont | GCForeground | GCBackground; | |
1055 if (stipple) | |
1056 { | |
1057 gc_values.stipple | |
1058 = XCreateBitmapFromData (x_current_display, ROOT_WINDOW, | |
1059 (char *) stipple, width, height); | |
1060 gc_mask |= GCStipple; | |
1061 } | |
1062 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
1063 temp_gc = XCreateGC (x_current_display, FRAME_X_WINDOW (scr), |
389 | 1064 gc_mask, &gc_values); |
1065 if (!temp_gc) | |
1066 return 1; | |
1067 new_face = (struct face *) xmalloc (sizeof (struct face)); | |
1068 if (!new_face) | |
1069 { | |
1070 XFreeGC (x_current_display, temp_gc); | |
1071 return 1; | |
1072 } | |
1073 | |
1074 new_face->font = font; | |
1075 new_face->foreground = foreground; | |
1076 new_face->background = background; | |
1077 new_face->face_gc = temp_gc; | |
1078 if (stipple) | |
1079 new_face->stipple = gc_values.stipple; | |
1080 | |
1081 x_face_table[++n_faces] = new_face; | |
1082 return 1; | |
1083 } | |
1438
57f20a185901
Same. * xfns.c (x_set_face): Dyked out this function; it has no callers,
Jim Blandy <jimb@redhat.com>
parents:
1125
diff
changeset
|
1084 #endif |
389 | 1085 |
1086 x_set_glyph (scr, glyph) | |
1087 { | |
1088 } | |
1089 | |
1090 #if 0 | |
1091 DEFUN ("x-set-face-font", Fx_set_face_font, Sx_set_face_font, 4, 2, 0, | |
1092 "Specify face table entry FACE-CODE to be the font named by FONT,\n\ | |
1093 in colors FOREGROUND and BACKGROUND.") | |
1094 (face_code, font_name, foreground, background) | |
1095 Lisp_Object face_code; | |
1096 Lisp_Object font_name; | |
1097 Lisp_Object foreground; | |
1098 Lisp_Object background; | |
1099 { | |
1100 register struct face *fp; /* Current face info. */ | |
1101 register int fn; /* Face number. */ | |
1102 register FONT_TYPE *f; /* Font data structure. */ | |
1103 unsigned char *newname; | |
1104 int fg, bg; | |
1105 GC temp_gc; | |
1106 XGCValues gc_values; | |
1107 | |
1108 /* Need to do something about this. */ | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
1109 Drawable drawable = FRAME_X_WINDOW (selected_frame); |
389 | 1110 |
1111 CHECK_NUMBER (face_code, 1); | |
1112 CHECK_STRING (font_name, 2); | |
1113 | |
1114 if (EQ (foreground, Qnil) || EQ (background, Qnil)) | |
1115 { | |
771 | 1116 fg = selected_frame->display.x->foreground_pixel; |
1117 bg = selected_frame->display.x->background_pixel; | |
389 | 1118 } |
1119 else | |
1120 { | |
1121 CHECK_NUMBER (foreground, 0); | |
1122 CHECK_NUMBER (background, 1); | |
1123 | |
1124 fg = x_decode_color (XINT (foreground), BLACK_PIX_DEFAULT); | |
1125 bg = x_decode_color (XINT (background), WHITE_PIX_DEFAULT); | |
1126 } | |
1127 | |
1128 fn = XINT (face_code); | |
1129 if ((fn < 1) || (fn > 255)) | |
1130 error ("Invalid face code, %d", fn); | |
1131 | |
1132 newname = XSTRING (font_name)->data; | |
1133 BLOCK_INPUT; | |
1134 f = (*newname == 0 ? 0 : XGetFont (newname)); | |
1135 UNBLOCK_INPUT; | |
1136 if (f == 0) | |
1137 error ("Font \"%s\" is not defined", newname); | |
1138 | |
1139 fp = x_face_table[fn]; | |
1140 if (fp == 0) | |
1141 { | |
1142 x_face_table[fn] = fp = (struct face *) xmalloc (sizeof (struct face)); | |
1143 bzero (fp, sizeof (struct face)); | |
1144 fp->face_type = x_pixmap; | |
1145 } | |
1146 else if (FACE_IS_FONT (fn)) | |
1147 { | |
1148 BLOCK_INPUT; | |
1149 XFreeGC (FACE_FONT (fn)); | |
1150 UNBLOCK_INPUT; | |
1151 } | |
1152 else if (FACE_IS_IMAGE (fn)) /* This should not happen... */ | |
1153 { | |
1154 BLOCK_INPUT; | |
1155 XFreePixmap (x_current_display, FACE_IMAGE (fn)); | |
1156 fp->face_type = x_font; | |
1157 UNBLOCK_INPUT; | |
1158 } | |
1159 else | |
1160 abort (); | |
1161 | |
1162 fp->face_GLYPH.font_desc.font = f; | |
1163 gc_values.font = f->fid; | |
1164 gc_values.foreground = fg; | |
1165 gc_values.background = bg; | |
1166 fp->face_GLYPH.font_desc.face_gc = XCreateGC (x_current_display, | |
1167 drawable, GCFont | GCForeground | |
1168 | GCBackground, &gc_values); | |
1169 fp->face_GLYPH.font_desc.font_width = FONT_WIDTH (f); | |
1170 fp->face_GLYPH.font_desc.font_height = FONT_HEIGHT (f); | |
1171 | |
1172 return face_code; | |
1173 } | |
1174 #endif | |
1175 #else /* X10 */ | |
1176 DEFUN ("x-set-face", Fx_set_face, Sx_set_face, 4, 4, 0, | |
1177 "Specify face table entry FACE-CODE to be the font named by FONT,\n\ | |
1178 in colors FOREGROUND and BACKGROUND.") | |
1179 (face_code, font_name, foreground, background) | |
1180 Lisp_Object face_code; | |
1181 Lisp_Object font_name; | |
1182 Lisp_Object foreground; | |
1183 Lisp_Object background; | |
1184 { | |
1185 register struct face *fp; /* Current face info. */ | |
1186 register int fn; /* Face number. */ | |
1187 register FONT_TYPE *f; /* Font data structure. */ | |
1188 unsigned char *newname; | |
1189 | |
1190 CHECK_NUMBER (face_code, 1); | |
1191 CHECK_STRING (font_name, 2); | |
1192 | |
1193 fn = XINT (face_code); | |
1194 if ((fn < 1) || (fn > 255)) | |
1195 error ("Invalid face code, %d", fn); | |
1196 | |
1197 /* Ask the server to find the specified font. */ | |
1198 newname = XSTRING (font_name)->data; | |
1199 BLOCK_INPUT; | |
1200 f = (*newname == 0 ? 0 : XGetFont (newname)); | |
1201 UNBLOCK_INPUT; | |
1202 if (f == 0) | |
1203 error ("Font \"%s\" is not defined", newname); | |
1204 | |
1205 /* Get the face structure for face_code in the face table. | |
1206 Make sure it exists. */ | |
1207 fp = x_face_table[fn]; | |
1208 if (fp == 0) | |
1209 { | |
1210 x_face_table[fn] = fp = (struct face *) xmalloc (sizeof (struct face)); | |
1211 bzero (fp, sizeof (struct face)); | |
1212 } | |
1213 | |
1214 /* If this face code already exists, get rid of the old font. */ | |
1215 if (fp->font != 0 && fp->font != f) | |
1216 { | |
1217 BLOCK_INPUT; | |
1218 XLoseFont (fp->font); | |
1219 UNBLOCK_INPUT; | |
1220 } | |
1221 | |
1222 /* Store the specified information in FP. */ | |
1223 fp->fg = x_decode_color (foreground, BLACK_PIX_DEFAULT); | |
1224 fp->bg = x_decode_color (background, WHITE_PIX_DEFAULT); | |
1225 fp->font = f; | |
1226 | |
1227 return face_code; | |
1228 } | |
1229 #endif /* X10 */ | |
1230 | |
1231 #if 0 | |
1232 /* This is excluded because there is no painless way | |
1233 to get or to remember the name of the font. */ | |
1234 | |
1235 DEFUN ("x-get-face", Fx_get_face, Sx_get_face, 1, 1, 0, | |
1236 "Get data defining face code FACE. FACE is an integer.\n\ | |
1237 The value is a list (FONT FG-COLOR BG-COLOR).") | |
1238 (face) | |
1239 Lisp_Object face; | |
1240 { | |
1241 register struct face *fp; /* Current face info. */ | |
1242 register int fn; /* Face number. */ | |
1243 | |
1244 CHECK_NUMBER (face, 1); | |
1245 fn = XINT (face); | |
1246 if ((fn < 1) || (fn > 255)) | |
1247 error ("Invalid face code, %d", fn); | |
1248 | |
1249 /* Make sure the face table exists and this face code is defined. */ | |
1250 if (x_face_table == 0 || x_face_table[fn] == 0) | |
1251 return Qnil; | |
1252 | |
1253 fp = x_face_table[fn]; | |
1254 | |
1255 return Fcons (build_string (fp->name), | |
1256 Fcons (make_number (fp->fg), | |
1257 Fcons (make_number (fp->bg), Qnil))); | |
1258 } | |
1259 #endif /* 0 */ | |
1260 | |
771 | 1261 /* Subroutines of creating an X frame. */ |
389 | 1262 |
1263 #ifdef HAVE_X11 | |
1264 extern char *x_get_string_resource (); | |
1265 extern XrmDatabase x_load_resources (); | |
1266 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1267 DEFUN ("x-get-resource", Fx_get_resource, Sx_get_resource, 2, 4, 0, |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1268 "Return the value of ATTRIBUTE, of class CLASS, from the X defaults database.\n\ |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1269 This uses `INSTANCE.ATTRIBUTE' as the key and `Emacs.CLASS' as the\n\ |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1270 class, where INSTANCE is the name under which Emacs was invoked.\n\ |
389 | 1271 \n\ |
1733
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1272 The optional arguments COMPONENT and SUBCLASS add to the key and the\n\ |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1273 class, respectively. You must specify both of them or neither.\n\ |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1274 If you specify them, the key is `INSTANCE.COMPONENT.ATTRIBUTE'\n\ |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1275 and the class is `Emacs.CLASS.SUBCLASS'.") |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1276 (attribute, class, component, subclass) |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1277 Lisp_Object attribute, class, component, subclass; |
389 | 1278 { |
1279 register char *value; | |
1280 char *name_key; | |
1281 char *class_key; | |
1282 | |
1283 CHECK_STRING (attribute, 0); | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1284 CHECK_STRING (class, 0); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1285 |
1733
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1286 if (!NILP (component)) |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1287 CHECK_STRING (component, 1); |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1288 if (!NILP (subclass)) |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1289 CHECK_STRING (subclass, 2); |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1290 if (NILP (component) != NILP (subclass)) |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1291 error ("x-get-resource: must specify both COMPONENT and SUBCLASS or neither"); |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1292 |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1293 if (NILP (component)) |
389 | 1294 { |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1295 /* Allocate space for the components, the dots which separate them, |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1296 and the final '\0'. */ |
2279
012b04efa234
* emacs.c (Finvocation_name): New function.
Jim Blandy <jimb@redhat.com>
parents:
2277
diff
changeset
|
1297 name_key = (char *) alloca (XSTRING (Vinvocation_name)->size |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1298 + XSTRING (attribute)->size |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1299 + 2); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1300 class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1301 + XSTRING (class)->size |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1302 + 2); |
398 | 1303 |
389 | 1304 sprintf (name_key, "%s.%s", |
2279
012b04efa234
* emacs.c (Finvocation_name): New function.
Jim Blandy <jimb@redhat.com>
parents:
2277
diff
changeset
|
1305 XSTRING (Vinvocation_name)->data, |
389 | 1306 XSTRING (attribute)->data); |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1307 sprintf (class_key, "%s.%s", |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1308 EMACS_CLASS, |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1309 XSTRING (class)->data); |
389 | 1310 } |
1311 else | |
1312 { | |
2279
012b04efa234
* emacs.c (Finvocation_name): New function.
Jim Blandy <jimb@redhat.com>
parents:
2277
diff
changeset
|
1313 name_key = (char *) alloca (XSTRING (Vinvocation_name)->size |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1314 + XSTRING (component)->size |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1315 + XSTRING (attribute)->size |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1316 + 3); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1317 |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1318 class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1319 + XSTRING (class)->size |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1320 + XSTRING (subclass)->size |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1321 + 3); |
389 | 1322 |
1323 sprintf (name_key, "%s.%s.%s", | |
2279
012b04efa234
* emacs.c (Finvocation_name): New function.
Jim Blandy <jimb@redhat.com>
parents:
2277
diff
changeset
|
1324 XSTRING (Vinvocation_name)->data, |
1733
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1325 XSTRING (component)->data, |
389 | 1326 XSTRING (attribute)->data); |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1327 sprintf (class_key, "%s.%s", |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1328 EMACS_CLASS, |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1329 XSTRING (class)->data, |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1330 XSTRING (subclass)->data); |
389 | 1331 } |
1332 | |
1333 value = x_get_string_resource (xrdb, name_key, class_key); | |
1334 | |
1335 if (value != (char *) 0) | |
1336 return build_string (value); | |
1337 else | |
1338 return Qnil; | |
1339 } | |
1340 | |
1341 #else /* X10 */ | |
1342 | |
398 | 1343 DEFUN ("x-get-default", Fx_get_default, Sx_get_default, 1, 1, 0, |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1344 "Get X default ATTRIBUTE from the system, or nil if no default.\n\ |
389 | 1345 Value is a string (when not nil) and ATTRIBUTE is also a string.\n\ |
1346 The defaults are specified in the file `~/.Xdefaults'.") | |
398 | 1347 (arg) |
1348 Lisp_Object arg; | |
389 | 1349 { |
1350 register unsigned char *value; | |
1351 | |
1352 CHECK_STRING (arg, 1); | |
1353 | |
1354 value = (unsigned char *) XGetDefault (XDISPLAY | |
2279
012b04efa234
* emacs.c (Finvocation_name): New function.
Jim Blandy <jimb@redhat.com>
parents:
2277
diff
changeset
|
1355 XSTRING (Vinvocation_name)->data, |
389 | 1356 XSTRING (arg)->data); |
1357 if (value == 0) | |
1358 /* Try reversing last two args, in case this is the buggy version of X. */ | |
1359 value = (unsigned char *) XGetDefault (XDISPLAY | |
1360 XSTRING (arg)->data, | |
2279
012b04efa234
* emacs.c (Finvocation_name): New function.
Jim Blandy <jimb@redhat.com>
parents:
2277
diff
changeset
|
1361 XSTRING (Vinvocation_name)->data); |
389 | 1362 if (value != 0) |
1363 return build_string (value); | |
1364 else | |
1365 return (Qnil); | |
1366 } | |
1367 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1368 #define Fx_get_resource(attribute, class, component, subclass) \ |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1369 Fx_get_default(attribute) |
389 | 1370 |
1371 #endif /* X10 */ | |
1372 | |
398 | 1373 /* Types we might convert a resource string into. */ |
1374 enum resource_types | |
1375 { | |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1376 number, boolean, string, symbol, |
398 | 1377 }; |
1378 | |
389 | 1379 /* Return the value of parameter PARAM. |
398 | 1380 |
771 | 1381 First search ALIST, then Vdefault_frame_alist, then the X defaults |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1382 database, using ATTRIBUTE as the attribute name and CLASS as its class. |
398 | 1383 |
1384 Convert the resource to the type specified by desired_type. | |
1385 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1386 If no default is specified, return Qunbound. If you call |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1387 x_get_arg, make sure you deal with Qunbound in a reasonable way, |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1388 and don't let it get stored in any lisp-visible variables! */ |
389 | 1389 |
1390 static Lisp_Object | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1391 x_get_arg (alist, param, attribute, class, type) |
641 | 1392 Lisp_Object alist, param; |
398 | 1393 char *attribute; |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1394 char *class; |
398 | 1395 enum resource_types type; |
389 | 1396 { |
1397 register Lisp_Object tem; | |
1398 | |
1399 tem = Fassq (param, alist); | |
1400 if (EQ (tem, Qnil)) | |
771 | 1401 tem = Fassq (param, Vdefault_frame_alist); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1402 if (EQ (tem, Qnil)) |
389 | 1403 { |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1404 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1405 if (attribute) |
398 | 1406 { |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1407 tem = Fx_get_resource (build_string (attribute), |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1408 build_string (class), |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1409 Qnil, Qnil); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1410 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1411 if (NILP (tem)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1412 return Qunbound; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1413 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1414 switch (type) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1415 { |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1416 case number: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1417 return make_number (atoi (XSTRING (tem)->data)); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1418 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1419 case boolean: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1420 tem = Fdowncase (tem); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1421 if (!strcmp (XSTRING (tem)->data, "on") |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1422 || !strcmp (XSTRING (tem)->data, "true")) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1423 return Qt; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1424 else |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1425 return Qnil; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1426 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1427 case string: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1428 return tem; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1429 |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1430 case symbol: |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1431 /* As a special case, we map the values `true' and `on' |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1432 to Qt, and `false' and `off' to Qnil. */ |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1433 { |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1434 Lisp_Object lower = Fdowncase (tem); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1435 if (!strcmp (XSTRING (tem)->data, "on") |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1436 || !strcmp (XSTRING (tem)->data, "true")) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1437 return Qt; |
2295 | 1438 else if (!strcmp (XSTRING (tem)->data, "off") |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1439 || !strcmp (XSTRING (tem)->data, "false")) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1440 return Qnil; |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1441 else |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1442 return intern (tem); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1443 } |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1444 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1445 default: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1446 abort (); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1447 } |
398 | 1448 } |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1449 else |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1450 return Qunbound; |
389 | 1451 } |
1452 return Fcdr (tem); | |
1453 } | |
1454 | |
771 | 1455 /* Record in frame F the specified or default value according to ALIST |
389 | 1456 of the parameter named PARAM (a Lisp symbol). |
1457 If no value is specified for PARAM, look for an X default for XPROP | |
771 | 1458 on the frame named NAME. |
389 | 1459 If that is not found either, use the value DEFLT. */ |
1460 | |
1461 static Lisp_Object | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1462 x_default_parameter (f, alist, prop, deflt, xprop, xclass, type) |
771 | 1463 struct frame *f; |
389 | 1464 Lisp_Object alist; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1465 Lisp_Object prop; |
389 | 1466 Lisp_Object deflt; |
1467 char *xprop; | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1468 char *xclass; |
398 | 1469 enum resource_types type; |
389 | 1470 { |
1471 Lisp_Object tem; | |
1472 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1473 tem = x_get_arg (alist, prop, xprop, xclass, type); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1474 if (EQ (tem, Qunbound)) |
389 | 1475 tem = deflt; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1476 x_set_frame_parameters (f, Fcons (Fcons (prop, tem), Qnil)); |
389 | 1477 return tem; |
1478 } | |
1479 | |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
1480 DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0, |
389 | 1481 "Parse an X-style geometry string STRING.\n\ |
1482 Returns an alist of the form ((top . TOP), (left . LEFT) ... ).") | |
1483 (string) | |
1528
924c8a609582
* xfns.c (x_decode_color, Fx_color_display_p): x_screen_planes is
Jim Blandy <jimb@redhat.com>
parents:
1438
diff
changeset
|
1484 Lisp_Object string; |
389 | 1485 { |
1486 int geometry, x, y; | |
1487 unsigned int width, height; | |
1488 Lisp_Object values[4]; | |
1489 | |
1490 CHECK_STRING (string, 0); | |
1491 | |
1492 geometry = XParseGeometry ((char *) XSTRING (string)->data, | |
1493 &x, &y, &width, &height); | |
1494 | |
1495 switch (geometry & 0xf) /* Mask out {X,Y}Negative */ | |
1496 { | |
1497 case (XValue | YValue): | |
1498 /* What's one pixel among friends? | |
1499 Perhaps fix this some day by returning symbol `extreme-top'... */ | |
1500 if (x == 0 && (geometry & XNegative)) | |
1501 x = -1; | |
1502 if (y == 0 && (geometry & YNegative)) | |
1503 y = -1; | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1504 values[0] = Fcons (Qleft, make_number (x)); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1505 values[1] = Fcons (Qtop, make_number (y)); |
389 | 1506 return Flist (2, values); |
1507 break; | |
1508 | |
1509 case (WidthValue | HeightValue): | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1510 values[0] = Fcons (Qwidth, make_number (width)); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1511 values[1] = Fcons (Qheight, make_number (height)); |
389 | 1512 return Flist (2, values); |
1513 break; | |
1514 | |
1515 case (XValue | YValue | WidthValue | HeightValue): | |
1516 if (x == 0 && (geometry & XNegative)) | |
1517 x = -1; | |
1518 if (y == 0 && (geometry & YNegative)) | |
1519 y = -1; | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1520 values[0] = Fcons (Qwidth, make_number (width)); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1521 values[1] = Fcons (Qheight, make_number (height)); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1522 values[2] = Fcons (Qleft, make_number (x)); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1523 values[3] = Fcons (Qtop, make_number (y)); |
389 | 1524 return Flist (4, values); |
1525 break; | |
1526 | |
1527 case 0: | |
1528 return Qnil; | |
1529 | |
1530 default: | |
1531 error ("Must specify x and y value, and/or width and height"); | |
1532 } | |
1533 } | |
1534 | |
1535 #ifdef HAVE_X11 | |
1536 /* Calculate the desired size and position of this window, | |
1537 or set rubber-band prompting if none. */ | |
1538 | |
1539 #define DEFAULT_ROWS 40 | |
1540 #define DEFAULT_COLS 80 | |
1541 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1542 static int |
771 | 1543 x_figure_window_size (f, parms) |
1544 struct frame *f; | |
389 | 1545 Lisp_Object parms; |
1546 { | |
1547 register Lisp_Object tem0, tem1; | |
1548 int height, width, left, top; | |
1549 register int geometry; | |
1550 long window_prompting = 0; | |
1551 | |
1552 /* Default values if we fall through. | |
1553 Actually, if that happens we should get | |
1554 window manager prompting. */ | |
771 | 1555 f->width = DEFAULT_COLS; |
1556 f->height = DEFAULT_ROWS; | |
1557 f->display.x->top_pos = 1; | |
1558 f->display.x->left_pos = 1; | |
389 | 1559 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1560 tem0 = x_get_arg (parms, Qheight, 0, 0, number); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1561 tem1 = x_get_arg (parms, Qwidth, 0, 0, number); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1562 if (! EQ (tem0, Qunbound) && ! EQ (tem1, Qunbound)) |
389 | 1563 { |
1564 CHECK_NUMBER (tem0, 0); | |
1565 CHECK_NUMBER (tem1, 0); | |
771 | 1566 f->height = XINT (tem0); |
1567 f->width = XINT (tem1); | |
389 | 1568 window_prompting |= USSize; |
1569 } | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1570 else if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) |
389 | 1571 error ("Must specify *both* height and width"); |
1572 | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1573 f->display.x->vertical_scroll_bar_extra = |
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1574 (FRAME_HAS_VERTICAL_SCROLL_BARS (f) |
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1575 ? VERTICAL_SCROLL_BAR_PIXEL_WIDTH (f) |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1576 : 0); |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1577 f->display.x->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width); |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1578 f->display.x->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height); |
389 | 1579 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1580 tem0 = x_get_arg (parms, Qtop, 0, 0, number); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1581 tem1 = x_get_arg (parms, Qleft, 0, 0, number); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1582 if (! EQ (tem0, Qunbound) && ! EQ (tem1, Qunbound)) |
389 | 1583 { |
1584 CHECK_NUMBER (tem0, 0); | |
1585 CHECK_NUMBER (tem1, 0); | |
771 | 1586 f->display.x->top_pos = XINT (tem0); |
1587 f->display.x->left_pos = XINT (tem1); | |
1588 x_calc_absolute_position (f); | |
389 | 1589 window_prompting |= USPosition; |
1590 } | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1591 else if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) |
389 | 1592 error ("Must specify *both* top and left corners"); |
1593 | |
1594 switch (window_prompting) | |
1595 { | |
1596 case USSize | USPosition: | |
1597 return window_prompting; | |
1598 break; | |
1599 | |
1600 case USSize: /* Got the size, need the position. */ | |
1601 window_prompting |= PPosition; | |
1602 return window_prompting; | |
1603 break; | |
1604 | |
1605 case USPosition: /* Got the position, need the size. */ | |
1606 window_prompting |= PSize; | |
1607 return window_prompting; | |
1608 break; | |
1609 | |
1610 case 0: /* Got nothing, take both from geometry. */ | |
1611 window_prompting |= PPosition | PSize; | |
1612 return window_prompting; | |
1613 break; | |
1614 | |
1615 default: | |
1616 /* Somehow a bit got set in window_prompting that we didn't | |
1617 put there. */ | |
1618 abort (); | |
1619 } | |
1620 } | |
1621 | |
1622 static void | |
771 | 1623 x_window (f) |
1624 struct frame *f; | |
389 | 1625 { |
1626 XSetWindowAttributes attributes; | |
1627 unsigned long attribute_mask; | |
1628 XClassHint class_hints; | |
1629 | |
771 | 1630 attributes.background_pixel = f->display.x->background_pixel; |
1631 attributes.border_pixel = f->display.x->border_pixel; | |
389 | 1632 attributes.bit_gravity = StaticGravity; |
1633 attributes.backing_store = NotUseful; | |
1634 attributes.save_under = True; | |
1635 attributes.event_mask = STANDARD_EVENT_SET; | |
1636 attribute_mask = (CWBackPixel | CWBorderPixel | CWBitGravity | |
1637 #if 0 | |
1638 | CWBackingStore | CWSaveUnder | |
1639 #endif | |
1640 | CWEventMask); | |
1641 | |
1642 BLOCK_INPUT; | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
1643 FRAME_X_WINDOW (f) |
389 | 1644 = XCreateWindow (x_current_display, ROOT_WINDOW, |
771 | 1645 f->display.x->left_pos, |
1646 f->display.x->top_pos, | |
1647 PIXEL_WIDTH (f), PIXEL_HEIGHT (f), | |
1648 f->display.x->border_width, | |
389 | 1649 CopyFromParent, /* depth */ |
1650 InputOutput, /* class */ | |
1651 screen_visual, /* set in Fx_open_connection */ | |
1652 attribute_mask, &attributes); | |
1653 | |
771 | 1654 class_hints.res_name = (char *) XSTRING (f->name)->data; |
389 | 1655 class_hints.res_class = EMACS_CLASS; |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
1656 XSetClassHint (x_current_display, FRAME_X_WINDOW (f), &class_hints); |
771 | 1657 |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1658 /* This indicates that we use the "Passive Input" input model. |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1659 Unless we do this, we don't get the Focus{In,Out} events that we |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1660 need to draw the cursor correctly. Accursed bureaucrats. |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1661 XWhipsAndChains (x_current_display, IronMaiden, &TheRack); */ |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1662 |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1663 f->display.x->wm_hints.input = True; |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1664 f->display.x->wm_hints.flags |= InputHint; |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1665 XSetWMHints (x_current_display, FRAME_X_WINDOW (f), &f->display.x->wm_hints); |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1666 |
817 | 1667 /* x_set_name normally ignores requests to set the name if the |
1668 requested name is the same as the current name. This is the one | |
1669 place where that assumption isn't correct; f->name is set, but | |
1670 the X server hasn't been told. */ | |
1671 { | |
1672 Lisp_Object name = f->name; | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1673 int explicit = f->explicit_name; |
817 | 1674 |
1675 f->name = Qnil; | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1676 f->explicit_name = 0; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1677 x_set_name (f, name, explicit); |
817 | 1678 } |
1679 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
1680 XDefineCursor (XDISPLAY FRAME_X_WINDOW (f), |
771 | 1681 f->display.x->text_cursor); |
389 | 1682 UNBLOCK_INPUT; |
1683 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
1684 if (FRAME_X_WINDOW (f) == 0) |
389 | 1685 error ("Unable to create window."); |
1686 } | |
1687 | |
1688 /* Handle the icon stuff for this window. Perhaps later we might | |
1689 want an x_set_icon_position which can be called interactively as | |
1690 well. */ | |
1691 | |
1692 static void | |
771 | 1693 x_icon (f, parms) |
1694 struct frame *f; | |
389 | 1695 Lisp_Object parms; |
1696 { | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1697 Lisp_Object icon_x, icon_y; |
389 | 1698 |
1699 /* Set the position of the icon. Note that twm groups all | |
1700 icons in an icon window. */ | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1701 icon_x = x_get_arg (parms, Qicon_left, 0, 0, number); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1702 icon_y = x_get_arg (parms, Qicon_top, 0, 0, number); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1703 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) |
389 | 1704 { |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1705 CHECK_NUMBER (icon_x, 0); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1706 CHECK_NUMBER (icon_y, 0); |
389 | 1707 } |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1708 else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound)) |
389 | 1709 error ("Both left and top icon corners of icon must be specified"); |
1710 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1711 BLOCK_INPUT; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1712 |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
1713 if (! EQ (icon_x, Qunbound)) |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
1714 x_wm_set_icon_position (f, XINT (icon_x), XINT (icon_y)); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1715 |
389 | 1716 /* Start up iconic or window? */ |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1717 x_wm_set_window_state |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1718 (f, (EQ (x_get_arg (parms, Qvisibility, 0, 0, symbol), Qicon) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1719 ? IconicState |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1720 : NormalState)); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1721 |
389 | 1722 UNBLOCK_INPUT; |
1723 } | |
1724 | |
1725 /* Make the GC's needed for this window, setting the | |
1726 background, border and mouse colors; also create the | |
1727 mouse cursor and the gray border tile. */ | |
1728 | |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1729 static char cursor_bits[] = |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1730 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1731 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1732 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1733 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1734 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1735 }; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1736 |
389 | 1737 static void |
771 | 1738 x_make_gc (f) |
1739 struct frame *f; | |
389 | 1740 { |
1741 XGCValues gc_values; | |
1742 GC temp_gc; | |
1743 XImage tileimage; | |
1744 | |
2341
1982e2983822
* xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents:
2328
diff
changeset
|
1745 BLOCK_INPUT; |
1982e2983822
* xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents:
2328
diff
changeset
|
1746 |
771 | 1747 /* Create the GC's of this frame. |
389 | 1748 Note that many default values are used. */ |
1749 | |
1750 /* Normal video */ | |
771 | 1751 gc_values.font = f->display.x->font->fid; |
1752 gc_values.foreground = f->display.x->foreground_pixel; | |
1753 gc_values.background = f->display.x->background_pixel; | |
389 | 1754 gc_values.line_width = 0; /* Means 1 using fast algorithm. */ |
771 | 1755 f->display.x->normal_gc = XCreateGC (x_current_display, |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
1756 FRAME_X_WINDOW (f), |
389 | 1757 GCLineWidth | GCFont |
1758 | GCForeground | GCBackground, | |
1759 &gc_values); | |
1760 | |
1761 /* Reverse video style. */ | |
771 | 1762 gc_values.foreground = f->display.x->background_pixel; |
1763 gc_values.background = f->display.x->foreground_pixel; | |
1764 f->display.x->reverse_gc = XCreateGC (x_current_display, | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
1765 FRAME_X_WINDOW (f), |
389 | 1766 GCFont | GCForeground | GCBackground |
1767 | GCLineWidth, | |
1768 &gc_values); | |
1769 | |
1770 /* Cursor has cursor-color background, background-color foreground. */ | |
771 | 1771 gc_values.foreground = f->display.x->background_pixel; |
1772 gc_values.background = f->display.x->cursor_pixel; | |
389 | 1773 gc_values.fill_style = FillOpaqueStippled; |
1774 gc_values.stipple | |
1775 = XCreateBitmapFromData (x_current_display, ROOT_WINDOW, | |
1776 cursor_bits, 16, 16); | |
771 | 1777 f->display.x->cursor_gc |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
1778 = XCreateGC (x_current_display, FRAME_X_WINDOW (f), |
389 | 1779 (GCFont | GCForeground | GCBackground |
1780 | GCFillStyle | GCStipple | GCLineWidth), | |
1781 &gc_values); | |
1782 | |
1783 /* Create the gray border tile used when the pointer is not in | |
771 | 1784 the frame. Since this depends on the frame's pixel values, |
1785 this must be done on a per-frame basis. */ | |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1786 f->display.x->border_tile |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1787 = (XCreatePixmapFromBitmapData |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1788 (x_current_display, ROOT_WINDOW, |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1789 gray_bits, gray_width, gray_height, |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1790 f->display.x->foreground_pixel, |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1791 f->display.x->background_pixel, |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1792 DefaultDepth (x_current_display, XDefaultScreen (x_current_display)))); |
2341
1982e2983822
* xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents:
2328
diff
changeset
|
1793 |
1982e2983822
* xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents:
2328
diff
changeset
|
1794 UNBLOCK_INPUT; |
389 | 1795 } |
1796 #endif /* HAVE_X11 */ | |
1797 | |
771 | 1798 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, |
389 | 1799 1, 1, 0, |
771 | 1800 "Make a new X window, which is called a \"frame\" in Emacs terms.\n\ |
1801 Return an Emacs frame object representing the X window.\n\ | |
1802 ALIST is an alist of frame parameters.\n\ | |
1803 If the parameters specify that the frame should not have a minibuffer,\n\ | |
697
6dd85fc4fb2c
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
689
diff
changeset
|
1804 and do not specify a specific minibuffer window to use,\n\ |
771 | 1805 then `default-minibuffer-frame' must be a frame whose minibuffer can\n\ |
1806 be shared by the new frame.") | |
389 | 1807 (parms) |
1808 Lisp_Object parms; | |
1809 { | |
1810 #ifdef HAVE_X11 | |
771 | 1811 struct frame *f; |
1812 Lisp_Object frame, tem; | |
389 | 1813 Lisp_Object name; |
1814 int minibuffer_only = 0; | |
1815 long window_prompting = 0; | |
1816 int width, height; | |
1817 | |
1818 if (x_current_display == 0) | |
1819 error ("X windows are not in use or not initialized"); | |
1820 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1821 name = x_get_arg (parms, Qname, "title", "Title", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1822 if (XTYPE (name) != Lisp_String |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1823 && ! EQ (name, Qunbound) |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1824 && ! NILP (name)) |
771 | 1825 error ("x-create-frame: name parameter must be a string"); |
398 | 1826 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1827 tem = x_get_arg (parms, Qminibuffer, 0, 0, symbol); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1828 if (EQ (tem, Qnone) || NILP (tem)) |
771 | 1829 f = make_frame_without_minibuffer (Qnil); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1830 else if (EQ (tem, Qonly)) |
389 | 1831 { |
771 | 1832 f = make_minibuffer_frame (); |
389 | 1833 minibuffer_only = 1; |
1834 } | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1835 else if (XTYPE (tem) == Lisp_Window) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1836 f = make_frame_without_minibuffer (tem); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1837 else |
771 | 1838 f = make_frame (1); |
1839 | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1840 /* Note that X Windows does support scroll bars. */ |
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1841 FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1842 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1843 /* Set the name; the functions to which we pass f expect the name to |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1844 be set. */ |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1845 if (EQ (name, Qunbound) || NILP (name)) |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1846 { |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1847 f->name = build_string (x_id_name); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1848 f->explicit_name = 0; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1849 } |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1850 else |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1851 { |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1852 f->name = name; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1853 f->explicit_name = 1; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1854 } |
771 | 1855 |
1856 XSET (frame, Lisp_Frame, f); | |
1857 f->output_method = output_x_window; | |
1858 f->display.x = (struct x_display *) xmalloc (sizeof (struct x_display)); | |
1859 bzero (f->display.x, sizeof (struct x_display)); | |
1860 | |
1861 /* Note that the frame has no physical cursor right now. */ | |
1862 f->phys_cursor_x = -1; | |
485 | 1863 |
389 | 1864 /* Extract the window parameters from the supplied values |
1865 that are needed to determine window geometry. */ | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1866 x_default_parameter (f, parms, Qfont, build_string ("9x15"), |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1867 "font", "Font", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1868 x_default_parameter (f, parms, Qborder_width, make_number (2), |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1869 "borderwidth", "BorderWidth", number); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1870 /* This defaults to 2 in order to match xterm. */ |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1871 x_default_parameter (f, parms, Qinternal_border_width, make_number (2), |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1872 "internalBorderWidth", "BorderWidth", number); |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1873 x_default_parameter (f, parms, Qvertical_scroll_bars, Qt, |
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1874 "verticalScrollBars", "ScrollBars", boolean); |
389 | 1875 |
1876 /* Also do the stuff which must be set before the window exists. */ | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1877 x_default_parameter (f, parms, Qforeground_color, build_string ("black"), |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1878 "foreground", "Foreground", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1879 x_default_parameter (f, parms, Qbackground_color, build_string ("white"), |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1880 "background", "Background", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1881 x_default_parameter (f, parms, Qmouse_color, build_string ("black"), |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1882 "pointerColor", "Foreground", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1883 x_default_parameter (f, parms, Qcursor_color, build_string ("black"), |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1884 "cursorColor", "Foreground", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1885 x_default_parameter (f, parms, Qborder_color, build_string ("black"), |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1886 "borderColor", "BorderColor", string); |
389 | 1887 |
771 | 1888 f->display.x->parent_desc = ROOT_WINDOW; |
1889 window_prompting = x_figure_window_size (f, parms); | |
1890 | |
1891 x_window (f); | |
1892 x_icon (f, parms); | |
1893 x_make_gc (f); | |
1894 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1895 /* We need to do this after creating the X window, so that the |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1896 icon-creation functions can say whose icon they're describing. */ |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1897 x_default_parameter (f, parms, Qicon_type, Qnil, |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1898 "iconType", "IconType", symbol); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1899 |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1900 x_default_parameter (f, parms, Qauto_raise, Qnil, |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1901 "autoRaise", "AutoRaiseLower", boolean); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1902 x_default_parameter (f, parms, Qauto_lower, Qnil, |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1903 "autoLower", "AutoRaiseLower", boolean); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1904 x_default_parameter (f, parms, Qcursor_type, Qbox, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1905 "cursorType", "CursorType", symbol); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1906 |
771 | 1907 /* Dimensions, especially f->height, must be done via change_frame_size. |
389 | 1908 Change will not be effected unless different from the current |
771 | 1909 f->height. */ |
1910 width = f->width; | |
1911 height = f->height; | |
1912 f->height = f->width = 0; | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1913 change_frame_size (f, height, width, 1, 0); |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1914 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1915 x_default_parameter (f, parms, Qmenu_bar_lines, make_number (0), |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1916 "menuBarLines", "MenuBarLines", number); |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1917 |
389 | 1918 BLOCK_INPUT; |
771 | 1919 x_wm_set_size_hint (f, window_prompting); |
389 | 1920 UNBLOCK_INPUT; |
1921 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1922 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean); |
771 | 1923 f->no_split = minibuffer_only || EQ (tem, Qt); |
389 | 1924 |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1925 /* Make the window appear on the frame and enable display, |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1926 unless the caller says not to. */ |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1927 { |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1928 Lisp_Object visibility = x_get_arg (parms, Qvisibility, 0, 0, symbol); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1929 |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1930 if (EQ (visibility, Qunbound)) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1931 visibility = Qt; |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1932 |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1933 if (EQ (visibility, Qicon)) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1934 x_iconify_frame (f); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1935 else if (! NILP (visibility)) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1936 x_make_frame_visible (f); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1937 else |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1938 /* Must have been Qnil. */ |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1939 ; |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1940 } |
771 | 1941 |
1942 return frame; | |
389 | 1943 #else /* X10 */ |
771 | 1944 struct frame *f; |
1945 Lisp_Object frame, tem; | |
389 | 1946 Lisp_Object name; |
1947 int pixelwidth, pixelheight; | |
1948 Cursor cursor; | |
1949 int height, width; | |
1950 Window parent; | |
1951 Pixmap temp; | |
1952 int minibuffer_only = 0; | |
1953 Lisp_Object vscroll, hscroll; | |
1954 | |
1955 if (x_current_display == 0) | |
1956 error ("X windows are not in use or not initialized"); | |
1957 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1958 name = Fassq (Qname, parms); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1959 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1960 tem = x_get_arg (parms, Qminibuffer, 0, 0, symbol); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1961 if (EQ (tem, Qnone)) |
771 | 1962 f = make_frame_without_minibuffer (Qnil); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1963 else if (EQ (tem, Qonly)) |
389 | 1964 { |
771 | 1965 f = make_minibuffer_frame (); |
389 | 1966 minibuffer_only = 1; |
1967 } | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1968 else if (EQ (tem, Qnil) || EQ (tem, Qunbound)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1969 f = make_frame (1); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1970 else |
771 | 1971 f = make_frame_without_minibuffer (tem); |
389 | 1972 |
1973 parent = ROOT_WINDOW; | |
1974 | |
771 | 1975 XSET (frame, Lisp_Frame, f); |
1976 f->output_method = output_x_window; | |
1977 f->display.x = (struct x_display *) xmalloc (sizeof (struct x_display)); | |
1978 bzero (f->display.x, sizeof (struct x_display)); | |
389 | 1979 |
1980 /* Some temprorary default values for height and width. */ | |
1981 width = 80; | |
1982 height = 40; | |
771 | 1983 f->display.x->left_pos = -1; |
1984 f->display.x->top_pos = -1; | |
1985 | |
1986 /* Give the frame a default name (which may be overridden with PARMS). */ | |
389 | 1987 |
1988 strncpy (iconidentity, ICONTAG, MAXICID); | |
1989 if (gethostname (&iconidentity[sizeof (ICONTAG) - 1], | |
1990 (MAXICID - 1) - sizeof (ICONTAG))) | |
1991 iconidentity[sizeof (ICONTAG) - 2] = '\0'; | |
771 | 1992 f->name = build_string (iconidentity); |
389 | 1993 |
1994 /* Extract some window parameters from the supplied values. | |
1995 These are the parameters that affect window geometry. */ | |
1996 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1997 tem = x_get_arg (parms, Qfont, "BodyFont", 0, string); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1998 if (EQ (tem, Qunbound)) |
389 | 1999 tem = build_string ("9x15"); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2000 x_set_font (f, tem, Qnil); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2001 x_default_parameter (f, parms, Qborder_color, |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2002 build_string ("black"), "Border", 0, string); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2003 x_default_parameter (f, parms, Qbackground_color, |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2004 build_string ("white"), "Background", 0, string); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2005 x_default_parameter (f, parms, Qforeground_color, |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2006 build_string ("black"), "Foreground", 0, string); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2007 x_default_parameter (f, parms, Qmouse_color, |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2008 build_string ("black"), "Mouse", 0, string); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2009 x_default_parameter (f, parms, Qcursor_color, |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2010 build_string ("black"), "Cursor", 0, string); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2011 x_default_parameter (f, parms, Qborder_width, |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2012 make_number (2), "BorderWidth", 0, number); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2013 x_default_parameter (f, parms, Qinternal_border_width, |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2014 make_number (4), "InternalBorderWidth", 0, number); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2015 x_default_parameter (f, parms, Qauto_raise, |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2016 Qnil, "AutoRaise", 0, boolean); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2017 |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2018 hscroll = EQ (x_get_arg (parms, Qhorizontal_scroll_bar, 0, 0, boolean), Qt); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2019 vscroll = EQ (x_get_arg (parms, Qvertical_scroll_bar, 0, 0, boolean), Qt); |
389 | 2020 |
771 | 2021 if (f->display.x->internal_border_width < 0) |
2022 f->display.x->internal_border_width = 0; | |
389 | 2023 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2024 tem = x_get_arg (parms, Qwindow_id, 0, 0, number); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2025 if (!EQ (tem, Qunbound)) |
389 | 2026 { |
2027 WINDOWINFO_TYPE wininfo; | |
2028 int nchildren; | |
2029 Window *children, root; | |
2030 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2031 CHECK_NUMBER (tem, 0); |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
2032 FRAME_X_WINDOW (f) = (Window) XINT (tem); |
389 | 2033 |
2034 BLOCK_INPUT; | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
2035 XGetWindowInfo (FRAME_X_WINDOW (f), &wininfo); |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
2036 XQueryTree (FRAME_X_WINDOW (f), &parent, &nchildren, &children); |
389 | 2037 free (children); |
2038 UNBLOCK_INPUT; | |
2039 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2040 height = PIXEL_TO_CHAR_HEIGHT (f, wininfo.height); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2041 width = PIXEL_TO_CHAR_WIDTH (f, wininfo.width); |
771 | 2042 f->display.x->left_pos = wininfo.x; |
2043 f->display.x->top_pos = wininfo.y; | |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
2044 FRAME_SET_VISIBILITY (f, wininfo.mapped != 0); |
771 | 2045 f->display.x->border_width = wininfo.bdrwidth; |
2046 f->display.x->parent_desc = parent; | |
389 | 2047 } |
2048 else | |
2049 { | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2050 tem = x_get_arg (parms, Qparent_id, 0, 0, number); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2051 if (!EQ (tem, Qunbound)) |
389 | 2052 { |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2053 CHECK_NUMBER (tem, 0); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2054 parent = (Window) XINT (tem); |
389 | 2055 } |
771 | 2056 f->display.x->parent_desc = parent; |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2057 tem = x_get_arg (parms, Qheight, 0, 0, number); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2058 if (EQ (tem, Qunbound)) |
389 | 2059 { |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2060 tem = x_get_arg (parms, Qwidth, 0, 0, number); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2061 if (EQ (tem, Qunbound)) |
389 | 2062 { |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2063 tem = x_get_arg (parms, Qtop, 0, 0, number); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2064 if (EQ (tem, Qunbound)) |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2065 tem = x_get_arg (parms, Qleft, 0, 0, number); |
389 | 2066 } |
2067 } | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2068 /* Now TEM is Qunbound if no edge or size was specified. |
389 | 2069 In that case, we must do rubber-banding. */ |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2070 if (EQ (tem, Qunbound)) |
389 | 2071 { |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2072 tem = x_get_arg (parms, Qgeometry, 0, 0, number); |
771 | 2073 x_rubber_band (f, |
2074 &f->display.x->left_pos, &f->display.x->top_pos, | |
389 | 2075 &width, &height, |
2076 (XTYPE (tem) == Lisp_String | |
2077 ? (char *) XSTRING (tem)->data : ""), | |
771 | 2078 XSTRING (f->name)->data, |
485 | 2079 !NILP (hscroll), !NILP (vscroll)); |
389 | 2080 } |
2081 else | |
2082 { | |
2083 /* Here if at least one edge or size was specified. | |
2084 Demand that they all were specified, and use them. */ | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2085 tem = x_get_arg (parms, Qheight, 0, 0, number); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2086 if (EQ (tem, Qunbound)) |
389 | 2087 error ("Height not specified"); |
2088 CHECK_NUMBER (tem, 0); | |
2089 height = XINT (tem); | |
2090 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2091 tem = x_get_arg (parms, Qwidth, 0, 0, number); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2092 if (EQ (tem, Qunbound)) |
389 | 2093 error ("Width not specified"); |
2094 CHECK_NUMBER (tem, 0); | |
2095 width = XINT (tem); | |
2096 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2097 tem = x_get_arg (parms, Qtop, 0, 0, number); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2098 if (EQ (tem, Qunbound)) |
389 | 2099 error ("Top position not specified"); |
2100 CHECK_NUMBER (tem, 0); | |
771 | 2101 f->display.x->left_pos = XINT (tem); |
389 | 2102 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2103 tem = x_get_arg (parms, Qleft, 0, 0, number); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2104 if (EQ (tem, Qunbound)) |
389 | 2105 error ("Left position not specified"); |
2106 CHECK_NUMBER (tem, 0); | |
771 | 2107 f->display.x->top_pos = XINT (tem); |
389 | 2108 } |
2109 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2110 pixelwidth = CHAR_TO_PIXEL_WIDTH (f, width); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2111 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, height); |
389 | 2112 |
2113 BLOCK_INPUT; | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
2114 FRAME_X_WINDOW (f) |
389 | 2115 = XCreateWindow (parent, |
771 | 2116 f->display.x->left_pos, /* Absolute horizontal offset */ |
2117 f->display.x->top_pos, /* Absolute Vertical offset */ | |
389 | 2118 pixelwidth, pixelheight, |
771 | 2119 f->display.x->border_width, |
389 | 2120 BLACK_PIX_DEFAULT, WHITE_PIX_DEFAULT); |
2121 UNBLOCK_INPUT; | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
2122 if (FRAME_X_WINDOW (f) == 0) |
389 | 2123 error ("Unable to create window."); |
2124 } | |
2125 | |
2126 /* Install the now determined height and width | |
2127 in the windows and in phys_lines and desired_lines. */ | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2128 change_frame_size (f, height, width, 1, 0); |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
2129 XSelectInput (FRAME_X_WINDOW (f), KeyPressed | ExposeWindow |
389 | 2130 | ButtonPressed | ButtonReleased | ExposeRegion | ExposeCopy |
2131 | EnterWindow | LeaveWindow | UnmapWindow ); | |
771 | 2132 x_set_resize_hint (f); |
389 | 2133 |
2134 /* Tell the server the window's default name. */ | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
2135 XStoreName (XDISPLAY FRAME_X_WINDOW (f), XSTRING (f->name)->data); |
708 | 2136 |
389 | 2137 /* Now override the defaults with all the rest of the specified |
2138 parms. */ | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2139 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean); |
771 | 2140 f->no_split = minibuffer_only || EQ (tem, Qt); |
389 | 2141 |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2142 /* Do not create an icon window if the caller says not to */ |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2143 if (!EQ (x_get_arg (parms, Qsuppress_icon, 0, 0, boolean), Qt) |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2144 || f->display.x->parent_desc != ROOT_WINDOW) |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2145 { |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2146 x_text_icon (f, iconidentity); |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2147 x_default_parameter (f, parms, Qicon_type, Qnil, |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2148 "BitmapIcon", 0, symbol); |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2149 } |
389 | 2150 |
2151 /* Tell the X server the previously set values of the | |
2152 background, border and mouse colors; also create the mouse cursor. */ | |
2153 BLOCK_INPUT; | |
771 | 2154 temp = XMakeTile (f->display.x->background_pixel); |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
2155 XChangeBackground (FRAME_X_WINDOW (f), temp); |
389 | 2156 XFreePixmap (temp); |
2157 UNBLOCK_INPUT; | |
771 | 2158 x_set_border_pixel (f, f->display.x->border_pixel); |
2159 | |
2160 x_set_mouse_color (f, Qnil, Qnil); | |
389 | 2161 |
2162 /* Now override the defaults with all the rest of the specified parms. */ | |
2163 | |
771 | 2164 Fmodify_frame_parameters (frame, parms); |
389 | 2165 |
771 | 2166 /* Make the window appear on the frame and enable display. */ |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2167 { |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2168 Lisp_Object visibility = x_get_arg (parms, Qvisibility, 0, 0, symbol); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2169 |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2170 if (EQ (visibility, Qunbound)) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2171 visibility = Qt; |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2172 |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2173 if (! EQ (visibility, Qicon) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2174 && ! NILP (visibility)) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2175 x_make_window_visible (f); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2176 } |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2177 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2178 SET_FRAME_GARBAGED (f); |
771 | 2179 |
2180 return frame; | |
389 | 2181 #endif /* X10 */ |
2182 } | |
2183 | |
771 | 2184 DEFUN ("focus-frame", Ffocus_frame, Sfocus_frame, 1, 1, 0, |
2185 "Set the focus on FRAME.") | |
2186 (frame) | |
2187 Lisp_Object frame; | |
389 | 2188 { |
771 | 2189 CHECK_LIVE_FRAME (frame, 0); |
2190 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2191 if (FRAME_X_P (XFRAME (frame))) |
389 | 2192 { |
2193 BLOCK_INPUT; | |
771 | 2194 x_focus_on_frame (XFRAME (frame)); |
389 | 2195 UNBLOCK_INPUT; |
771 | 2196 return frame; |
389 | 2197 } |
2198 | |
2199 return Qnil; | |
2200 } | |
2201 | |
771 | 2202 DEFUN ("unfocus-frame", Funfocus_frame, Sunfocus_frame, 0, 0, 0, |
2203 "If a frame has been focused, release it.") | |
389 | 2204 () |
2205 { | |
771 | 2206 if (x_focus_frame) |
389 | 2207 { |
2208 BLOCK_INPUT; | |
771 | 2209 x_unfocus_frame (x_focus_frame); |
389 | 2210 UNBLOCK_INPUT; |
2211 } | |
2212 | |
2213 return Qnil; | |
2214 } | |
2215 | |
2216 #ifndef HAVE_X11 | |
2217 /* Computes an X-window size and position either from geometry GEO | |
2218 or with the mouse. | |
2219 | |
771 | 2220 F is a frame. It specifies an X window which is used to |
389 | 2221 determine which display to compute for. Its font, borders |
2222 and colors control how the rectangle will be displayed. | |
2223 | |
2224 X and Y are where to store the positions chosen. | |
2225 WIDTH and HEIGHT are where to store the sizes chosen. | |
2226 | |
2227 GEO is the geometry that may specify some of the info. | |
2228 STR is a prompt to display. | |
2229 HSCROLL and VSCROLL say whether we have horiz and vert scroll bars. */ | |
2230 | |
2231 int | |
771 | 2232 x_rubber_band (f, x, y, width, height, geo, str, hscroll, vscroll) |
2233 struct frame *f; | |
389 | 2234 int *x, *y, *width, *height; |
2235 char *geo; | |
2236 char *str; | |
2237 int hscroll, vscroll; | |
2238 { | |
2239 OpaqueFrame frame; | |
2240 Window tempwindow; | |
2241 WindowInfo wininfo; | |
2242 int border_color; | |
2243 int background_color; | |
2244 Lisp_Object tem; | |
2245 int mask; | |
2246 | |
2247 BLOCK_INPUT; | |
2248 | |
771 | 2249 background_color = f->display.x->background_pixel; |
2250 border_color = f->display.x->border_pixel; | |
2251 | |
2252 frame.bdrwidth = f->display.x->border_width; | |
389 | 2253 frame.border = XMakeTile (border_color); |
2254 frame.background = XMakeTile (background_color); | |
2255 tempwindow = XCreateTerm (str, "emacs", geo, default_window, &frame, 10, 5, | |
771 | 2256 (2 * f->display.x->internal_border_width |
389 | 2257 + (vscroll ? VSCROLL_WIDTH : 0)), |
771 | 2258 (2 * f->display.x->internal_border_width |
389 | 2259 + (hscroll ? HSCROLL_HEIGHT : 0)), |
771 | 2260 width, height, f->display.x->font, |
2261 FONT_WIDTH (f->display.x->font), | |
2262 FONT_HEIGHT (f->display.x->font)); | |
389 | 2263 XFreePixmap (frame.border); |
2264 XFreePixmap (frame.background); | |
2265 | |
2266 if (tempwindow != 0) | |
2267 { | |
2268 XQueryWindow (tempwindow, &wininfo); | |
2269 XDestroyWindow (tempwindow); | |
2270 *x = wininfo.x; | |
2271 *y = wininfo.y; | |
2272 } | |
2273 | |
2274 /* Coordinates we got are relative to the root window. | |
2275 Convert them to coordinates relative to desired parent window | |
2276 by scanning from there up to the root. */ | |
771 | 2277 tempwindow = f->display.x->parent_desc; |
389 | 2278 while (tempwindow != ROOT_WINDOW) |
2279 { | |
2280 int nchildren; | |
2281 Window *children; | |
2282 XQueryWindow (tempwindow, &wininfo); | |
2283 *x -= wininfo.x; | |
2284 *y -= wininfo.y; | |
2285 XQueryTree (tempwindow, &tempwindow, &nchildren, &children); | |
2286 free (children); | |
2287 } | |
2288 | |
2289 UNBLOCK_INPUT; | |
2290 return tempwindow != 0; | |
2291 } | |
2292 #endif /* not HAVE_X11 */ | |
2293 | |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2294 DEFUN ("x-color-defined-p", Fx_color_defined_p, Sx_color_defined_p, 1, 1, 0, |
389 | 2295 "Return t if the current X display supports the color named COLOR.") |
2296 (color) | |
2297 Lisp_Object color; | |
2298 { | |
2299 Color foo; | |
2300 | |
2301 CHECK_STRING (color, 0); | |
2302 | |
2303 if (defined_color (XSTRING (color)->data, &foo)) | |
2304 return Qt; | |
2305 else | |
2306 return Qnil; | |
2307 } | |
2308 | |
2277
773e47f29c5a
(Fx_display_color_p): Renamed from Fx_color_display_p.
Richard M. Stallman <rms@gnu.org>
parents:
2276
diff
changeset
|
2309 DEFUN ("x-display-color-p", Fx_display_color_p, Sx_display_color_p, 0, 0, 0, |
773e47f29c5a
(Fx_display_color_p): Renamed from Fx_color_display_p.
Richard M. Stallman <rms@gnu.org>
parents:
2276
diff
changeset
|
2310 "Return t if the X screen currently in use supports color.") |
389 | 2311 () |
2312 { | |
1528
924c8a609582
* xfns.c (x_decode_color, Fx_color_display_p): x_screen_planes is
Jim Blandy <jimb@redhat.com>
parents:
1438
diff
changeset
|
2313 if (x_screen_planes <= 2) |
389 | 2314 return Qnil; |
2315 | |
2316 switch (screen_visual->class) | |
2317 { | |
2318 case StaticColor: | |
2319 case PseudoColor: | |
2320 case TrueColor: | |
2321 case DirectColor: | |
2322 return Qt; | |
2323 | |
2324 default: | |
2325 return Qnil; | |
2326 } | |
2327 } | |
2328 | |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2329 DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2330 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2331 "Returns the width in pixels of the display FRAME is on.") |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2332 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2333 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2334 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2335 Display *dpy = x_current_display; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2336 return make_number (DisplayWidth (dpy, DefaultScreen (dpy))); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2337 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2338 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2339 DEFUN ("x-display-pixel-height", Fx_display_pixel_height, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2340 Sx_display_pixel_height, 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2341 "Returns the height in pixels of the display FRAME is on.") |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2342 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2343 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2344 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2345 Display *dpy = x_current_display; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2346 return make_number (DisplayHeight (dpy, DefaultScreen (dpy))); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2347 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2348 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2349 DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2350 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2351 "Returns the number of bitplanes of the display FRAME is on.") |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2352 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2353 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2354 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2355 Display *dpy = x_current_display; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2356 return make_number (DisplayPlanes (dpy, DefaultScreen (dpy))); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2357 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2358 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2359 DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2360 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2361 "Returns the number of color cells of the display FRAME is on.") |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2362 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2363 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2364 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2365 Display *dpy = x_current_display; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2366 return make_number (DisplayCells (dpy, DefaultScreen (dpy))); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2367 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2368 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2369 DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2370 "Returns the vendor ID string of the X server FRAME is on.") |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2371 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2372 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2373 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2374 Display *dpy = x_current_display; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2375 char *vendor; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2376 vendor = ServerVendor (dpy); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2377 if (! vendor) vendor = ""; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2378 return build_string (vendor); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2379 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2380 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2381 DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2382 "Returns the version numbers of the X server in use.\n\ |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2383 The value is a list of three integers: the major and minor\n\ |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2384 version numbers of the X Protocol in use, and the vendor-specific release\n\ |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2385 number. See also the variable `x-server-vendor'.") |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2386 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2387 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2388 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2389 Display *dpy = x_current_display; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2390 return Fcons (make_number (ProtocolVersion (dpy)), |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2391 Fcons (make_number (ProtocolRevision (dpy)), |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2392 Fcons (make_number (VendorRelease (dpy)), Qnil))); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2393 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2394 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2395 DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2396 "Returns the number of screens on the X server FRAME is on.") |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2397 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2398 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2399 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2400 return make_number (ScreenCount (x_current_display)); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2401 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2402 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2403 DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2404 "Returns the height in millimeters of the X screen FRAME is on.") |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2405 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2406 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2407 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2408 return make_number (HeightMMOfScreen (x_screen)); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2409 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2410 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2411 DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2412 "Returns the width in millimeters of the X screen FRAME is on.") |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2413 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2414 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2415 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2416 return make_number (WidthMMOfScreen (x_screen)); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2417 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2418 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2419 DEFUN ("x-display-backing-store", Fx_display_backing_store, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2420 Sx_display_backing_store, 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2421 "Returns an indication of whether the X screen FRAME is on does backing store.\n\ |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2422 The value may be `always', `when-mapped', or `not-useful'.") |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2423 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2424 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2425 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2426 switch (DoesBackingStore (x_screen)) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2427 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2428 case Always: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2429 return intern ("always"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2430 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2431 case WhenMapped: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2432 return intern ("when-mapped"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2433 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2434 case NotUseful: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2435 return intern ("not-useful"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2436 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2437 default: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2438 error ("Strange value for BackingStore parameter of screen"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2439 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2440 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2441 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2442 DEFUN ("x-display-visual-class", Fx_display_visual_class, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2443 Sx_display_visual_class, 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2444 "Returns the visual class of the display `screen' is on.\n\ |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2445 The value is one of the symbols `static-gray', `gray-scale',\n\ |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2446 `static-color', `pseudo-color', `true-color', or `direct-color'.") |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2447 (screen) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2448 Lisp_Object screen; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2449 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2450 switch (screen_visual->class) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2451 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2452 case StaticGray: return (intern ("static-gray")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2453 case GrayScale: return (intern ("gray-scale")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2454 case StaticColor: return (intern ("static-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2455 case PseudoColor: return (intern ("pseudo-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2456 case TrueColor: return (intern ("true-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2457 case DirectColor: return (intern ("direct-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2458 default: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2459 error ("Display has an unknown visual class"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2460 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2461 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2462 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2463 DEFUN ("x-display-save-under", Fx_display_save_under, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2464 Sx_display_save_under, 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2465 "Returns t if the X screen FRAME is on supports the save-under feature.") |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2466 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2467 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2468 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2469 if (DoesSaveUnders (x_screen) == True) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2470 return Qt; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2471 else |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2472 return Qnil; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2473 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2474 |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2475 x_pixel_width (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2476 register struct frame *f; |
389 | 2477 { |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2478 return PIXEL_WIDTH (f); |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2479 } |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2480 |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2481 x_pixel_height (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2482 register struct frame *f; |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2483 { |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2484 return PIXEL_HEIGHT (f); |
389 | 2485 } |
2486 | |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2487 x_char_width (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2488 register struct frame *f; |
389 | 2489 { |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2490 return FONT_WIDTH (f->display.x->font); |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2491 } |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2492 |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2493 x_char_height (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2494 register struct frame *f; |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2495 { |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2496 return FONT_HEIGHT (f->display.x->font); |
389 | 2497 } |
2498 | |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
2499 #if 0 /* These no longer seem like the right way to do things. */ |
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
2500 |
771 | 2501 /* Draw a rectangle on the frame with left top corner including |
389 | 2502 the character specified by LEFT_CHAR and TOP_CHAR. The rectangle is |
2503 CHARS by LINES wide and long and is the color of the cursor. */ | |
2504 | |
2505 void | |
771 | 2506 x_rectangle (f, gc, left_char, top_char, chars, lines) |
2507 register struct frame *f; | |
389 | 2508 GC gc; |
2509 register int top_char, left_char, chars, lines; | |
2510 { | |
2511 int width; | |
2512 int height; | |
771 | 2513 int left = (left_char * FONT_WIDTH (f->display.x->font) |
2514 + f->display.x->internal_border_width); | |
2515 int top = (top_char * FONT_HEIGHT (f->display.x->font) | |
2516 + f->display.x->internal_border_width); | |
389 | 2517 |
2518 if (chars < 0) | |
771 | 2519 width = FONT_WIDTH (f->display.x->font) / 2; |
389 | 2520 else |
771 | 2521 width = FONT_WIDTH (f->display.x->font) * chars; |
389 | 2522 if (lines < 0) |
771 | 2523 height = FONT_HEIGHT (f->display.x->font) / 2; |
389 | 2524 else |
771 | 2525 height = FONT_HEIGHT (f->display.x->font) * lines; |
2526 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
2527 XDrawRectangle (x_current_display, FRAME_X_WINDOW (f), |
389 | 2528 gc, left, top, width, height); |
2529 } | |
2530 | |
2531 DEFUN ("x-draw-rectangle", Fx_draw_rectangle, Sx_draw_rectangle, 5, 5, 0, | |
771 | 2532 "Draw a rectangle on FRAME between coordinates specified by\n\ |
389 | 2533 numbers X0, Y0, X1, Y1 in the cursor pixel.") |
771 | 2534 (frame, X0, Y0, X1, Y1) |
2535 register Lisp_Object frame, X0, X1, Y0, Y1; | |
389 | 2536 { |
2537 register int x0, y0, x1, y1, top, left, n_chars, n_lines; | |
2538 | |
771 | 2539 CHECK_LIVE_FRAME (frame, 0); |
389 | 2540 CHECK_NUMBER (X0, 0); |
2541 CHECK_NUMBER (Y0, 1); | |
2542 CHECK_NUMBER (X1, 2); | |
2543 CHECK_NUMBER (Y1, 3); | |
2544 | |
2545 x0 = XINT (X0); | |
2546 x1 = XINT (X1); | |
2547 y0 = XINT (Y0); | |
2548 y1 = XINT (Y1); | |
2549 | |
2550 if (y1 > y0) | |
2551 { | |
2552 top = y0; | |
2553 n_lines = y1 - y0 + 1; | |
2554 } | |
2555 else | |
2556 { | |
2557 top = y1; | |
2558 n_lines = y0 - y1 + 1; | |
2559 } | |
2560 | |
2561 if (x1 > x0) | |
2562 { | |
2563 left = x0; | |
2564 n_chars = x1 - x0 + 1; | |
2565 } | |
2566 else | |
2567 { | |
2568 left = x1; | |
2569 n_chars = x0 - x1 + 1; | |
2570 } | |
2571 | |
2572 BLOCK_INPUT; | |
771 | 2573 x_rectangle (XFRAME (frame), XFRAME (frame)->display.x->cursor_gc, |
389 | 2574 left, top, n_chars, n_lines); |
2575 UNBLOCK_INPUT; | |
2576 | |
2577 return Qt; | |
2578 } | |
2579 | |
2580 DEFUN ("x-erase-rectangle", Fx_erase_rectangle, Sx_erase_rectangle, 5, 5, 0, | |
771 | 2581 "Draw a rectangle drawn on FRAME between coordinates\n\ |
389 | 2582 X0, Y0, X1, Y1 in the regular background-pixel.") |
771 | 2583 (frame, X0, Y0, X1, Y1) |
2584 register Lisp_Object frame, X0, Y0, X1, Y1; | |
389 | 2585 { |
2586 register int x0, y0, x1, y1, top, left, n_chars, n_lines; | |
2587 | |
771 | 2588 CHECK_FRAME (frame, 0); |
389 | 2589 CHECK_NUMBER (X0, 0); |
2590 CHECK_NUMBER (Y0, 1); | |
2591 CHECK_NUMBER (X1, 2); | |
2592 CHECK_NUMBER (Y1, 3); | |
2593 | |
2594 x0 = XINT (X0); | |
2595 x1 = XINT (X1); | |
2596 y0 = XINT (Y0); | |
2597 y1 = XINT (Y1); | |
2598 | |
2599 if (y1 > y0) | |
2600 { | |
2601 top = y0; | |
2602 n_lines = y1 - y0 + 1; | |
2603 } | |
2604 else | |
2605 { | |
2606 top = y1; | |
2607 n_lines = y0 - y1 + 1; | |
2608 } | |
2609 | |
2610 if (x1 > x0) | |
2611 { | |
2612 left = x0; | |
2613 n_chars = x1 - x0 + 1; | |
2614 } | |
2615 else | |
2616 { | |
2617 left = x1; | |
2618 n_chars = x0 - x1 + 1; | |
2619 } | |
2620 | |
2621 BLOCK_INPUT; | |
771 | 2622 x_rectangle (XFRAME (frame), XFRAME (frame)->display.x->reverse_gc, |
389 | 2623 left, top, n_chars, n_lines); |
2624 UNBLOCK_INPUT; | |
2625 | |
2626 return Qt; | |
2627 } | |
2628 | |
2629 /* Draw lines around the text region beginning at the character position | |
2630 TOP_X, TOP_Y and ending at BOTTOM_X and BOTTOM_Y. GC specifies the | |
2631 pixel and line characteristics. */ | |
2632 | |
771 | 2633 #define line_len(line) (FRAME_CURRENT_GLYPHS (f)->used[(line)]) |
389 | 2634 |
2635 static void | |
771 | 2636 outline_region (f, gc, top_x, top_y, bottom_x, bottom_y) |
2637 register struct frame *f; | |
389 | 2638 GC gc; |
2639 int top_x, top_y, bottom_x, bottom_y; | |
2640 { | |
771 | 2641 register int ibw = f->display.x->internal_border_width; |
2642 register int font_w = FONT_WIDTH (f->display.x->font); | |
2643 register int font_h = FONT_HEIGHT (f->display.x->font); | |
389 | 2644 int y = top_y; |
2645 int x = line_len (y); | |
2646 XPoint *pixel_points = (XPoint *) | |
2647 alloca (((bottom_y - top_y + 2) * 4) * sizeof (XPoint)); | |
2648 register XPoint *this_point = pixel_points; | |
2649 | |
2650 /* Do the horizontal top line/lines */ | |
2651 if (top_x == 0) | |
2652 { | |
2653 this_point->x = ibw; | |
2654 this_point->y = ibw + (font_h * top_y); | |
2655 this_point++; | |
2656 if (x == 0) | |
2657 this_point->x = ibw + (font_w / 2); /* Half-size for newline chars. */ | |
2658 else | |
2659 this_point->x = ibw + (font_w * x); | |
2660 this_point->y = (this_point - 1)->y; | |
2661 } | |
2662 else | |
2663 { | |
2664 this_point->x = ibw; | |
2665 this_point->y = ibw + (font_h * (top_y + 1)); | |
2666 this_point++; | |
2667 this_point->x = ibw + (font_w * top_x); | |
2668 this_point->y = (this_point - 1)->y; | |
2669 this_point++; | |
2670 this_point->x = (this_point - 1)->x; | |
2671 this_point->y = ibw + (font_h * top_y); | |
2672 this_point++; | |
2673 this_point->x = ibw + (font_w * x); | |
2674 this_point->y = (this_point - 1)->y; | |
2675 } | |
2676 | |
2677 /* Now do the right side. */ | |
2678 while (y < bottom_y) | |
2679 { /* Right vertical edge */ | |
2680 this_point++; | |
2681 this_point->x = (this_point - 1)->x; | |
2682 this_point->y = ibw + (font_h * (y + 1)); | |
2683 this_point++; | |
2684 | |
2685 y++; /* Horizontal connection to next line */ | |
2686 x = line_len (y); | |
2687 if (x == 0) | |
2688 this_point->x = ibw + (font_w / 2); | |
2689 else | |
2690 this_point->x = ibw + (font_w * x); | |
2691 | |
2692 this_point->y = (this_point - 1)->y; | |
2693 } | |
2694 | |
2695 /* Now do the bottom and connect to the top left point. */ | |
2696 this_point->x = ibw + (font_w * (bottom_x + 1)); | |
2697 | |
2698 this_point++; | |
2699 this_point->x = (this_point - 1)->x; | |
2700 this_point->y = ibw + (font_h * (bottom_y + 1)); | |
2701 this_point++; | |
2702 this_point->x = ibw; | |
2703 this_point->y = (this_point - 1)->y; | |
2704 this_point++; | |
2705 this_point->x = pixel_points->x; | |
2706 this_point->y = pixel_points->y; | |
2707 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
2708 XDrawLines (x_current_display, FRAME_X_WINDOW (f), |
389 | 2709 gc, pixel_points, |
2710 (this_point - pixel_points + 1), CoordModeOrigin); | |
2711 } | |
2712 | |
2713 DEFUN ("x-contour-region", Fx_contour_region, Sx_contour_region, 1, 1, 0, | |
2714 "Highlight the region between point and the character under the mouse\n\ | |
771 | 2715 selected frame.") |
389 | 2716 (event) |
2717 register Lisp_Object event; | |
2718 { | |
2719 register int x0, y0, x1, y1; | |
771 | 2720 register struct frame *f = selected_frame; |
389 | 2721 register int p1, p2; |
2722 | |
2723 CHECK_CONS (event, 0); | |
2724 | |
2725 BLOCK_INPUT; | |
2726 x0 = XINT (Fcar (Fcar (event))); | |
2727 y0 = XINT (Fcar (Fcdr (Fcar (event)))); | |
2728 | |
2729 /* If the mouse is past the end of the line, don't that area. */ | |
2730 /* ReWrite this... */ | |
2731 | |
771 | 2732 x1 = f->cursor_x; |
2733 y1 = f->cursor_y; | |
389 | 2734 |
2735 if (y1 > y0) /* point below mouse */ | |
771 | 2736 outline_region (f, f->display.x->cursor_gc, |
389 | 2737 x0, y0, x1, y1); |
2738 else if (y1 < y0) /* point above mouse */ | |
771 | 2739 outline_region (f, f->display.x->cursor_gc, |
389 | 2740 x1, y1, x0, y0); |
2741 else /* same line: draw horizontal rectangle */ | |
2742 { | |
2743 if (x1 > x0) | |
771 | 2744 x_rectangle (f, f->display.x->cursor_gc, |
389 | 2745 x0, y0, (x1 - x0 + 1), 1); |
2746 else if (x1 < x0) | |
771 | 2747 x_rectangle (f, f->display.x->cursor_gc, |
389 | 2748 x1, y1, (x0 - x1 + 1), 1); |
2749 } | |
2750 | |
2751 XFlush (x_current_display); | |
2752 UNBLOCK_INPUT; | |
2753 | |
2754 return Qnil; | |
2755 } | |
2756 | |
2757 DEFUN ("x-uncontour-region", Fx_uncontour_region, Sx_uncontour_region, 1, 1, 0, | |
2758 "Erase any highlighting of the region between point and the character\n\ | |
771 | 2759 at X, Y on the selected frame.") |
389 | 2760 (event) |
2761 register Lisp_Object event; | |
2762 { | |
2763 register int x0, y0, x1, y1; | |
771 | 2764 register struct frame *f = selected_frame; |
389 | 2765 |
2766 BLOCK_INPUT; | |
2767 x0 = XINT (Fcar (Fcar (event))); | |
2768 y0 = XINT (Fcar (Fcdr (Fcar (event)))); | |
771 | 2769 x1 = f->cursor_x; |
2770 y1 = f->cursor_y; | |
389 | 2771 |
2772 if (y1 > y0) /* point below mouse */ | |
771 | 2773 outline_region (f, f->display.x->reverse_gc, |
389 | 2774 x0, y0, x1, y1); |
2775 else if (y1 < y0) /* point above mouse */ | |
771 | 2776 outline_region (f, f->display.x->reverse_gc, |
389 | 2777 x1, y1, x0, y0); |
2778 else /* same line: draw horizontal rectangle */ | |
2779 { | |
2780 if (x1 > x0) | |
771 | 2781 x_rectangle (f, f->display.x->reverse_gc, |
389 | 2782 x0, y0, (x1 - x0 + 1), 1); |
2783 else if (x1 < x0) | |
771 | 2784 x_rectangle (f, f->display.x->reverse_gc, |
389 | 2785 x1, y1, (x0 - x1 + 1), 1); |
2786 } | |
2787 UNBLOCK_INPUT; | |
2788 | |
2789 return Qnil; | |
2790 } | |
2791 | |
2792 #if 0 | |
2793 int contour_begin_x, contour_begin_y; | |
2794 int contour_end_x, contour_end_y; | |
2795 int contour_npoints; | |
2796 | |
2797 /* Clip the top part of the contour lines down (and including) line Y_POS. | |
2798 If X_POS is in the middle (rather than at the end) of the line, drop | |
2799 down a line at that character. */ | |
2800 | |
2801 static void | |
2802 clip_contour_top (y_pos, x_pos) | |
2803 { | |
2804 register XPoint *begin = contour_lines[y_pos].top_left; | |
2805 register XPoint *end; | |
2806 register int npoints; | |
771 | 2807 register struct display_line *line = selected_frame->phys_lines[y_pos + 1]; |
389 | 2808 |
2809 if (x_pos >= line->len - 1) /* Draw one, straight horizontal line. */ | |
2810 { | |
2811 end = contour_lines[y_pos].top_right; | |
2812 npoints = (end - begin + 1); | |
2813 XDrawLines (x_current_display, contour_window, | |
2814 contour_erase_gc, begin_erase, npoints, CoordModeOrigin); | |
2815 | |
2816 bcopy (end, begin + 1, contour_last_point - end + 1); | |
2817 contour_last_point -= (npoints - 2); | |
2818 XDrawLines (x_current_display, contour_window, | |
2819 contour_erase_gc, begin, 2, CoordModeOrigin); | |
2820 XFlush (x_current_display); | |
2821 | |
2822 /* Now, update contour_lines structure. */ | |
2823 } | |
2824 /* ______. */ | |
2825 else /* |________*/ | |
2826 { | |
2827 register XPoint *p = begin + 1; | |
2828 end = contour_lines[y_pos].bottom_right; | |
2829 npoints = (end - begin + 1); | |
2830 XDrawLines (x_current_display, contour_window, | |
2831 contour_erase_gc, begin_erase, npoints, CoordModeOrigin); | |
2832 | |
2833 p->y = begin->y; | |
2834 p->x = ibw + (font_w * (x_pos + 1)); | |
2835 p++; | |
2836 p->y = begin->y + font_h; | |
2837 p->x = (p - 1)->x; | |
2838 bcopy (end, begin + 3, contour_last_point - end + 1); | |
2839 contour_last_point -= (npoints - 5); | |
2840 XDrawLines (x_current_display, contour_window, | |
2841 contour_erase_gc, begin, 4, CoordModeOrigin); | |
2842 XFlush (x_current_display); | |
2843 | |
2844 /* Now, update contour_lines structure. */ | |
2845 } | |
2846 } | |
2847 | |
2848 /* Erase the top horzontal lines of the contour, and then extend | |
2849 the contour upwards. */ | |
2850 | |
2851 static void | |
2852 extend_contour_top (line) | |
2853 { | |
2854 } | |
2855 | |
2856 static void | |
2857 clip_contour_bottom (x_pos, y_pos) | |
2858 int x_pos, y_pos; | |
2859 { | |
2860 } | |
2861 | |
2862 static void | |
2863 extend_contour_bottom (x_pos, y_pos) | |
2864 { | |
2865 } | |
2866 | |
2867 DEFUN ("x-select-region", Fx_select_region, Sx_select_region, 1, 1, "e", | |
2868 "") | |
2869 (event) | |
2870 Lisp_Object event; | |
2871 { | |
771 | 2872 register struct frame *f = selected_frame; |
2873 register int point_x = f->cursor_x; | |
2874 register int point_y = f->cursor_y; | |
389 | 2875 register int mouse_below_point; |
2876 register Lisp_Object obj; | |
2877 register int x_contour_x, x_contour_y; | |
2878 | |
2879 x_contour_x = x_mouse_x; | |
2880 x_contour_y = x_mouse_y; | |
2881 if (x_contour_y > point_y || (x_contour_y == point_y | |
2882 && x_contour_x > point_x)) | |
2883 { | |
2884 mouse_below_point = 1; | |
771 | 2885 outline_region (f, f->display.x->cursor_gc, point_x, point_y, |
389 | 2886 x_contour_x, x_contour_y); |
2887 } | |
2888 else | |
2889 { | |
2890 mouse_below_point = 0; | |
771 | 2891 outline_region (f, f->display.x->cursor_gc, x_contour_x, x_contour_y, |
389 | 2892 point_x, point_y); |
2893 } | |
2894 | |
2895 while (1) | |
2896 { | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
2897 obj = read_char (-1, 0, 0, Qnil, 0); |
389 | 2898 if (XTYPE (obj) != Lisp_Cons) |
2899 break; | |
2900 | |
2901 if (mouse_below_point) | |
2902 { | |
2903 if (x_mouse_y <= point_y) /* Flipped. */ | |
2904 { | |
2905 mouse_below_point = 0; | |
2906 | |
771 | 2907 outline_region (f, f->display.x->reverse_gc, point_x, point_y, |
389 | 2908 x_contour_x, x_contour_y); |
771 | 2909 outline_region (f, f->display.x->cursor_gc, x_mouse_x, x_mouse_y, |
389 | 2910 point_x, point_y); |
2911 } | |
2912 else if (x_mouse_y < x_contour_y) /* Bottom clipped. */ | |
2913 { | |
2914 clip_contour_bottom (x_mouse_y); | |
2915 } | |
2916 else if (x_mouse_y > x_contour_y) /* Bottom extended. */ | |
2917 { | |
2918 extend_bottom_contour (x_mouse_y); | |
2919 } | |
2920 | |
2921 x_contour_x = x_mouse_x; | |
2922 x_contour_y = x_mouse_y; | |
2923 } | |
2924 else /* mouse above or same line as point */ | |
2925 { | |
2926 if (x_mouse_y >= point_y) /* Flipped. */ | |
2927 { | |
2928 mouse_below_point = 1; | |
2929 | |
771 | 2930 outline_region (f, f->display.x->reverse_gc, |
389 | 2931 x_contour_x, x_contour_y, point_x, point_y); |
771 | 2932 outline_region (f, f->display.x->cursor_gc, point_x, point_y, |
389 | 2933 x_mouse_x, x_mouse_y); |
2934 } | |
2935 else if (x_mouse_y > x_contour_y) /* Top clipped. */ | |
2936 { | |
2937 clip_contour_top (x_mouse_y); | |
2938 } | |
2939 else if (x_mouse_y < x_contour_y) /* Top extended. */ | |
2940 { | |
2941 extend_contour_top (x_mouse_y); | |
2942 } | |
2943 } | |
2944 } | |
2945 | |
1601
a371ec79bc31
* xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents:
1528
diff
changeset
|
2946 unread_command_event = obj; |
389 | 2947 if (mouse_below_point) |
2948 { | |
2949 contour_begin_x = point_x; | |
2950 contour_begin_y = point_y; | |
2951 contour_end_x = x_contour_x; | |
2952 contour_end_y = x_contour_y; | |
2953 } | |
2954 else | |
2955 { | |
2956 contour_begin_x = x_contour_x; | |
2957 contour_begin_y = x_contour_y; | |
2958 contour_end_x = point_x; | |
2959 contour_end_y = point_y; | |
2960 } | |
2961 } | |
2962 #endif | |
2963 | |
2964 DEFUN ("x-horizontal-line", Fx_horizontal_line, Sx_horizontal_line, 1, 1, "e", | |
2965 "") | |
2966 (event) | |
2967 Lisp_Object event; | |
2968 { | |
2969 register Lisp_Object obj; | |
771 | 2970 struct frame *f = selected_frame; |
389 | 2971 register struct window *w = XWINDOW (selected_window); |
771 | 2972 register GC line_gc = f->display.x->cursor_gc; |
2973 register GC erase_gc = f->display.x->reverse_gc; | |
389 | 2974 #if 0 |
2975 char dash_list[] = {6, 4, 6, 4}; | |
2976 int dashes = 4; | |
2977 XGCValues gc_values; | |
2978 #endif | |
2979 register int previous_y; | |
771 | 2980 register int line = (x_mouse_y + 1) * FONT_HEIGHT (f->display.x->font) |
2981 + f->display.x->internal_border_width; | |
2982 register int left = f->display.x->internal_border_width | |
389 | 2983 + (w->left |
771 | 2984 * FONT_WIDTH (f->display.x->font)); |
389 | 2985 register int right = left + (w->width |
771 | 2986 * FONT_WIDTH (f->display.x->font)) |
2987 - f->display.x->internal_border_width; | |
389 | 2988 |
2989 #if 0 | |
2990 BLOCK_INPUT; | |
771 | 2991 gc_values.foreground = f->display.x->cursor_pixel; |
2992 gc_values.background = f->display.x->background_pixel; | |
389 | 2993 gc_values.line_width = 1; |
2994 gc_values.line_style = LineOnOffDash; | |
2995 gc_values.cap_style = CapRound; | |
2996 gc_values.join_style = JoinRound; | |
2997 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
2998 line_gc = XCreateGC (x_current_display, FRAME_X_WINDOW (f), |
389 | 2999 GCLineStyle | GCJoinStyle | GCCapStyle |
3000 | GCLineWidth | GCForeground | GCBackground, | |
3001 &gc_values); | |
3002 XSetDashes (x_current_display, line_gc, 0, dash_list, dashes); | |
771 | 3003 gc_values.foreground = f->display.x->background_pixel; |
3004 gc_values.background = f->display.x->foreground_pixel; | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3005 erase_gc = XCreateGC (x_current_display, FRAME_X_WINDOW (f), |
389 | 3006 GCLineStyle | GCJoinStyle | GCCapStyle |
3007 | GCLineWidth | GCForeground | GCBackground, | |
3008 &gc_values); | |
3009 XSetDashes (x_current_display, erase_gc, 0, dash_list, dashes); | |
3010 #endif | |
3011 | |
3012 while (1) | |
3013 { | |
3014 BLOCK_INPUT; | |
3015 if (x_mouse_y >= XINT (w->top) | |
3016 && x_mouse_y < XINT (w->top) + XINT (w->height) - 1) | |
3017 { | |
3018 previous_y = x_mouse_y; | |
771 | 3019 line = (x_mouse_y + 1) * FONT_HEIGHT (f->display.x->font) |
3020 + f->display.x->internal_border_width; | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3021 XDrawLine (x_current_display, FRAME_X_WINDOW (f), |
389 | 3022 line_gc, left, line, right, line); |
3023 } | |
3024 XFlushQueue (); | |
3025 UNBLOCK_INPUT; | |
3026 | |
3027 do | |
3028 { | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
3029 obj = read_char (-1, 0, 0, Qnil, 0); |
389 | 3030 if ((XTYPE (obj) != Lisp_Cons) |
3031 || (! EQ (Fcar (Fcdr (Fcdr (obj))), | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3032 Qvertical_scroll_bar)) |
389 | 3033 || x_mouse_grabbed) |
3034 { | |
3035 BLOCK_INPUT; | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3036 XDrawLine (x_current_display, FRAME_X_WINDOW (f), |
389 | 3037 erase_gc, left, line, right, line); |
3038 UNBLOCK_INPUT; | |
1601
a371ec79bc31
* xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents:
1528
diff
changeset
|
3039 unread_command_event = obj; |
389 | 3040 #if 0 |
3041 XFreeGC (x_current_display, line_gc); | |
3042 XFreeGC (x_current_display, erase_gc); | |
3043 #endif | |
3044 return Qnil; | |
3045 } | |
3046 } | |
3047 while (x_mouse_y == previous_y); | |
3048 | |
3049 BLOCK_INPUT; | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3050 XDrawLine (x_current_display, FRAME_X_WINDOW (f), |
389 | 3051 erase_gc, left, line, right, line); |
3052 UNBLOCK_INPUT; | |
3053 } | |
3054 } | |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
3055 #endif |
389 | 3056 |
3057 /* Offset in buffer of character under the pointer, or 0. */ | |
3058 int mouse_buffer_offset; | |
3059 | |
3060 #if 0 | |
3061 /* These keep track of the rectangle following the pointer. */ | |
3062 int mouse_track_top, mouse_track_left, mouse_track_width; | |
3063 | |
3064 DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 0, 0, 0, | |
3065 "Track the pointer.") | |
3066 () | |
3067 { | |
3068 static Cursor current_pointer_shape; | |
771 | 3069 FRAME_PTR f = x_mouse_frame; |
389 | 3070 |
3071 BLOCK_INPUT; | |
771 | 3072 if (EQ (Vmouse_frame_part, Qtext_part) |
3073 && (current_pointer_shape != f->display.x->nontext_cursor)) | |
389 | 3074 { |
3075 unsigned char c; | |
3076 struct buffer *buf; | |
3077 | |
771 | 3078 current_pointer_shape = f->display.x->nontext_cursor; |
389 | 3079 XDefineCursor (x_current_display, |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3080 FRAME_X_WINDOW (f), |
389 | 3081 current_pointer_shape); |
3082 | |
3083 buf = XBUFFER (XWINDOW (Vmouse_window)->buffer); | |
3084 c = *(BUF_CHAR_ADDRESS (buf, mouse_buffer_offset)); | |
3085 } | |
771 | 3086 else if (EQ (Vmouse_frame_part, Qmodeline_part) |
3087 && (current_pointer_shape != f->display.x->modeline_cursor)) | |
389 | 3088 { |
771 | 3089 current_pointer_shape = f->display.x->modeline_cursor; |
389 | 3090 XDefineCursor (x_current_display, |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3091 FRAME_X_WINDOW (f), |
389 | 3092 current_pointer_shape); |
3093 } | |
3094 | |
3095 XFlushQueue (); | |
3096 UNBLOCK_INPUT; | |
3097 } | |
3098 #endif | |
3099 | |
3100 #if 0 | |
3101 DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 1, 1, "e", | |
3102 "Draw rectangle around character under mouse pointer, if there is one.") | |
3103 (event) | |
3104 Lisp_Object event; | |
3105 { | |
3106 struct window *w = XWINDOW (Vmouse_window); | |
771 | 3107 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
389 | 3108 struct buffer *b = XBUFFER (w->buffer); |
3109 Lisp_Object obj; | |
3110 | |
3111 if (! EQ (Vmouse_window, selected_window)) | |
3112 return Qnil; | |
3113 | |
3114 if (EQ (event, Qnil)) | |
3115 { | |
3116 int x, y; | |
3117 | |
771 | 3118 x_read_mouse_position (selected_frame, &x, &y); |
389 | 3119 } |
3120 | |
3121 BLOCK_INPUT; | |
3122 mouse_track_width = 0; | |
3123 mouse_track_left = mouse_track_top = -1; | |
3124 | |
3125 do | |
3126 { | |
3127 if ((x_mouse_x != mouse_track_left | |
3128 && (x_mouse_x < mouse_track_left | |
3129 || x_mouse_x > (mouse_track_left + mouse_track_width))) | |
3130 || x_mouse_y != mouse_track_top) | |
3131 { | |
3132 int hp = 0; /* Horizontal position */ | |
771 | 3133 int len = FRAME_CURRENT_GLYPHS (f)->used[x_mouse_y]; |
3134 int p = FRAME_CURRENT_GLYPHS (f)->bufp[x_mouse_y]; | |
389 | 3135 int tab_width = XINT (b->tab_width); |
485 | 3136 int ctl_arrow_p = !NILP (b->ctl_arrow); |
389 | 3137 unsigned char c; |
3138 int mode_line_vpos = XFASTINT (w->height) + XFASTINT (w->top) - 1; | |
3139 int in_mode_line = 0; | |
3140 | |
771 | 3141 if (! FRAME_CURRENT_GLYPHS (f)->enable[x_mouse_y]) |
389 | 3142 break; |
3143 | |
3144 /* Erase previous rectangle. */ | |
3145 if (mouse_track_width) | |
3146 { | |
771 | 3147 x_rectangle (f, f->display.x->reverse_gc, |
389 | 3148 mouse_track_left, mouse_track_top, |
3149 mouse_track_width, 1); | |
3150 | |
771 | 3151 if ((mouse_track_left == f->phys_cursor_x |
3152 || mouse_track_left == f->phys_cursor_x - 1) | |
3153 && mouse_track_top == f->phys_cursor_y) | |
389 | 3154 { |
771 | 3155 x_display_cursor (f, 1); |
389 | 3156 } |
3157 } | |
3158 | |
3159 mouse_track_left = x_mouse_x; | |
3160 mouse_track_top = x_mouse_y; | |
3161 mouse_track_width = 0; | |
3162 | |
3163 if (mouse_track_left > len) /* Past the end of line. */ | |
3164 goto draw_or_not; | |
3165 | |
3166 if (mouse_track_top == mode_line_vpos) | |
3167 { | |
3168 in_mode_line = 1; | |
3169 goto draw_or_not; | |
3170 } | |
3171 | |
3172 if (tab_width <= 0 || tab_width > 20) tab_width = 8; | |
3173 do | |
3174 { | |
3175 c = FETCH_CHAR (p); | |
771 | 3176 if (len == f->width && hp == len - 1 && c != '\n') |
389 | 3177 goto draw_or_not; |
3178 | |
3179 switch (c) | |
3180 { | |
3181 case '\t': | |
3182 mouse_track_width = tab_width - (hp % tab_width); | |
3183 p++; | |
3184 hp += mouse_track_width; | |
3185 if (hp > x_mouse_x) | |
3186 { | |
3187 mouse_track_left = hp - mouse_track_width; | |
3188 goto draw_or_not; | |
3189 } | |
3190 continue; | |
3191 | |
3192 case '\n': | |
3193 mouse_track_width = -1; | |
3194 goto draw_or_not; | |
3195 | |
3196 default: | |
3197 if (ctl_arrow_p && (c < 040 || c == 0177)) | |
3198 { | |
3199 if (p > ZV) | |
3200 goto draw_or_not; | |
3201 | |
3202 mouse_track_width = 2; | |
3203 p++; | |
3204 hp +=2; | |
3205 if (hp > x_mouse_x) | |
3206 { | |
3207 mouse_track_left = hp - mouse_track_width; | |
3208 goto draw_or_not; | |
3209 } | |
3210 } | |
3211 else | |
3212 { | |
3213 mouse_track_width = 1; | |
3214 p++; | |
3215 hp++; | |
3216 } | |
3217 continue; | |
3218 } | |
3219 } | |
3220 while (hp <= x_mouse_x); | |
3221 | |
3222 draw_or_not: | |
3223 if (mouse_track_width) /* Over text; use text pointer shape. */ | |
3224 { | |
3225 XDefineCursor (x_current_display, | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3226 FRAME_X_WINDOW (f), |
771 | 3227 f->display.x->text_cursor); |
3228 x_rectangle (f, f->display.x->cursor_gc, | |
389 | 3229 mouse_track_left, mouse_track_top, |
3230 mouse_track_width, 1); | |
3231 } | |
3232 else if (in_mode_line) | |
3233 XDefineCursor (x_current_display, | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3234 FRAME_X_WINDOW (f), |
771 | 3235 f->display.x->modeline_cursor); |
389 | 3236 else |
3237 XDefineCursor (x_current_display, | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3238 FRAME_X_WINDOW (f), |
771 | 3239 f->display.x->nontext_cursor); |
389 | 3240 } |
3241 | |
3242 XFlush (x_current_display); | |
3243 UNBLOCK_INPUT; | |
3244 | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
3245 obj = read_char (-1, 0, 0, Qnil, 0); |
389 | 3246 BLOCK_INPUT; |
3247 } | |
3248 while (XTYPE (obj) == Lisp_Cons /* Mouse event */ | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3249 && EQ (Fcar (Fcdr (Fcdr (obj))), Qnil) /* Not scroll bar */ |
389 | 3250 && EQ (Vmouse_depressed, Qnil) /* Only motion events */ |
3251 && EQ (Vmouse_window, selected_window) /* In this window */ | |
771 | 3252 && x_mouse_frame); |
389 | 3253 |
1601
a371ec79bc31
* xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents:
1528
diff
changeset
|
3254 unread_command_event = obj; |
389 | 3255 |
3256 if (mouse_track_width) | |
3257 { | |
771 | 3258 x_rectangle (f, f->display.x->reverse_gc, |
389 | 3259 mouse_track_left, mouse_track_top, |
3260 mouse_track_width, 1); | |
3261 mouse_track_width = 0; | |
771 | 3262 if ((mouse_track_left == f->phys_cursor_x |
3263 || mouse_track_left - 1 == f->phys_cursor_x) | |
3264 && mouse_track_top == f->phys_cursor_y) | |
389 | 3265 { |
771 | 3266 x_display_cursor (f, 1); |
389 | 3267 } |
3268 } | |
3269 XDefineCursor (x_current_display, | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3270 FRAME_X_WINDOW (f), |
771 | 3271 f->display.x->nontext_cursor); |
389 | 3272 XFlush (x_current_display); |
3273 UNBLOCK_INPUT; | |
3274 | |
3275 return Qnil; | |
3276 } | |
3277 #endif | |
3278 | |
3279 #if 0 | |
3280 #include "glyphs.h" | |
3281 | |
3282 /* Draw a pixmap specified by IMAGE_DATA of dimensions WIDTH and HEIGHT | |
771 | 3283 on the frame F at position X, Y. */ |
3284 | |
3285 x_draw_pixmap (f, x, y, image_data, width, height) | |
3286 struct frame *f; | |
389 | 3287 int x, y, width, height; |
3288 char *image_data; | |
3289 { | |
3290 Pixmap image; | |
3291 | |
3292 image = XCreateBitmapFromData (x_current_display, | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3293 FRAME_X_WINDOW (f), image_data, |
389 | 3294 width, height); |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3295 XCopyPlane (x_current_display, image, FRAME_X_WINDOW (f), |
771 | 3296 f->display.x->normal_gc, 0, 0, width, height, x, y); |
389 | 3297 } |
3298 #endif | |
3299 | |
3300 #if 0 | |
3301 | |
3302 #ifdef HAVE_X11 | |
3303 #define XMouseEvent XEvent | |
3304 #define WhichMouseButton xbutton.button | |
3305 #define MouseWindow xbutton.window | |
3306 #define MouseX xbutton.x | |
3307 #define MouseY xbutton.y | |
3308 #define MouseTime xbutton.time | |
3309 #define ButtonReleased ButtonRelease | |
3310 #define ButtonPressed ButtonPress | |
3311 #else | |
3312 #define XMouseEvent XButtonEvent | |
3313 #define WhichMouseButton detail | |
3314 #define MouseWindow window | |
3315 #define MouseX x | |
3316 #define MouseY y | |
3317 #define MouseTime time | |
3318 #endif /* X11 */ | |
3319 | |
3320 DEFUN ("x-mouse-events", Fx_mouse_events, Sx_mouse_events, 0, 0, 0, | |
3321 "Return number of pending mouse events from X window system.") | |
3322 () | |
3323 { | |
3324 return make_number (queue_event_count (&x_mouse_queue)); | |
3325 } | |
3326 | |
3327 /* Encode the mouse button events in the form expected by the | |
3328 mouse code in Lisp. For X11, this means moving the masks around. */ | |
3329 | |
3330 static int | |
3331 encode_mouse_button (mouse_event) | |
3332 XMouseEvent mouse_event; | |
3333 { | |
3334 register int event_code; | |
3335 register char key_mask; | |
3336 | |
3337 event_code = mouse_event.detail & 3; | |
3338 key_mask = (mouse_event.detail >> 8) & 0xf0; | |
3339 event_code |= key_mask >> 1; | |
3340 if (mouse_event.type == ButtonReleased) event_code |= 0x04; | |
3341 return event_code; | |
3342 } | |
3343 | |
3344 DEFUN ("x-get-mouse-event", Fx_get_mouse_event, Sx_get_mouse_event, | |
3345 0, 1, 0, | |
3346 "Get next mouse event out of mouse event buffer.\n\ | |
3347 Optional ARG non-nil means return nil immediately if no pending event;\n\ | |
3348 otherwise, wait for an event. Returns a four-part list:\n\ | |
771 | 3349 ((X-POS Y-POS) WINDOW FRAME-PART KEYSEQ TIMESTAMP).\n\ |
3350 Normally X-POS and Y-POS are the position of the click on the frame\n\ | |
389 | 3351 (measured in characters and lines), and WINDOW is the window clicked in.\n\ |
3352 KEYSEQ is a string, the key sequence to be looked up in the mouse maps.\n\ | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3353 If FRAME-PART is non-nil, the event was on a scroll bar;\n\ |
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3354 then Y-POS is really the total length of the scroll bar, while X-POS is\n\ |
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3355 the relative position of the scroll bar's value within that total length,\n\ |
389 | 3356 and a third element OFFSET appears in that list: the height of the thumb-up\n\ |
3357 area at the top of the scroll bar.\n\ | |
771 | 3358 FRAME-PART is one of the following symbols:\n\ |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3359 `vertical-scroll-bar', `vertical-thumbup', `vertical-thumbdown',\n\ |
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3360 `horizontal-scroll-bar', `horizontal-thumbleft', `horizontal-thumbright'.\n\ |
389 | 3361 TIMESTAMP is the lower 23 bits of the X-server's timestamp for\n\ |
3362 the mouse event.") | |
3363 (arg) | |
3364 Lisp_Object arg; | |
3365 { | |
3366 XMouseEvent xrep; | |
3367 register int com_letter; | |
3368 register Lisp_Object tempx; | |
3369 register Lisp_Object tempy; | |
3370 Lisp_Object part, pos, timestamp; | |
3371 int prefix; | |
771 | 3372 struct frame *f; |
389 | 3373 |
3374 int tem; | |
3375 | |
3376 while (1) | |
3377 { | |
3378 BLOCK_INPUT; | |
3379 tem = dequeue_event (&xrep, &x_mouse_queue); | |
3380 UNBLOCK_INPUT; | |
3381 | |
3382 if (tem) | |
3383 { | |
3384 switch (xrep.type) | |
3385 { | |
3386 case ButtonPressed: | |
3387 case ButtonReleased: | |
3388 | |
3389 com_letter = encode_mouse_button (xrep); | |
3390 mouse_timestamp = xrep.MouseTime; | |
3391 | |
771 | 3392 if ((f = x_window_to_frame (xrep.MouseWindow)) != 0) |
389 | 3393 { |
771 | 3394 Lisp_Object frame; |
389 | 3395 |
771 | 3396 if (f->display.x->icon_desc == xrep.MouseWindow) |
389 | 3397 { |
771 | 3398 x_make_frame_visible (f); |
389 | 3399 continue; |
3400 } | |
3401 | |
3402 XSET (tempx, Lisp_Int, | |
771 | 3403 min (f->width-1, max (0, (xrep.MouseX - f->display.x->internal_border_width)/FONT_WIDTH (f->display.x->font)))); |
389 | 3404 XSET (tempy, Lisp_Int, |
771 | 3405 min (f->height-1, max (0, (xrep.MouseY - f->display.x->internal_border_width)/FONT_HEIGHT (f->display.x->font)))); |
389 | 3406 XSET (timestamp, Lisp_Int, (xrep.MouseTime & 0x7fffff)); |
771 | 3407 XSET (frame, Lisp_Frame, f); |
389 | 3408 |
3409 pos = Fcons (tempx, Fcons (tempy, Qnil)); | |
3410 Vmouse_window | |
771 | 3411 = Flocate_window_from_coordinates (frame, pos); |
389 | 3412 |
3413 Vmouse_event | |
3414 = Fcons (pos, | |
3415 Fcons (Vmouse_window, | |
3416 Fcons (Qnil, | |
3417 Fcons (Fchar_to_string (make_number (com_letter)), | |
3418 Fcons (timestamp, Qnil))))); | |
3419 return Vmouse_event; | |
3420 } | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3421 else if ((f = x_window_to_scroll_bar (xrep.MouseWindow, &part, &prefix)) != 0) |
389 | 3422 { |
3423 int pos, len; | |
3424 Lisp_Object keyseq; | |
3425 char *partname; | |
3426 | |
3427 keyseq = concat2 (Fchar_to_string (make_number (prefix)), | |
3428 Fchar_to_string (make_number (com_letter))); | |
3429 | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3430 pos = xrep.MouseY - (f->display.x->v_scroll_bar_width - 2); |
389 | 3431 XSET (tempx, Lisp_Int, pos); |
771 | 3432 len = ((FONT_HEIGHT (f->display.x->font) * f->height) |
3433 + f->display.x->internal_border_width | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3434 - (2 * (f->display.x->v_scroll_bar_width - 2))); |
389 | 3435 XSET (tempy, Lisp_Int, len); |
3436 XSET (timestamp, Lisp_Int, (xrep.MouseTime & 0x7fffff)); | |
771 | 3437 Vmouse_window = f->selected_window; |
389 | 3438 Vmouse_event |
3439 = Fcons (Fcons (tempx, Fcons (tempy, | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3440 Fcons (make_number (f->display.x->v_scroll_bar_width - 2), |
389 | 3441 Qnil))), |
3442 Fcons (Vmouse_window, | |
3443 Fcons (intern (part), | |
3444 Fcons (keyseq, Fcons (timestamp, | |
3445 Qnil))))); | |
3446 return Vmouse_event; | |
3447 } | |
3448 else | |
3449 continue; | |
3450 | |
3451 #ifdef HAVE_X11 | |
3452 case MotionNotify: | |
3453 | |
3454 com_letter = x11_encode_mouse_button (xrep); | |
771 | 3455 if ((f = x_window_to_frame (xrep.MouseWindow)) != 0) |
389 | 3456 { |
771 | 3457 Lisp_Object frame; |
389 | 3458 |
3459 XSET (tempx, Lisp_Int, | |
771 | 3460 min (f->width-1, |
3461 max (0, (xrep.MouseX - f->display.x->internal_border_width) | |
3462 / FONT_WIDTH (f->display.x->font)))); | |
389 | 3463 XSET (tempy, Lisp_Int, |
771 | 3464 min (f->height-1, |
3465 max (0, (xrep.MouseY - f->display.x->internal_border_width) | |
3466 / FONT_HEIGHT (f->display.x->font)))); | |
389 | 3467 |
771 | 3468 XSET (frame, Lisp_Frame, f); |
389 | 3469 XSET (timestamp, Lisp_Int, (xrep.MouseTime & 0x7fffff)); |
3470 | |
3471 pos = Fcons (tempx, Fcons (tempy, Qnil)); | |
3472 Vmouse_window | |
771 | 3473 = Flocate_window_from_coordinates (frame, pos); |
389 | 3474 |
3475 Vmouse_event | |
3476 = Fcons (pos, | |
3477 Fcons (Vmouse_window, | |
3478 Fcons (Qnil, | |
3479 Fcons (Fchar_to_string (make_number (com_letter)), | |
3480 Fcons (timestamp, Qnil))))); | |
3481 return Vmouse_event; | |
3482 } | |
3483 | |
3484 break; | |
3485 #endif /* HAVE_X11 */ | |
3486 | |
3487 default: | |
771 | 3488 if (f = x_window_to_frame (xrep.MouseWindow)) |
3489 Vmouse_window = f->selected_window; | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3490 else if (f = x_window_to_scroll_bar (xrep.MouseWindow, &part, &prefix)) |
771 | 3491 Vmouse_window = f->selected_window; |
389 | 3492 return Vmouse_event = Qnil; |
3493 } | |
3494 } | |
3495 | |
485 | 3496 if (!NILP (arg)) |
389 | 3497 return Qnil; |
3498 | |
3499 /* Wait till we get another mouse event. */ | |
3500 wait_reading_process_input (0, 0, 2, 0); | |
3501 } | |
3502 } | |
3503 #endif | |
3504 | |
3505 | |
3506 #ifndef HAVE_X11 | |
3507 DEFUN ("x-store-cut-buffer", Fx_store_cut_buffer, Sx_store_cut_buffer, | |
3508 1, 1, "sStore text in cut buffer: ", | |
3509 "Store contents of STRING into the cut buffer of the X window system.") | |
3510 (string) | |
3511 register Lisp_Object string; | |
3512 { | |
3513 int mask; | |
3514 | |
3515 CHECK_STRING (string, 1); | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3516 if (! FRAME_X_P (selected_frame)) |
771 | 3517 error ("Selected frame does not understand X protocol."); |
389 | 3518 |
3519 BLOCK_INPUT; | |
3520 XStoreBytes ((char *) XSTRING (string)->data, XSTRING (string)->size); | |
3521 UNBLOCK_INPUT; | |
3522 | |
3523 return Qnil; | |
3524 } | |
3525 | |
3526 DEFUN ("x-get-cut-buffer", Fx_get_cut_buffer, Sx_get_cut_buffer, 0, 0, 0, | |
3527 "Return contents of cut buffer of the X window system, as a string.") | |
3528 () | |
3529 { | |
3530 int len; | |
3531 register Lisp_Object string; | |
3532 int mask; | |
3533 register char *d; | |
3534 | |
3535 BLOCK_INPUT; | |
3536 d = XFetchBytes (&len); | |
3537 string = make_string (d, len); | |
3538 XFree (d); | |
3539 UNBLOCK_INPUT; | |
3540 return string; | |
3541 } | |
3542 #endif /* X10 */ | |
3543 | |
3544 #ifdef HAVE_X11 | |
3545 DEFUN ("x-rebind-key", Fx_rebind_key, Sx_rebind_key, 3, 3, 0, | |
3546 "Rebind X keysym KEYSYM, with MODIFIERS, to generate NEWSTRING.\n\ | |
3547 KEYSYM is a string which conforms to the X keysym definitions found\n\ | |
3548 in X11/keysymdef.h, sans the initial XK_. MODIFIERS is nil or a\n\ | |
3549 list of strings specifying modifier keys such as Control_L, which must\n\ | |
3550 also be depressed for NEWSTRING to appear.") | |
3551 (x_keysym, modifiers, newstring) | |
3552 register Lisp_Object x_keysym; | |
3553 register Lisp_Object modifiers; | |
3554 register Lisp_Object newstring; | |
3555 { | |
3556 char *rawstring; | |
642 | 3557 register KeySym keysym; |
3558 KeySym modifier_list[16]; | |
389 | 3559 |
3560 CHECK_STRING (x_keysym, 1); | |
3561 CHECK_STRING (newstring, 3); | |
3562 | |
3563 keysym = XStringToKeysym ((char *) XSTRING (x_keysym)->data); | |
3564 if (keysym == NoSymbol) | |
3565 error ("Keysym does not exist"); | |
3566 | |
485 | 3567 if (NILP (modifiers)) |
389 | 3568 XRebindKeysym (x_current_display, keysym, modifier_list, 0, |
3569 XSTRING (newstring)->data, XSTRING (newstring)->size); | |
3570 else | |
3571 { | |
3572 register Lisp_Object rest, mod; | |
3573 register int i = 0; | |
3574 | |
485 | 3575 for (rest = modifiers; !NILP (rest); rest = Fcdr (rest)) |
389 | 3576 { |
3577 if (i == 16) | |
3578 error ("Can't have more than 16 modifiers"); | |
3579 | |
3580 mod = Fcar (rest); | |
3581 CHECK_STRING (mod, 3); | |
3582 modifier_list[i] = XStringToKeysym ((char *) XSTRING (mod)->data); | |
3583 if (modifier_list[i] == NoSymbol | |
3584 || !IsModifierKey (modifier_list[i])) | |
3585 error ("Element is not a modifier keysym"); | |
3586 i++; | |
3587 } | |
3588 | |
3589 XRebindKeysym (x_current_display, keysym, modifier_list, i, | |
3590 XSTRING (newstring)->data, XSTRING (newstring)->size); | |
3591 } | |
3592 | |
3593 return Qnil; | |
3594 } | |
3595 | |
3596 DEFUN ("x-rebind-keys", Fx_rebind_keys, Sx_rebind_keys, 2, 2, 0, | |
3597 "Rebind KEYCODE to list of strings STRINGS.\n\ | |
3598 STRINGS should be a list of 16 elements, one for each shift combination.\n\ | |
3599 nil as element means don't change.\n\ | |
3600 See the documentation of `x-rebind-key' for more information.") | |
3601 (keycode, strings) | |
3602 register Lisp_Object keycode; | |
3603 register Lisp_Object strings; | |
3604 { | |
3605 register Lisp_Object item; | |
3606 register unsigned char *rawstring; | |
3607 KeySym rawkey, modifier[1]; | |
3608 int strsize; | |
3609 register unsigned i; | |
3610 | |
3611 CHECK_NUMBER (keycode, 1); | |
3612 CHECK_CONS (strings, 2); | |
3613 rawkey = (KeySym) ((unsigned) (XINT (keycode))) & 255; | |
3614 for (i = 0; i <= 15; strings = Fcdr (strings), i++) | |
3615 { | |
3616 item = Fcar (strings); | |
485 | 3617 if (!NILP (item)) |
389 | 3618 { |
3619 CHECK_STRING (item, 2); | |
3620 strsize = XSTRING (item)->size; | |
3621 rawstring = (unsigned char *) xmalloc (strsize); | |
3622 bcopy (XSTRING (item)->data, rawstring, strsize); | |
3623 modifier[1] = 1 << i; | |
3624 XRebindKeysym (x_current_display, rawkey, modifier, 1, | |
3625 rawstring, strsize); | |
3626 } | |
3627 } | |
3628 return Qnil; | |
3629 } | |
3630 #else | |
3631 DEFUN ("x-rebind-key", Fx_rebind_key, Sx_rebind_key, 3, 3, 0, | |
3632 "Rebind KEYCODE, with shift bits SHIFT-MASK, to new string NEWSTRING.\n\ | |
3633 KEYCODE and SHIFT-MASK should be numbers representing the X keyboard code\n\ | |
3634 and shift mask respectively. NEWSTRING is an arbitrary string of keystrokes.\n\ | |
3635 If SHIFT-MASK is nil, then KEYCODE's key will be bound to NEWSTRING for\n\ | |
3636 all shift combinations.\n\ | |
3637 Shift Lock 1 Shift 2\n\ | |
3638 Meta 4 Control 8\n\ | |
3639 \n\ | |
3640 For values of KEYCODE, see /usr/lib/Xkeymap.txt (remember that the codes\n\ | |
3641 in that file are in octal!)\n\ | |
3642 \n\ | |
3643 NOTE: due to an X bug, this function will not take effect unless one has\n\ | |
3644 a `~/.Xkeymap' file. (See the documentation for the `keycomp' program.)\n\ | |
3645 This problem will be fixed in X version 11.") | |
3646 | |
3647 (keycode, shift_mask, newstring) | |
3648 register Lisp_Object keycode; | |
3649 register Lisp_Object shift_mask; | |
3650 register Lisp_Object newstring; | |
3651 { | |
3652 char *rawstring; | |
3653 int keysym, rawshift; | |
3654 int i, strsize; | |
3655 | |
3656 CHECK_NUMBER (keycode, 1); | |
485 | 3657 if (!NILP (shift_mask)) |
389 | 3658 CHECK_NUMBER (shift_mask, 2); |
3659 CHECK_STRING (newstring, 3); | |
3660 strsize = XSTRING (newstring)->size; | |
3661 rawstring = (char *) xmalloc (strsize); | |
3662 bcopy (XSTRING (newstring)->data, rawstring, strsize); | |
3663 | |
3664 keysym = ((unsigned) (XINT (keycode))) & 255; | |
3665 | |
485 | 3666 if (NILP (shift_mask)) |
389 | 3667 { |
3668 for (i = 0; i <= 15; i++) | |
3669 XRebindCode (keysym, i<<11, rawstring, strsize); | |
3670 } | |
3671 else | |
3672 { | |
3673 rawshift = (((unsigned) (XINT (shift_mask))) & 15) << 11; | |
3674 XRebindCode (keysym, rawshift, rawstring, strsize); | |
3675 } | |
3676 return Qnil; | |
3677 } | |
3678 | |
3679 DEFUN ("x-rebind-keys", Fx_rebind_keys, Sx_rebind_keys, 2, 2, 0, | |
3680 "Rebind KEYCODE to list of strings STRINGS.\n\ | |
3681 STRINGS should be a list of 16 elements, one for each shift combination.\n\ | |
3682 nil as element means don't change.\n\ | |
3683 See the documentation of `x-rebind-key' for more information.") | |
3684 (keycode, strings) | |
3685 register Lisp_Object keycode; | |
3686 register Lisp_Object strings; | |
3687 { | |
3688 register Lisp_Object item; | |
3689 register char *rawstring; | |
3690 KeySym rawkey, modifier[1]; | |
3691 int strsize; | |
3692 register unsigned i; | |
3693 | |
3694 CHECK_NUMBER (keycode, 1); | |
3695 CHECK_CONS (strings, 2); | |
3696 rawkey = (KeySym) ((unsigned) (XINT (keycode))) & 255; | |
3697 for (i = 0; i <= 15; strings = Fcdr (strings), i++) | |
3698 { | |
3699 item = Fcar (strings); | |
485 | 3700 if (!NILP (item)) |
389 | 3701 { |
3702 CHECK_STRING (item, 2); | |
3703 strsize = XSTRING (item)->size; | |
3704 rawstring = (char *) xmalloc (strsize); | |
3705 bcopy (XSTRING (item)->data, rawstring, strsize); | |
3706 XRebindCode (rawkey, i << 11, rawstring, strsize); | |
3707 } | |
3708 } | |
3709 return Qnil; | |
3710 } | |
3711 #endif /* not HAVE_X11 */ | |
3712 | |
3713 #ifdef HAVE_X11 | |
3714 Visual * | |
3715 select_visual (screen, depth) | |
3716 Screen *screen; | |
3717 unsigned int *depth; | |
3718 { | |
3719 Visual *v; | |
3720 XVisualInfo *vinfo, vinfo_template; | |
3721 int n_visuals; | |
3722 | |
3723 v = DefaultVisualOfScreen (screen); | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3724 |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3725 #ifdef HAVE_X11R4 |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3726 vinfo_template.visualid = XVisualIDFromVisual (v); |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3727 #else |
2341
1982e2983822
* xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents:
2328
diff
changeset
|
3728 vinfo_template.visualid = v->visualid; |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3729 #endif |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3730 |
389 | 3731 vinfo = XGetVisualInfo (x_current_display, VisualIDMask, &vinfo_template, |
3732 &n_visuals); | |
3733 if (n_visuals != 1) | |
3734 fatal ("Can't get proper X visual info"); | |
3735 | |
3736 if ((1 << vinfo->depth) == vinfo->colormap_size) | |
3737 *depth = vinfo->depth; | |
3738 else | |
3739 { | |
3740 int i = 0; | |
3741 int n = vinfo->colormap_size - 1; | |
3742 while (n) | |
3743 { | |
3744 n = n >> 1; | |
3745 i++; | |
3746 } | |
3747 *depth = i; | |
3748 } | |
3749 | |
3750 XFree ((char *) vinfo); | |
3751 return v; | |
3752 } | |
3753 #endif /* HAVE_X11 */ | |
3754 | |
3755 DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection, | |
3756 1, 2, 0, "Open a connection to an X server.\n\ | |
3757 DISPLAY is the name of the display to connect to. Optional second\n\ | |
3758 arg XRM_STRING is a string of resources in xrdb format.") | |
3759 (display, xrm_string) | |
3760 Lisp_Object display, xrm_string; | |
3761 { | |
3762 unsigned int n_planes; | |
3763 unsigned char *xrm_option; | |
3764 | |
3765 CHECK_STRING (display, 0); | |
3766 if (x_current_display != 0) | |
3767 error ("X server connection is already initialized"); | |
3768 | |
3769 /* This is what opens the connection and sets x_current_display. | |
3770 This also initializes many symbols, such as those used for input. */ | |
3771 x_term_init (XSTRING (display)->data); | |
3772 | |
3773 #ifdef HAVE_X11 | |
3774 XFASTINT (Vwindow_system_version) = 11; | |
3775 | |
3776 if (!EQ (xrm_string, Qnil)) | |
3777 { | |
3778 CHECK_STRING (xrm_string, 1); | |
3779 xrm_option = (unsigned char *) XSTRING (xrm_string); | |
3780 } | |
3781 else | |
3782 xrm_option = (unsigned char *) 0; | |
3783 xrdb = x_load_resources (x_current_display, xrm_option, EMACS_CLASS); | |
2283
997f8e481bf8
* xfns.c (Fx_open_connection): If we have X11R5, use
Jim Blandy <jimb@redhat.com>
parents:
2279
diff
changeset
|
3784 #ifdef HAVE_X11R5 |
997f8e481bf8
* xfns.c (Fx_open_connection): If we have X11R5, use
Jim Blandy <jimb@redhat.com>
parents:
2279
diff
changeset
|
3785 XrmSetDatabase (x_current_display, xrdb); |
997f8e481bf8
* xfns.c (Fx_open_connection): If we have X11R5, use
Jim Blandy <jimb@redhat.com>
parents:
2279
diff
changeset
|
3786 #else |
389 | 3787 x_current_display->db = xrdb; |
2283
997f8e481bf8
* xfns.c (Fx_open_connection): If we have X11R5, use
Jim Blandy <jimb@redhat.com>
parents:
2279
diff
changeset
|
3788 #endif |
389 | 3789 |
3790 x_screen = DefaultScreenOfDisplay (x_current_display); | |
3791 | |
3792 screen_visual = select_visual (x_screen, &n_planes); | |
1528
924c8a609582
* xfns.c (x_decode_color, Fx_color_display_p): x_screen_planes is
Jim Blandy <jimb@redhat.com>
parents:
1438
diff
changeset
|
3793 x_screen_planes = n_planes; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3794 x_screen_height = HeightOfScreen (x_screen); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3795 x_screen_width = WidthOfScreen (x_screen); |
389 | 3796 |
3797 /* X Atoms used by emacs. */ | |
2197
fb5a1caebef6
(Xatom_wm_change_state): Just declare.
Richard M. Stallman <rms@gnu.org>
parents:
2136
diff
changeset
|
3798 Xatoms_of_xselect (); |
389 | 3799 BLOCK_INPUT; |
641 | 3800 Xatom_wm_protocols = XInternAtom (x_current_display, "WM_PROTOCOLS", |
3801 False); | |
3802 Xatom_wm_take_focus = XInternAtom (x_current_display, "WM_TAKE_FOCUS", | |
3803 False); | |
3804 Xatom_wm_save_yourself = XInternAtom (x_current_display, "WM_SAVE_YOURSELF", | |
3805 False); | |
3806 Xatom_wm_delete_window = XInternAtom (x_current_display, "WM_DELETE_WINDOW", | |
3807 False); | |
3808 Xatom_wm_change_state = XInternAtom (x_current_display, "WM_CHANGE_STATE", | |
3809 False); | |
3810 Xatom_wm_configure_denied = XInternAtom (x_current_display, | |
3811 "WM_CONFIGURE_DENIED", False); | |
3812 Xatom_wm_window_moved = XInternAtom (x_current_display, "WM_MOVED", | |
3813 False); | |
389 | 3814 UNBLOCK_INPUT; |
3815 #else /* not HAVE_X11 */ | |
3816 XFASTINT (Vwindow_system_version) = 10; | |
3817 #endif /* not HAVE_X11 */ | |
3818 return Qnil; | |
3819 } | |
3820 | |
3821 DEFUN ("x-close-current-connection", Fx_close_current_connection, | |
3822 Sx_close_current_connection, | |
3823 0, 0, 0, "Close the connection to the current X server.") | |
3824 () | |
3825 { | |
3826 #ifdef HAVE_X11 | |
3827 /* This is ONLY used when killing emacs; For switching displays | |
3828 we'll have to take care of setting CloseDownMode elsewhere. */ | |
3829 | |
3830 if (x_current_display) | |
3831 { | |
3832 BLOCK_INPUT; | |
3833 XSetCloseDownMode (x_current_display, DestroyAll); | |
3834 XCloseDisplay (x_current_display); | |
3835 } | |
3836 else | |
3837 fatal ("No current X display connection to close\n"); | |
3838 #endif | |
3839 return Qnil; | |
3840 } | |
3841 | |
3842 DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, | |
3843 1, 1, 0, "If ON is non-nil, report X errors as soon as the erring request is made.\n\ | |
3844 If ON is nil, allow buffering of requests.\n\ | |
3845 Turning on synchronization prohibits the Xlib routines from buffering\n\ | |
3846 requests and seriously degrades performance, but makes debugging much\n\ | |
3847 easier.") | |
3848 (on) | |
3849 Lisp_Object on; | |
3850 { | |
3851 XSynchronize (x_current_display, !EQ (on, Qnil)); | |
3852 | |
3853 return Qnil; | |
3854 } | |
3855 | |
3856 | |
3857 syms_of_xfns () | |
3858 { | |
3859 /* This is zero if not using X windows. */ | |
3860 x_current_display = 0; | |
3861 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3862 /* The section below is built by the lisp expression at the top of the file, |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3863 just above where these variables are declared. */ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3864 /*&&& init symbols here &&&*/ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3865 Qauto_raise = intern ("auto-raise"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3866 staticpro (&Qauto_raise); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3867 Qauto_lower = intern ("auto-lower"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3868 staticpro (&Qauto_lower); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3869 Qbackground_color = intern ("background-color"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3870 staticpro (&Qbackground_color); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3871 Qbar = intern ("bar"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3872 staticpro (&Qbar); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3873 Qborder_color = intern ("border-color"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3874 staticpro (&Qborder_color); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3875 Qborder_width = intern ("border-width"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3876 staticpro (&Qborder_width); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3877 Qbox = intern ("box"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3878 staticpro (&Qbox); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3879 Qcursor_color = intern ("cursor-color"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3880 staticpro (&Qcursor_color); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3881 Qcursor_type = intern ("cursor-type"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3882 staticpro (&Qcursor_type); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3883 Qfont = intern ("font"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3884 staticpro (&Qfont); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3885 Qforeground_color = intern ("foreground-color"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3886 staticpro (&Qforeground_color); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3887 Qgeometry = intern ("geometry"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3888 staticpro (&Qgeometry); |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
3889 Qicon = intern ("icon"); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
3890 staticpro (&Qicon); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3891 Qicon_left = intern ("icon-left"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3892 staticpro (&Qicon_left); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3893 Qicon_top = intern ("icon-top"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3894 staticpro (&Qicon_top); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3895 Qicon_type = intern ("icon-type"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3896 staticpro (&Qicon_type); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3897 Qinternal_border_width = intern ("internal-border-width"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3898 staticpro (&Qinternal_border_width); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3899 Qleft = intern ("left"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3900 staticpro (&Qleft); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3901 Qmouse_color = intern ("mouse-color"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3902 staticpro (&Qmouse_color); |
1874
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
3903 Qnone = intern ("none"); |
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
3904 staticpro (&Qnone); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3905 Qparent_id = intern ("parent-id"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3906 staticpro (&Qparent_id); |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
3907 Qsuppress_icon = intern ("suppress-icon"); |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
3908 staticpro (&Qsuppress_icon); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3909 Qtop = intern ("top"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3910 staticpro (&Qtop); |
389 | 3911 Qundefined_color = intern ("undefined-color"); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3912 staticpro (&Qundefined_color); |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3913 Qvertical_scroll_bars = intern ("vertical-scroll-bars"); |
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3914 staticpro (&Qvertical_scroll_bars); |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
3915 Qvisibility = intern ("visibility"); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
3916 staticpro (&Qvisibility); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3917 Qwindow_id = intern ("window-id"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3918 staticpro (&Qwindow_id); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3919 Qx_frame_parameter = intern ("x-frame-parameter"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3920 staticpro (&Qx_frame_parameter); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3921 /* This is the end of symbol initialization. */ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3922 |
389 | 3923 Fput (Qundefined_color, Qerror_conditions, |
3924 Fcons (Qundefined_color, Fcons (Qerror, Qnil))); | |
3925 Fput (Qundefined_color, Qerror_message, | |
3926 build_string ("Undefined color")); | |
3927 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3928 init_x_parm_symbols (); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3929 |
389 | 3930 DEFVAR_INT ("mouse-buffer-offset", &mouse_buffer_offset, |
3931 "The buffer offset of the character under the pointer."); | |
1528
924c8a609582
* xfns.c (x_decode_color, Fx_color_display_p): x_screen_planes is
Jim Blandy <jimb@redhat.com>
parents:
1438
diff
changeset
|
3932 mouse_buffer_offset = 0; |
389 | 3933 |
3934 DEFVAR_INT ("x-pointer-shape", &Vx_pointer_shape, | |
3935 "The shape of the pointer when over text."); | |
3936 Vx_pointer_shape = Qnil; | |
3937 | |
3938 DEFVAR_INT ("x-nontext-pointer-shape", &Vx_nontext_pointer_shape, | |
3939 "The shape of the pointer when not over text."); | |
3940 Vx_nontext_pointer_shape = Qnil; | |
3941 | |
3942 DEFVAR_INT ("x-mode-pointer-shape", &Vx_mode_pointer_shape, | |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
3943 "The shape of the pointer when over the mode line."); |
389 | 3944 Vx_mode_pointer_shape = Qnil; |
3945 | |
3946 DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel, | |
3947 "A string indicating the foreground color of the cursor box."); | |
3948 Vx_cursor_fore_pixel = Qnil; | |
3949 | |
3950 DEFVAR_LISP ("mouse-grabbed", &Vmouse_depressed, | |
3951 "Non-nil if a mouse button is currently depressed."); | |
3952 Vmouse_depressed = Qnil; | |
3953 | |
3954 DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, | |
3955 "t if no X window manager is in use."); | |
3956 | |
3957 #ifdef HAVE_X11 | |
3958 defsubr (&Sx_get_resource); | |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
3959 #if 0 |
389 | 3960 defsubr (&Sx_draw_rectangle); |
3961 defsubr (&Sx_erase_rectangle); | |
3962 defsubr (&Sx_contour_region); | |
3963 defsubr (&Sx_uncontour_region); | |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
3964 #endif |
2277
773e47f29c5a
(Fx_display_color_p): Renamed from Fx_color_display_p.
Richard M. Stallman <rms@gnu.org>
parents:
2276
diff
changeset
|
3965 defsubr (&Sx_display_color_p); |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
3966 defsubr (&Sx_color_defined_p); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3967 defsubr (&Sx_server_vendor); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3968 defsubr (&Sx_server_version); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3969 defsubr (&Sx_display_pixel_width); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3970 defsubr (&Sx_display_pixel_height); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3971 defsubr (&Sx_display_mm_width); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3972 defsubr (&Sx_display_mm_height); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3973 defsubr (&Sx_display_screens); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3974 defsubr (&Sx_display_planes); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3975 defsubr (&Sx_display_color_cells); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3976 defsubr (&Sx_display_visual_class); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3977 defsubr (&Sx_display_backing_store); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3978 defsubr (&Sx_display_save_under); |
389 | 3979 #if 0 |
3980 defsubr (&Sx_track_pointer); | |
3981 defsubr (&Sx_grab_pointer); | |
3982 defsubr (&Sx_ungrab_pointer); | |
436
6e0a136fca4f
*** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents:
398
diff
changeset
|
3983 #endif |
389 | 3984 #else |
3985 defsubr (&Sx_get_default); | |
3986 defsubr (&Sx_store_cut_buffer); | |
3987 defsubr (&Sx_get_cut_buffer); | |
3988 defsubr (&Sx_set_face); | |
3989 #endif | |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
3990 defsubr (&Sx_parse_geometry); |
771 | 3991 defsubr (&Sx_create_frame); |
3992 defsubr (&Sfocus_frame); | |
3993 defsubr (&Sunfocus_frame); | |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
3994 #if 0 |
389 | 3995 defsubr (&Sx_horizontal_line); |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
3996 #endif |
389 | 3997 defsubr (&Sx_rebind_key); |
3998 defsubr (&Sx_rebind_keys); | |
3999 defsubr (&Sx_open_connection); | |
4000 defsubr (&Sx_close_current_connection); | |
4001 defsubr (&Sx_synchronize); | |
4002 | |
4003 /* This was used in the old event interface which used a separate | |
4004 event queue.*/ | |
4005 #if 0 | |
4006 defsubr (&Sx_mouse_events); | |
4007 defsubr (&Sx_get_mouse_event); | |
4008 #endif | |
4009 } | |
4010 | |
4011 #endif /* HAVE_X_WINDOWS */ |