Mercurial > emacs
annotate src/xfns.c @ 2328:82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
(Fx_color_defined_p): Renamed from Fx_defined_color.
(syms_of_xfns): Adjusted.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Tue, 23 Mar 1993 04:58:07 +0000 |
parents | 0d8ce1b8ceee |
children | 1982e2983822 |
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 | |
771 | 1745 /* Create the GC's of this frame. |
389 | 1746 Note that many default values are used. */ |
1747 | |
1748 /* Normal video */ | |
771 | 1749 gc_values.font = f->display.x->font->fid; |
1750 gc_values.foreground = f->display.x->foreground_pixel; | |
1751 gc_values.background = f->display.x->background_pixel; | |
389 | 1752 gc_values.line_width = 0; /* Means 1 using fast algorithm. */ |
771 | 1753 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
|
1754 FRAME_X_WINDOW (f), |
389 | 1755 GCLineWidth | GCFont |
1756 | GCForeground | GCBackground, | |
1757 &gc_values); | |
1758 | |
1759 /* Reverse video style. */ | |
771 | 1760 gc_values.foreground = f->display.x->background_pixel; |
1761 gc_values.background = f->display.x->foreground_pixel; | |
1762 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
|
1763 FRAME_X_WINDOW (f), |
389 | 1764 GCFont | GCForeground | GCBackground |
1765 | GCLineWidth, | |
1766 &gc_values); | |
1767 | |
1768 /* Cursor has cursor-color background, background-color foreground. */ | |
771 | 1769 gc_values.foreground = f->display.x->background_pixel; |
1770 gc_values.background = f->display.x->cursor_pixel; | |
389 | 1771 gc_values.fill_style = FillOpaqueStippled; |
1772 gc_values.stipple | |
1773 = XCreateBitmapFromData (x_current_display, ROOT_WINDOW, | |
1774 cursor_bits, 16, 16); | |
771 | 1775 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
|
1776 = XCreateGC (x_current_display, FRAME_X_WINDOW (f), |
389 | 1777 (GCFont | GCForeground | GCBackground |
1778 | GCFillStyle | GCStipple | GCLineWidth), | |
1779 &gc_values); | |
1780 | |
1781 /* Create the gray border tile used when the pointer is not in | |
771 | 1782 the frame. Since this depends on the frame's pixel values, |
1783 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
|
1784 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
|
1785 = (XCreatePixmapFromBitmapData |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1786 (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
|
1787 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
|
1788 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
|
1789 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
|
1790 DefaultDepth (x_current_display, XDefaultScreen (x_current_display)))); |
389 | 1791 } |
1792 #endif /* HAVE_X11 */ | |
1793 | |
771 | 1794 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, |
389 | 1795 1, 1, 0, |
771 | 1796 "Make a new X window, which is called a \"frame\" in Emacs terms.\n\ |
1797 Return an Emacs frame object representing the X window.\n\ | |
1798 ALIST is an alist of frame parameters.\n\ | |
1799 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
|
1800 and do not specify a specific minibuffer window to use,\n\ |
771 | 1801 then `default-minibuffer-frame' must be a frame whose minibuffer can\n\ |
1802 be shared by the new frame.") | |
389 | 1803 (parms) |
1804 Lisp_Object parms; | |
1805 { | |
1806 #ifdef HAVE_X11 | |
771 | 1807 struct frame *f; |
1808 Lisp_Object frame, tem; | |
389 | 1809 Lisp_Object name; |
1810 int minibuffer_only = 0; | |
1811 long window_prompting = 0; | |
1812 int width, height; | |
1813 | |
1814 if (x_current_display == 0) | |
1815 error ("X windows are not in use or not initialized"); | |
1816 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1817 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
|
1818 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
|
1819 && ! EQ (name, Qunbound) |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1820 && ! NILP (name)) |
771 | 1821 error ("x-create-frame: name parameter must be a string"); |
398 | 1822 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1823 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
|
1824 if (EQ (tem, Qnone) || NILP (tem)) |
771 | 1825 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
|
1826 else if (EQ (tem, Qonly)) |
389 | 1827 { |
771 | 1828 f = make_minibuffer_frame (); |
389 | 1829 minibuffer_only = 1; |
1830 } | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1831 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
|
1832 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
|
1833 else |
771 | 1834 f = make_frame (1); |
1835 | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1836 /* 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
|
1837 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
|
1838 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1839 /* 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
|
1840 be set. */ |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1841 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
|
1842 { |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1843 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
|
1844 f->explicit_name = 0; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1845 } |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1846 else |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1847 { |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1848 f->name = name; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1849 f->explicit_name = 1; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1850 } |
771 | 1851 |
1852 XSET (frame, Lisp_Frame, f); | |
1853 f->output_method = output_x_window; | |
1854 f->display.x = (struct x_display *) xmalloc (sizeof (struct x_display)); | |
1855 bzero (f->display.x, sizeof (struct x_display)); | |
1856 | |
1857 /* Note that the frame has no physical cursor right now. */ | |
1858 f->phys_cursor_x = -1; | |
485 | 1859 |
389 | 1860 /* Extract the window parameters from the supplied values |
1861 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
|
1862 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
|
1863 "font", "Font", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1864 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
|
1865 "borderwidth", "BorderWidth", number); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1866 /* 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
|
1867 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
|
1868 "internalBorderWidth", "BorderWidth", number); |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1869 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
|
1870 "verticalScrollBars", "ScrollBars", boolean); |
389 | 1871 |
1872 /* 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
|
1873 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
|
1874 "foreground", "Foreground", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1875 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
|
1876 "background", "Background", string); |
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, 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
|
1878 "pointerColor", "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, 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
|
1880 "cursorColor", "Foreground", 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, 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
|
1882 "borderColor", "BorderColor", string); |
389 | 1883 |
771 | 1884 f->display.x->parent_desc = ROOT_WINDOW; |
1885 window_prompting = x_figure_window_size (f, parms); | |
1886 | |
1887 x_window (f); | |
1888 x_icon (f, parms); | |
1889 x_make_gc (f); | |
1890 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1891 /* 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
|
1892 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
|
1893 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
|
1894 "iconType", "IconType", symbol); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1895 |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1896 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
|
1897 "autoRaise", "AutoRaiseLower", boolean); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1898 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
|
1899 "autoLower", "AutoRaiseLower", boolean); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1900 x_default_parameter (f, parms, Qcursor_type, Qbox, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1901 "cursorType", "CursorType", symbol); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1902 |
771 | 1903 /* Dimensions, especially f->height, must be done via change_frame_size. |
389 | 1904 Change will not be effected unless different from the current |
771 | 1905 f->height. */ |
1906 width = f->width; | |
1907 height = f->height; | |
1908 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
|
1909 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
|
1910 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1911 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
|
1912 "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
|
1913 |
389 | 1914 BLOCK_INPUT; |
771 | 1915 x_wm_set_size_hint (f, window_prompting); |
389 | 1916 UNBLOCK_INPUT; |
1917 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1918 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean); |
771 | 1919 f->no_split = minibuffer_only || EQ (tem, Qt); |
389 | 1920 |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1921 /* 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
|
1922 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
|
1923 { |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1924 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
|
1925 |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1926 if (EQ (visibility, Qunbound)) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1927 visibility = Qt; |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1928 |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1929 if (EQ (visibility, Qicon)) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1930 x_iconify_frame (f); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1931 else if (! NILP (visibility)) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1932 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
|
1933 else |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1934 /* Must have been Qnil. */ |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1935 ; |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1936 } |
771 | 1937 |
1938 return frame; | |
389 | 1939 #else /* X10 */ |
771 | 1940 struct frame *f; |
1941 Lisp_Object frame, tem; | |
389 | 1942 Lisp_Object name; |
1943 int pixelwidth, pixelheight; | |
1944 Cursor cursor; | |
1945 int height, width; | |
1946 Window parent; | |
1947 Pixmap temp; | |
1948 int minibuffer_only = 0; | |
1949 Lisp_Object vscroll, hscroll; | |
1950 | |
1951 if (x_current_display == 0) | |
1952 error ("X windows are not in use or not initialized"); | |
1953 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1954 name = Fassq (Qname, parms); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1955 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1956 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
|
1957 if (EQ (tem, Qnone)) |
771 | 1958 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
|
1959 else if (EQ (tem, Qonly)) |
389 | 1960 { |
771 | 1961 f = make_minibuffer_frame (); |
389 | 1962 minibuffer_only = 1; |
1963 } | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1964 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
|
1965 f = make_frame (1); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1966 else |
771 | 1967 f = make_frame_without_minibuffer (tem); |
389 | 1968 |
1969 parent = ROOT_WINDOW; | |
1970 | |
771 | 1971 XSET (frame, Lisp_Frame, f); |
1972 f->output_method = output_x_window; | |
1973 f->display.x = (struct x_display *) xmalloc (sizeof (struct x_display)); | |
1974 bzero (f->display.x, sizeof (struct x_display)); | |
389 | 1975 |
1976 /* Some temprorary default values for height and width. */ | |
1977 width = 80; | |
1978 height = 40; | |
771 | 1979 f->display.x->left_pos = -1; |
1980 f->display.x->top_pos = -1; | |
1981 | |
1982 /* Give the frame a default name (which may be overridden with PARMS). */ | |
389 | 1983 |
1984 strncpy (iconidentity, ICONTAG, MAXICID); | |
1985 if (gethostname (&iconidentity[sizeof (ICONTAG) - 1], | |
1986 (MAXICID - 1) - sizeof (ICONTAG))) | |
1987 iconidentity[sizeof (ICONTAG) - 2] = '\0'; | |
771 | 1988 f->name = build_string (iconidentity); |
389 | 1989 |
1990 /* Extract some window parameters from the supplied values. | |
1991 These are the parameters that affect window geometry. */ | |
1992 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1993 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
|
1994 if (EQ (tem, Qunbound)) |
389 | 1995 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
|
1996 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
|
1997 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
|
1998 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
|
1999 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
|
2000 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
|
2001 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
|
2002 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
|
2003 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
|
2004 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
|
2005 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
|
2006 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
|
2007 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
|
2008 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
|
2009 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
|
2010 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
|
2011 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
|
2012 Qnil, "AutoRaise", 0, boolean); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2013 |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2014 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
|
2015 vscroll = EQ (x_get_arg (parms, Qvertical_scroll_bar, 0, 0, boolean), Qt); |
389 | 2016 |
771 | 2017 if (f->display.x->internal_border_width < 0) |
2018 f->display.x->internal_border_width = 0; | |
389 | 2019 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2020 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
|
2021 if (!EQ (tem, Qunbound)) |
389 | 2022 { |
2023 WINDOWINFO_TYPE wininfo; | |
2024 int nchildren; | |
2025 Window *children, root; | |
2026 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2027 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
|
2028 FRAME_X_WINDOW (f) = (Window) XINT (tem); |
389 | 2029 |
2030 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
|
2031 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
|
2032 XQueryTree (FRAME_X_WINDOW (f), &parent, &nchildren, &children); |
389 | 2033 free (children); |
2034 UNBLOCK_INPUT; | |
2035 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2036 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
|
2037 width = PIXEL_TO_CHAR_WIDTH (f, wininfo.width); |
771 | 2038 f->display.x->left_pos = wininfo.x; |
2039 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
|
2040 FRAME_SET_VISIBILITY (f, wininfo.mapped != 0); |
771 | 2041 f->display.x->border_width = wininfo.bdrwidth; |
2042 f->display.x->parent_desc = parent; | |
389 | 2043 } |
2044 else | |
2045 { | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2046 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
|
2047 if (!EQ (tem, Qunbound)) |
389 | 2048 { |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2049 CHECK_NUMBER (tem, 0); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2050 parent = (Window) XINT (tem); |
389 | 2051 } |
771 | 2052 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
|
2053 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
|
2054 if (EQ (tem, Qunbound)) |
389 | 2055 { |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2056 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
|
2057 if (EQ (tem, Qunbound)) |
389 | 2058 { |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2059 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
|
2060 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
|
2061 tem = x_get_arg (parms, Qleft, 0, 0, number); |
389 | 2062 } |
2063 } | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2064 /* Now TEM is Qunbound if no edge or size was specified. |
389 | 2065 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
|
2066 if (EQ (tem, Qunbound)) |
389 | 2067 { |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2068 tem = x_get_arg (parms, Qgeometry, 0, 0, number); |
771 | 2069 x_rubber_band (f, |
2070 &f->display.x->left_pos, &f->display.x->top_pos, | |
389 | 2071 &width, &height, |
2072 (XTYPE (tem) == Lisp_String | |
2073 ? (char *) XSTRING (tem)->data : ""), | |
771 | 2074 XSTRING (f->name)->data, |
485 | 2075 !NILP (hscroll), !NILP (vscroll)); |
389 | 2076 } |
2077 else | |
2078 { | |
2079 /* Here if at least one edge or size was specified. | |
2080 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
|
2081 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
|
2082 if (EQ (tem, Qunbound)) |
389 | 2083 error ("Height not specified"); |
2084 CHECK_NUMBER (tem, 0); | |
2085 height = XINT (tem); | |
2086 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2087 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
|
2088 if (EQ (tem, Qunbound)) |
389 | 2089 error ("Width not specified"); |
2090 CHECK_NUMBER (tem, 0); | |
2091 width = XINT (tem); | |
2092 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2093 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
|
2094 if (EQ (tem, Qunbound)) |
389 | 2095 error ("Top position not specified"); |
2096 CHECK_NUMBER (tem, 0); | |
771 | 2097 f->display.x->left_pos = XINT (tem); |
389 | 2098 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2099 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
|
2100 if (EQ (tem, Qunbound)) |
389 | 2101 error ("Left position not specified"); |
2102 CHECK_NUMBER (tem, 0); | |
771 | 2103 f->display.x->top_pos = XINT (tem); |
389 | 2104 } |
2105 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2106 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
|
2107 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, height); |
389 | 2108 |
2109 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
|
2110 FRAME_X_WINDOW (f) |
389 | 2111 = XCreateWindow (parent, |
771 | 2112 f->display.x->left_pos, /* Absolute horizontal offset */ |
2113 f->display.x->top_pos, /* Absolute Vertical offset */ | |
389 | 2114 pixelwidth, pixelheight, |
771 | 2115 f->display.x->border_width, |
389 | 2116 BLACK_PIX_DEFAULT, WHITE_PIX_DEFAULT); |
2117 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
|
2118 if (FRAME_X_WINDOW (f) == 0) |
389 | 2119 error ("Unable to create window."); |
2120 } | |
2121 | |
2122 /* Install the now determined height and width | |
2123 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
|
2124 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
|
2125 XSelectInput (FRAME_X_WINDOW (f), KeyPressed | ExposeWindow |
389 | 2126 | ButtonPressed | ButtonReleased | ExposeRegion | ExposeCopy |
2127 | EnterWindow | LeaveWindow | UnmapWindow ); | |
771 | 2128 x_set_resize_hint (f); |
389 | 2129 |
2130 /* 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
|
2131 XStoreName (XDISPLAY FRAME_X_WINDOW (f), XSTRING (f->name)->data); |
708 | 2132 |
389 | 2133 /* Now override the defaults with all the rest of the specified |
2134 parms. */ | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2135 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean); |
771 | 2136 f->no_split = minibuffer_only || EQ (tem, Qt); |
389 | 2137 |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2138 /* 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
|
2139 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
|
2140 || 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
|
2141 { |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2142 x_text_icon (f, iconidentity); |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2143 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
|
2144 "BitmapIcon", 0, symbol); |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2145 } |
389 | 2146 |
2147 /* Tell the X server the previously set values of the | |
2148 background, border and mouse colors; also create the mouse cursor. */ | |
2149 BLOCK_INPUT; | |
771 | 2150 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
|
2151 XChangeBackground (FRAME_X_WINDOW (f), temp); |
389 | 2152 XFreePixmap (temp); |
2153 UNBLOCK_INPUT; | |
771 | 2154 x_set_border_pixel (f, f->display.x->border_pixel); |
2155 | |
2156 x_set_mouse_color (f, Qnil, Qnil); | |
389 | 2157 |
2158 /* Now override the defaults with all the rest of the specified parms. */ | |
2159 | |
771 | 2160 Fmodify_frame_parameters (frame, parms); |
389 | 2161 |
771 | 2162 /* 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
|
2163 { |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2164 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
|
2165 |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2166 if (EQ (visibility, Qunbound)) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2167 visibility = Qt; |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2168 |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2169 if (! EQ (visibility, Qicon) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2170 && ! NILP (visibility)) |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2171 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
|
2172 } |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2173 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2174 SET_FRAME_GARBAGED (f); |
771 | 2175 |
2176 return frame; | |
389 | 2177 #endif /* X10 */ |
2178 } | |
2179 | |
771 | 2180 DEFUN ("focus-frame", Ffocus_frame, Sfocus_frame, 1, 1, 0, |
2181 "Set the focus on FRAME.") | |
2182 (frame) | |
2183 Lisp_Object frame; | |
389 | 2184 { |
771 | 2185 CHECK_LIVE_FRAME (frame, 0); |
2186 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2187 if (FRAME_X_P (XFRAME (frame))) |
389 | 2188 { |
2189 BLOCK_INPUT; | |
771 | 2190 x_focus_on_frame (XFRAME (frame)); |
389 | 2191 UNBLOCK_INPUT; |
771 | 2192 return frame; |
389 | 2193 } |
2194 | |
2195 return Qnil; | |
2196 } | |
2197 | |
771 | 2198 DEFUN ("unfocus-frame", Funfocus_frame, Sunfocus_frame, 0, 0, 0, |
2199 "If a frame has been focused, release it.") | |
389 | 2200 () |
2201 { | |
771 | 2202 if (x_focus_frame) |
389 | 2203 { |
2204 BLOCK_INPUT; | |
771 | 2205 x_unfocus_frame (x_focus_frame); |
389 | 2206 UNBLOCK_INPUT; |
2207 } | |
2208 | |
2209 return Qnil; | |
2210 } | |
2211 | |
2212 #ifndef HAVE_X11 | |
2213 /* Computes an X-window size and position either from geometry GEO | |
2214 or with the mouse. | |
2215 | |
771 | 2216 F is a frame. It specifies an X window which is used to |
389 | 2217 determine which display to compute for. Its font, borders |
2218 and colors control how the rectangle will be displayed. | |
2219 | |
2220 X and Y are where to store the positions chosen. | |
2221 WIDTH and HEIGHT are where to store the sizes chosen. | |
2222 | |
2223 GEO is the geometry that may specify some of the info. | |
2224 STR is a prompt to display. | |
2225 HSCROLL and VSCROLL say whether we have horiz and vert scroll bars. */ | |
2226 | |
2227 int | |
771 | 2228 x_rubber_band (f, x, y, width, height, geo, str, hscroll, vscroll) |
2229 struct frame *f; | |
389 | 2230 int *x, *y, *width, *height; |
2231 char *geo; | |
2232 char *str; | |
2233 int hscroll, vscroll; | |
2234 { | |
2235 OpaqueFrame frame; | |
2236 Window tempwindow; | |
2237 WindowInfo wininfo; | |
2238 int border_color; | |
2239 int background_color; | |
2240 Lisp_Object tem; | |
2241 int mask; | |
2242 | |
2243 BLOCK_INPUT; | |
2244 | |
771 | 2245 background_color = f->display.x->background_pixel; |
2246 border_color = f->display.x->border_pixel; | |
2247 | |
2248 frame.bdrwidth = f->display.x->border_width; | |
389 | 2249 frame.border = XMakeTile (border_color); |
2250 frame.background = XMakeTile (background_color); | |
2251 tempwindow = XCreateTerm (str, "emacs", geo, default_window, &frame, 10, 5, | |
771 | 2252 (2 * f->display.x->internal_border_width |
389 | 2253 + (vscroll ? VSCROLL_WIDTH : 0)), |
771 | 2254 (2 * f->display.x->internal_border_width |
389 | 2255 + (hscroll ? HSCROLL_HEIGHT : 0)), |
771 | 2256 width, height, f->display.x->font, |
2257 FONT_WIDTH (f->display.x->font), | |
2258 FONT_HEIGHT (f->display.x->font)); | |
389 | 2259 XFreePixmap (frame.border); |
2260 XFreePixmap (frame.background); | |
2261 | |
2262 if (tempwindow != 0) | |
2263 { | |
2264 XQueryWindow (tempwindow, &wininfo); | |
2265 XDestroyWindow (tempwindow); | |
2266 *x = wininfo.x; | |
2267 *y = wininfo.y; | |
2268 } | |
2269 | |
2270 /* Coordinates we got are relative to the root window. | |
2271 Convert them to coordinates relative to desired parent window | |
2272 by scanning from there up to the root. */ | |
771 | 2273 tempwindow = f->display.x->parent_desc; |
389 | 2274 while (tempwindow != ROOT_WINDOW) |
2275 { | |
2276 int nchildren; | |
2277 Window *children; | |
2278 XQueryWindow (tempwindow, &wininfo); | |
2279 *x -= wininfo.x; | |
2280 *y -= wininfo.y; | |
2281 XQueryTree (tempwindow, &tempwindow, &nchildren, &children); | |
2282 free (children); | |
2283 } | |
2284 | |
2285 UNBLOCK_INPUT; | |
2286 return tempwindow != 0; | |
2287 } | |
2288 #endif /* not HAVE_X11 */ | |
2289 | |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2290 DEFUN ("x-color-defined-p", Fx_color_defined_p, Sx_color_defined_p, 1, 1, 0, |
389 | 2291 "Return t if the current X display supports the color named COLOR.") |
2292 (color) | |
2293 Lisp_Object color; | |
2294 { | |
2295 Color foo; | |
2296 | |
2297 CHECK_STRING (color, 0); | |
2298 | |
2299 if (defined_color (XSTRING (color)->data, &foo)) | |
2300 return Qt; | |
2301 else | |
2302 return Qnil; | |
2303 } | |
2304 | |
2277
773e47f29c5a
(Fx_display_color_p): Renamed from Fx_color_display_p.
Richard M. Stallman <rms@gnu.org>
parents:
2276
diff
changeset
|
2305 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
|
2306 "Return t if the X screen currently in use supports color.") |
389 | 2307 () |
2308 { | |
1528
924c8a609582
* xfns.c (x_decode_color, Fx_color_display_p): x_screen_planes is
Jim Blandy <jimb@redhat.com>
parents:
1438
diff
changeset
|
2309 if (x_screen_planes <= 2) |
389 | 2310 return Qnil; |
2311 | |
2312 switch (screen_visual->class) | |
2313 { | |
2314 case StaticColor: | |
2315 case PseudoColor: | |
2316 case TrueColor: | |
2317 case DirectColor: | |
2318 return Qt; | |
2319 | |
2320 default: | |
2321 return Qnil; | |
2322 } | |
2323 } | |
2324 | |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2325 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
|
2326 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2327 "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
|
2328 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2329 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2330 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2331 Display *dpy = x_current_display; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2332 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
|
2333 } |
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 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
|
2336 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
|
2337 "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
|
2338 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2339 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2340 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2341 Display *dpy = x_current_display; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2342 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
|
2343 } |
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 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
|
2346 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2347 "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
|
2348 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2349 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2350 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2351 Display *dpy = x_current_display; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2352 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
|
2353 } |
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 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
|
2356 0, 1, 0, |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2357 "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
|
2358 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2359 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2360 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2361 Display *dpy = x_current_display; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2362 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
|
2363 } |
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 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
|
2366 "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
|
2367 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2368 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2369 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2370 Display *dpy = x_current_display; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2371 char *vendor; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2372 vendor = ServerVendor (dpy); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2373 if (! vendor) vendor = ""; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2374 return build_string (vendor); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2375 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2376 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2377 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
|
2378 "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
|
2379 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
|
2380 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
|
2381 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
|
2382 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2383 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2384 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2385 Display *dpy = x_current_display; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2386 return Fcons (make_number (ProtocolVersion (dpy)), |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2387 Fcons (make_number (ProtocolRevision (dpy)), |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2388 Fcons (make_number (VendorRelease (dpy)), Qnil))); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2389 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2390 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2391 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
|
2392 "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
|
2393 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2394 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2395 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2396 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
|
2397 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2398 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2399 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
|
2400 "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
|
2401 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2402 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2403 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2404 return make_number (HeightMMOfScreen (x_screen)); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2405 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2406 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2407 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
|
2408 "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
|
2409 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2410 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2411 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2412 return make_number (WidthMMOfScreen (x_screen)); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2413 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2414 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2415 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
|
2416 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
|
2417 "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
|
2418 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
|
2419 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2420 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2421 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2422 switch (DoesBackingStore (x_screen)) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2423 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2424 case Always: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2425 return intern ("always"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2426 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2427 case WhenMapped: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2428 return intern ("when-mapped"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2429 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2430 case NotUseful: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2431 return intern ("not-useful"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2432 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2433 default: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2434 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
|
2435 } |
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 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2438 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
|
2439 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
|
2440 "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
|
2441 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
|
2442 `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
|
2443 (screen) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2444 Lisp_Object screen; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2445 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2446 switch (screen_visual->class) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2447 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2448 case StaticGray: return (intern ("static-gray")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2449 case GrayScale: return (intern ("gray-scale")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2450 case StaticColor: return (intern ("static-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2451 case PseudoColor: return (intern ("pseudo-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2452 case TrueColor: return (intern ("true-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2453 case DirectColor: return (intern ("direct-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2454 default: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2455 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
|
2456 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2457 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2458 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2459 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
|
2460 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
|
2461 "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
|
2462 (frame) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2463 Lisp_Object frame; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2464 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2465 if (DoesSaveUnders (x_screen) == True) |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2466 return Qt; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2467 else |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2468 return Qnil; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2469 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
2470 |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2471 x_pixel_width (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2472 register struct frame *f; |
389 | 2473 { |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2474 return PIXEL_WIDTH (f); |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2475 } |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2476 |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2477 x_pixel_height (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2478 register struct frame *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 return PIXEL_HEIGHT (f); |
389 | 2481 } |
2482 | |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2483 x_char_width (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2484 register struct frame *f; |
389 | 2485 { |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2486 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
|
2487 } |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2488 |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2489 x_char_height (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
2490 register struct frame *f; |
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 return FONT_HEIGHT (f->display.x->font); |
389 | 2493 } |
2494 | |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
2495 #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
|
2496 |
771 | 2497 /* Draw a rectangle on the frame with left top corner including |
389 | 2498 the character specified by LEFT_CHAR and TOP_CHAR. The rectangle is |
2499 CHARS by LINES wide and long and is the color of the cursor. */ | |
2500 | |
2501 void | |
771 | 2502 x_rectangle (f, gc, left_char, top_char, chars, lines) |
2503 register struct frame *f; | |
389 | 2504 GC gc; |
2505 register int top_char, left_char, chars, lines; | |
2506 { | |
2507 int width; | |
2508 int height; | |
771 | 2509 int left = (left_char * FONT_WIDTH (f->display.x->font) |
2510 + f->display.x->internal_border_width); | |
2511 int top = (top_char * FONT_HEIGHT (f->display.x->font) | |
2512 + f->display.x->internal_border_width); | |
389 | 2513 |
2514 if (chars < 0) | |
771 | 2515 width = FONT_WIDTH (f->display.x->font) / 2; |
389 | 2516 else |
771 | 2517 width = FONT_WIDTH (f->display.x->font) * chars; |
389 | 2518 if (lines < 0) |
771 | 2519 height = FONT_HEIGHT (f->display.x->font) / 2; |
389 | 2520 else |
771 | 2521 height = FONT_HEIGHT (f->display.x->font) * lines; |
2522 | |
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
|
2523 XDrawRectangle (x_current_display, FRAME_X_WINDOW (f), |
389 | 2524 gc, left, top, width, height); |
2525 } | |
2526 | |
2527 DEFUN ("x-draw-rectangle", Fx_draw_rectangle, Sx_draw_rectangle, 5, 5, 0, | |
771 | 2528 "Draw a rectangle on FRAME between coordinates specified by\n\ |
389 | 2529 numbers X0, Y0, X1, Y1 in the cursor pixel.") |
771 | 2530 (frame, X0, Y0, X1, Y1) |
2531 register Lisp_Object frame, X0, X1, Y0, Y1; | |
389 | 2532 { |
2533 register int x0, y0, x1, y1, top, left, n_chars, n_lines; | |
2534 | |
771 | 2535 CHECK_LIVE_FRAME (frame, 0); |
389 | 2536 CHECK_NUMBER (X0, 0); |
2537 CHECK_NUMBER (Y0, 1); | |
2538 CHECK_NUMBER (X1, 2); | |
2539 CHECK_NUMBER (Y1, 3); | |
2540 | |
2541 x0 = XINT (X0); | |
2542 x1 = XINT (X1); | |
2543 y0 = XINT (Y0); | |
2544 y1 = XINT (Y1); | |
2545 | |
2546 if (y1 > y0) | |
2547 { | |
2548 top = y0; | |
2549 n_lines = y1 - y0 + 1; | |
2550 } | |
2551 else | |
2552 { | |
2553 top = y1; | |
2554 n_lines = y0 - y1 + 1; | |
2555 } | |
2556 | |
2557 if (x1 > x0) | |
2558 { | |
2559 left = x0; | |
2560 n_chars = x1 - x0 + 1; | |
2561 } | |
2562 else | |
2563 { | |
2564 left = x1; | |
2565 n_chars = x0 - x1 + 1; | |
2566 } | |
2567 | |
2568 BLOCK_INPUT; | |
771 | 2569 x_rectangle (XFRAME (frame), XFRAME (frame)->display.x->cursor_gc, |
389 | 2570 left, top, n_chars, n_lines); |
2571 UNBLOCK_INPUT; | |
2572 | |
2573 return Qt; | |
2574 } | |
2575 | |
2576 DEFUN ("x-erase-rectangle", Fx_erase_rectangle, Sx_erase_rectangle, 5, 5, 0, | |
771 | 2577 "Draw a rectangle drawn on FRAME between coordinates\n\ |
389 | 2578 X0, Y0, X1, Y1 in the regular background-pixel.") |
771 | 2579 (frame, X0, Y0, X1, Y1) |
2580 register Lisp_Object frame, X0, Y0, X1, Y1; | |
389 | 2581 { |
2582 register int x0, y0, x1, y1, top, left, n_chars, n_lines; | |
2583 | |
771 | 2584 CHECK_FRAME (frame, 0); |
389 | 2585 CHECK_NUMBER (X0, 0); |
2586 CHECK_NUMBER (Y0, 1); | |
2587 CHECK_NUMBER (X1, 2); | |
2588 CHECK_NUMBER (Y1, 3); | |
2589 | |
2590 x0 = XINT (X0); | |
2591 x1 = XINT (X1); | |
2592 y0 = XINT (Y0); | |
2593 y1 = XINT (Y1); | |
2594 | |
2595 if (y1 > y0) | |
2596 { | |
2597 top = y0; | |
2598 n_lines = y1 - y0 + 1; | |
2599 } | |
2600 else | |
2601 { | |
2602 top = y1; | |
2603 n_lines = y0 - y1 + 1; | |
2604 } | |
2605 | |
2606 if (x1 > x0) | |
2607 { | |
2608 left = x0; | |
2609 n_chars = x1 - x0 + 1; | |
2610 } | |
2611 else | |
2612 { | |
2613 left = x1; | |
2614 n_chars = x0 - x1 + 1; | |
2615 } | |
2616 | |
2617 BLOCK_INPUT; | |
771 | 2618 x_rectangle (XFRAME (frame), XFRAME (frame)->display.x->reverse_gc, |
389 | 2619 left, top, n_chars, n_lines); |
2620 UNBLOCK_INPUT; | |
2621 | |
2622 return Qt; | |
2623 } | |
2624 | |
2625 /* Draw lines around the text region beginning at the character position | |
2626 TOP_X, TOP_Y and ending at BOTTOM_X and BOTTOM_Y. GC specifies the | |
2627 pixel and line characteristics. */ | |
2628 | |
771 | 2629 #define line_len(line) (FRAME_CURRENT_GLYPHS (f)->used[(line)]) |
389 | 2630 |
2631 static void | |
771 | 2632 outline_region (f, gc, top_x, top_y, bottom_x, bottom_y) |
2633 register struct frame *f; | |
389 | 2634 GC gc; |
2635 int top_x, top_y, bottom_x, bottom_y; | |
2636 { | |
771 | 2637 register int ibw = f->display.x->internal_border_width; |
2638 register int font_w = FONT_WIDTH (f->display.x->font); | |
2639 register int font_h = FONT_HEIGHT (f->display.x->font); | |
389 | 2640 int y = top_y; |
2641 int x = line_len (y); | |
2642 XPoint *pixel_points = (XPoint *) | |
2643 alloca (((bottom_y - top_y + 2) * 4) * sizeof (XPoint)); | |
2644 register XPoint *this_point = pixel_points; | |
2645 | |
2646 /* Do the horizontal top line/lines */ | |
2647 if (top_x == 0) | |
2648 { | |
2649 this_point->x = ibw; | |
2650 this_point->y = ibw + (font_h * top_y); | |
2651 this_point++; | |
2652 if (x == 0) | |
2653 this_point->x = ibw + (font_w / 2); /* Half-size for newline chars. */ | |
2654 else | |
2655 this_point->x = ibw + (font_w * x); | |
2656 this_point->y = (this_point - 1)->y; | |
2657 } | |
2658 else | |
2659 { | |
2660 this_point->x = ibw; | |
2661 this_point->y = ibw + (font_h * (top_y + 1)); | |
2662 this_point++; | |
2663 this_point->x = ibw + (font_w * top_x); | |
2664 this_point->y = (this_point - 1)->y; | |
2665 this_point++; | |
2666 this_point->x = (this_point - 1)->x; | |
2667 this_point->y = ibw + (font_h * top_y); | |
2668 this_point++; | |
2669 this_point->x = ibw + (font_w * x); | |
2670 this_point->y = (this_point - 1)->y; | |
2671 } | |
2672 | |
2673 /* Now do the right side. */ | |
2674 while (y < bottom_y) | |
2675 { /* Right vertical edge */ | |
2676 this_point++; | |
2677 this_point->x = (this_point - 1)->x; | |
2678 this_point->y = ibw + (font_h * (y + 1)); | |
2679 this_point++; | |
2680 | |
2681 y++; /* Horizontal connection to next line */ | |
2682 x = line_len (y); | |
2683 if (x == 0) | |
2684 this_point->x = ibw + (font_w / 2); | |
2685 else | |
2686 this_point->x = ibw + (font_w * x); | |
2687 | |
2688 this_point->y = (this_point - 1)->y; | |
2689 } | |
2690 | |
2691 /* Now do the bottom and connect to the top left point. */ | |
2692 this_point->x = ibw + (font_w * (bottom_x + 1)); | |
2693 | |
2694 this_point++; | |
2695 this_point->x = (this_point - 1)->x; | |
2696 this_point->y = ibw + (font_h * (bottom_y + 1)); | |
2697 this_point++; | |
2698 this_point->x = ibw; | |
2699 this_point->y = (this_point - 1)->y; | |
2700 this_point++; | |
2701 this_point->x = pixel_points->x; | |
2702 this_point->y = pixel_points->y; | |
2703 | |
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
|
2704 XDrawLines (x_current_display, FRAME_X_WINDOW (f), |
389 | 2705 gc, pixel_points, |
2706 (this_point - pixel_points + 1), CoordModeOrigin); | |
2707 } | |
2708 | |
2709 DEFUN ("x-contour-region", Fx_contour_region, Sx_contour_region, 1, 1, 0, | |
2710 "Highlight the region between point and the character under the mouse\n\ | |
771 | 2711 selected frame.") |
389 | 2712 (event) |
2713 register Lisp_Object event; | |
2714 { | |
2715 register int x0, y0, x1, y1; | |
771 | 2716 register struct frame *f = selected_frame; |
389 | 2717 register int p1, p2; |
2718 | |
2719 CHECK_CONS (event, 0); | |
2720 | |
2721 BLOCK_INPUT; | |
2722 x0 = XINT (Fcar (Fcar (event))); | |
2723 y0 = XINT (Fcar (Fcdr (Fcar (event)))); | |
2724 | |
2725 /* If the mouse is past the end of the line, don't that area. */ | |
2726 /* ReWrite this... */ | |
2727 | |
771 | 2728 x1 = f->cursor_x; |
2729 y1 = f->cursor_y; | |
389 | 2730 |
2731 if (y1 > y0) /* point below mouse */ | |
771 | 2732 outline_region (f, f->display.x->cursor_gc, |
389 | 2733 x0, y0, x1, y1); |
2734 else if (y1 < y0) /* point above mouse */ | |
771 | 2735 outline_region (f, f->display.x->cursor_gc, |
389 | 2736 x1, y1, x0, y0); |
2737 else /* same line: draw horizontal rectangle */ | |
2738 { | |
2739 if (x1 > x0) | |
771 | 2740 x_rectangle (f, f->display.x->cursor_gc, |
389 | 2741 x0, y0, (x1 - x0 + 1), 1); |
2742 else if (x1 < x0) | |
771 | 2743 x_rectangle (f, f->display.x->cursor_gc, |
389 | 2744 x1, y1, (x0 - x1 + 1), 1); |
2745 } | |
2746 | |
2747 XFlush (x_current_display); | |
2748 UNBLOCK_INPUT; | |
2749 | |
2750 return Qnil; | |
2751 } | |
2752 | |
2753 DEFUN ("x-uncontour-region", Fx_uncontour_region, Sx_uncontour_region, 1, 1, 0, | |
2754 "Erase any highlighting of the region between point and the character\n\ | |
771 | 2755 at X, Y on the selected frame.") |
389 | 2756 (event) |
2757 register Lisp_Object event; | |
2758 { | |
2759 register int x0, y0, x1, y1; | |
771 | 2760 register struct frame *f = selected_frame; |
389 | 2761 |
2762 BLOCK_INPUT; | |
2763 x0 = XINT (Fcar (Fcar (event))); | |
2764 y0 = XINT (Fcar (Fcdr (Fcar (event)))); | |
771 | 2765 x1 = f->cursor_x; |
2766 y1 = f->cursor_y; | |
389 | 2767 |
2768 if (y1 > y0) /* point below mouse */ | |
771 | 2769 outline_region (f, f->display.x->reverse_gc, |
389 | 2770 x0, y0, x1, y1); |
2771 else if (y1 < y0) /* point above mouse */ | |
771 | 2772 outline_region (f, f->display.x->reverse_gc, |
389 | 2773 x1, y1, x0, y0); |
2774 else /* same line: draw horizontal rectangle */ | |
2775 { | |
2776 if (x1 > x0) | |
771 | 2777 x_rectangle (f, f->display.x->reverse_gc, |
389 | 2778 x0, y0, (x1 - x0 + 1), 1); |
2779 else if (x1 < x0) | |
771 | 2780 x_rectangle (f, f->display.x->reverse_gc, |
389 | 2781 x1, y1, (x0 - x1 + 1), 1); |
2782 } | |
2783 UNBLOCK_INPUT; | |
2784 | |
2785 return Qnil; | |
2786 } | |
2787 | |
2788 #if 0 | |
2789 int contour_begin_x, contour_begin_y; | |
2790 int contour_end_x, contour_end_y; | |
2791 int contour_npoints; | |
2792 | |
2793 /* Clip the top part of the contour lines down (and including) line Y_POS. | |
2794 If X_POS is in the middle (rather than at the end) of the line, drop | |
2795 down a line at that character. */ | |
2796 | |
2797 static void | |
2798 clip_contour_top (y_pos, x_pos) | |
2799 { | |
2800 register XPoint *begin = contour_lines[y_pos].top_left; | |
2801 register XPoint *end; | |
2802 register int npoints; | |
771 | 2803 register struct display_line *line = selected_frame->phys_lines[y_pos + 1]; |
389 | 2804 |
2805 if (x_pos >= line->len - 1) /* Draw one, straight horizontal line. */ | |
2806 { | |
2807 end = contour_lines[y_pos].top_right; | |
2808 npoints = (end - begin + 1); | |
2809 XDrawLines (x_current_display, contour_window, | |
2810 contour_erase_gc, begin_erase, npoints, CoordModeOrigin); | |
2811 | |
2812 bcopy (end, begin + 1, contour_last_point - end + 1); | |
2813 contour_last_point -= (npoints - 2); | |
2814 XDrawLines (x_current_display, contour_window, | |
2815 contour_erase_gc, begin, 2, CoordModeOrigin); | |
2816 XFlush (x_current_display); | |
2817 | |
2818 /* Now, update contour_lines structure. */ | |
2819 } | |
2820 /* ______. */ | |
2821 else /* |________*/ | |
2822 { | |
2823 register XPoint *p = begin + 1; | |
2824 end = contour_lines[y_pos].bottom_right; | |
2825 npoints = (end - begin + 1); | |
2826 XDrawLines (x_current_display, contour_window, | |
2827 contour_erase_gc, begin_erase, npoints, CoordModeOrigin); | |
2828 | |
2829 p->y = begin->y; | |
2830 p->x = ibw + (font_w * (x_pos + 1)); | |
2831 p++; | |
2832 p->y = begin->y + font_h; | |
2833 p->x = (p - 1)->x; | |
2834 bcopy (end, begin + 3, contour_last_point - end + 1); | |
2835 contour_last_point -= (npoints - 5); | |
2836 XDrawLines (x_current_display, contour_window, | |
2837 contour_erase_gc, begin, 4, CoordModeOrigin); | |
2838 XFlush (x_current_display); | |
2839 | |
2840 /* Now, update contour_lines structure. */ | |
2841 } | |
2842 } | |
2843 | |
2844 /* Erase the top horzontal lines of the contour, and then extend | |
2845 the contour upwards. */ | |
2846 | |
2847 static void | |
2848 extend_contour_top (line) | |
2849 { | |
2850 } | |
2851 | |
2852 static void | |
2853 clip_contour_bottom (x_pos, y_pos) | |
2854 int x_pos, y_pos; | |
2855 { | |
2856 } | |
2857 | |
2858 static void | |
2859 extend_contour_bottom (x_pos, y_pos) | |
2860 { | |
2861 } | |
2862 | |
2863 DEFUN ("x-select-region", Fx_select_region, Sx_select_region, 1, 1, "e", | |
2864 "") | |
2865 (event) | |
2866 Lisp_Object event; | |
2867 { | |
771 | 2868 register struct frame *f = selected_frame; |
2869 register int point_x = f->cursor_x; | |
2870 register int point_y = f->cursor_y; | |
389 | 2871 register int mouse_below_point; |
2872 register Lisp_Object obj; | |
2873 register int x_contour_x, x_contour_y; | |
2874 | |
2875 x_contour_x = x_mouse_x; | |
2876 x_contour_y = x_mouse_y; | |
2877 if (x_contour_y > point_y || (x_contour_y == point_y | |
2878 && x_contour_x > point_x)) | |
2879 { | |
2880 mouse_below_point = 1; | |
771 | 2881 outline_region (f, f->display.x->cursor_gc, point_x, point_y, |
389 | 2882 x_contour_x, x_contour_y); |
2883 } | |
2884 else | |
2885 { | |
2886 mouse_below_point = 0; | |
771 | 2887 outline_region (f, f->display.x->cursor_gc, x_contour_x, x_contour_y, |
389 | 2888 point_x, point_y); |
2889 } | |
2890 | |
2891 while (1) | |
2892 { | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
2893 obj = read_char (-1, 0, 0, Qnil, 0); |
389 | 2894 if (XTYPE (obj) != Lisp_Cons) |
2895 break; | |
2896 | |
2897 if (mouse_below_point) | |
2898 { | |
2899 if (x_mouse_y <= point_y) /* Flipped. */ | |
2900 { | |
2901 mouse_below_point = 0; | |
2902 | |
771 | 2903 outline_region (f, f->display.x->reverse_gc, point_x, point_y, |
389 | 2904 x_contour_x, x_contour_y); |
771 | 2905 outline_region (f, f->display.x->cursor_gc, x_mouse_x, x_mouse_y, |
389 | 2906 point_x, point_y); |
2907 } | |
2908 else if (x_mouse_y < x_contour_y) /* Bottom clipped. */ | |
2909 { | |
2910 clip_contour_bottom (x_mouse_y); | |
2911 } | |
2912 else if (x_mouse_y > x_contour_y) /* Bottom extended. */ | |
2913 { | |
2914 extend_bottom_contour (x_mouse_y); | |
2915 } | |
2916 | |
2917 x_contour_x = x_mouse_x; | |
2918 x_contour_y = x_mouse_y; | |
2919 } | |
2920 else /* mouse above or same line as point */ | |
2921 { | |
2922 if (x_mouse_y >= point_y) /* Flipped. */ | |
2923 { | |
2924 mouse_below_point = 1; | |
2925 | |
771 | 2926 outline_region (f, f->display.x->reverse_gc, |
389 | 2927 x_contour_x, x_contour_y, point_x, point_y); |
771 | 2928 outline_region (f, f->display.x->cursor_gc, point_x, point_y, |
389 | 2929 x_mouse_x, x_mouse_y); |
2930 } | |
2931 else if (x_mouse_y > x_contour_y) /* Top clipped. */ | |
2932 { | |
2933 clip_contour_top (x_mouse_y); | |
2934 } | |
2935 else if (x_mouse_y < x_contour_y) /* Top extended. */ | |
2936 { | |
2937 extend_contour_top (x_mouse_y); | |
2938 } | |
2939 } | |
2940 } | |
2941 | |
1601
a371ec79bc31
* xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents:
1528
diff
changeset
|
2942 unread_command_event = obj; |
389 | 2943 if (mouse_below_point) |
2944 { | |
2945 contour_begin_x = point_x; | |
2946 contour_begin_y = point_y; | |
2947 contour_end_x = x_contour_x; | |
2948 contour_end_y = x_contour_y; | |
2949 } | |
2950 else | |
2951 { | |
2952 contour_begin_x = x_contour_x; | |
2953 contour_begin_y = x_contour_y; | |
2954 contour_end_x = point_x; | |
2955 contour_end_y = point_y; | |
2956 } | |
2957 } | |
2958 #endif | |
2959 | |
2960 DEFUN ("x-horizontal-line", Fx_horizontal_line, Sx_horizontal_line, 1, 1, "e", | |
2961 "") | |
2962 (event) | |
2963 Lisp_Object event; | |
2964 { | |
2965 register Lisp_Object obj; | |
771 | 2966 struct frame *f = selected_frame; |
389 | 2967 register struct window *w = XWINDOW (selected_window); |
771 | 2968 register GC line_gc = f->display.x->cursor_gc; |
2969 register GC erase_gc = f->display.x->reverse_gc; | |
389 | 2970 #if 0 |
2971 char dash_list[] = {6, 4, 6, 4}; | |
2972 int dashes = 4; | |
2973 XGCValues gc_values; | |
2974 #endif | |
2975 register int previous_y; | |
771 | 2976 register int line = (x_mouse_y + 1) * FONT_HEIGHT (f->display.x->font) |
2977 + f->display.x->internal_border_width; | |
2978 register int left = f->display.x->internal_border_width | |
389 | 2979 + (w->left |
771 | 2980 * FONT_WIDTH (f->display.x->font)); |
389 | 2981 register int right = left + (w->width |
771 | 2982 * FONT_WIDTH (f->display.x->font)) |
2983 - f->display.x->internal_border_width; | |
389 | 2984 |
2985 #if 0 | |
2986 BLOCK_INPUT; | |
771 | 2987 gc_values.foreground = f->display.x->cursor_pixel; |
2988 gc_values.background = f->display.x->background_pixel; | |
389 | 2989 gc_values.line_width = 1; |
2990 gc_values.line_style = LineOnOffDash; | |
2991 gc_values.cap_style = CapRound; | |
2992 gc_values.join_style = JoinRound; | |
2993 | |
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
|
2994 line_gc = XCreateGC (x_current_display, FRAME_X_WINDOW (f), |
389 | 2995 GCLineStyle | GCJoinStyle | GCCapStyle |
2996 | GCLineWidth | GCForeground | GCBackground, | |
2997 &gc_values); | |
2998 XSetDashes (x_current_display, line_gc, 0, dash_list, dashes); | |
771 | 2999 gc_values.foreground = f->display.x->background_pixel; |
3000 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
|
3001 erase_gc = XCreateGC (x_current_display, FRAME_X_WINDOW (f), |
389 | 3002 GCLineStyle | GCJoinStyle | GCCapStyle |
3003 | GCLineWidth | GCForeground | GCBackground, | |
3004 &gc_values); | |
3005 XSetDashes (x_current_display, erase_gc, 0, dash_list, dashes); | |
3006 #endif | |
3007 | |
3008 while (1) | |
3009 { | |
3010 BLOCK_INPUT; | |
3011 if (x_mouse_y >= XINT (w->top) | |
3012 && x_mouse_y < XINT (w->top) + XINT (w->height) - 1) | |
3013 { | |
3014 previous_y = x_mouse_y; | |
771 | 3015 line = (x_mouse_y + 1) * FONT_HEIGHT (f->display.x->font) |
3016 + 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
|
3017 XDrawLine (x_current_display, FRAME_X_WINDOW (f), |
389 | 3018 line_gc, left, line, right, line); |
3019 } | |
3020 XFlushQueue (); | |
3021 UNBLOCK_INPUT; | |
3022 | |
3023 do | |
3024 { | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
3025 obj = read_char (-1, 0, 0, Qnil, 0); |
389 | 3026 if ((XTYPE (obj) != Lisp_Cons) |
3027 || (! 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
|
3028 Qvertical_scroll_bar)) |
389 | 3029 || x_mouse_grabbed) |
3030 { | |
3031 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
|
3032 XDrawLine (x_current_display, FRAME_X_WINDOW (f), |
389 | 3033 erase_gc, left, line, right, line); |
3034 UNBLOCK_INPUT; | |
1601
a371ec79bc31
* xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents:
1528
diff
changeset
|
3035 unread_command_event = obj; |
389 | 3036 #if 0 |
3037 XFreeGC (x_current_display, line_gc); | |
3038 XFreeGC (x_current_display, erase_gc); | |
3039 #endif | |
3040 return Qnil; | |
3041 } | |
3042 } | |
3043 while (x_mouse_y == previous_y); | |
3044 | |
3045 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
|
3046 XDrawLine (x_current_display, FRAME_X_WINDOW (f), |
389 | 3047 erase_gc, left, line, right, line); |
3048 UNBLOCK_INPUT; | |
3049 } | |
3050 } | |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
3051 #endif |
389 | 3052 |
3053 /* Offset in buffer of character under the pointer, or 0. */ | |
3054 int mouse_buffer_offset; | |
3055 | |
3056 #if 0 | |
3057 /* These keep track of the rectangle following the pointer. */ | |
3058 int mouse_track_top, mouse_track_left, mouse_track_width; | |
3059 | |
3060 DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 0, 0, 0, | |
3061 "Track the pointer.") | |
3062 () | |
3063 { | |
3064 static Cursor current_pointer_shape; | |
771 | 3065 FRAME_PTR f = x_mouse_frame; |
389 | 3066 |
3067 BLOCK_INPUT; | |
771 | 3068 if (EQ (Vmouse_frame_part, Qtext_part) |
3069 && (current_pointer_shape != f->display.x->nontext_cursor)) | |
389 | 3070 { |
3071 unsigned char c; | |
3072 struct buffer *buf; | |
3073 | |
771 | 3074 current_pointer_shape = f->display.x->nontext_cursor; |
389 | 3075 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
|
3076 FRAME_X_WINDOW (f), |
389 | 3077 current_pointer_shape); |
3078 | |
3079 buf = XBUFFER (XWINDOW (Vmouse_window)->buffer); | |
3080 c = *(BUF_CHAR_ADDRESS (buf, mouse_buffer_offset)); | |
3081 } | |
771 | 3082 else if (EQ (Vmouse_frame_part, Qmodeline_part) |
3083 && (current_pointer_shape != f->display.x->modeline_cursor)) | |
389 | 3084 { |
771 | 3085 current_pointer_shape = f->display.x->modeline_cursor; |
389 | 3086 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
|
3087 FRAME_X_WINDOW (f), |
389 | 3088 current_pointer_shape); |
3089 } | |
3090 | |
3091 XFlushQueue (); | |
3092 UNBLOCK_INPUT; | |
3093 } | |
3094 #endif | |
3095 | |
3096 #if 0 | |
3097 DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 1, 1, "e", | |
3098 "Draw rectangle around character under mouse pointer, if there is one.") | |
3099 (event) | |
3100 Lisp_Object event; | |
3101 { | |
3102 struct window *w = XWINDOW (Vmouse_window); | |
771 | 3103 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
389 | 3104 struct buffer *b = XBUFFER (w->buffer); |
3105 Lisp_Object obj; | |
3106 | |
3107 if (! EQ (Vmouse_window, selected_window)) | |
3108 return Qnil; | |
3109 | |
3110 if (EQ (event, Qnil)) | |
3111 { | |
3112 int x, y; | |
3113 | |
771 | 3114 x_read_mouse_position (selected_frame, &x, &y); |
389 | 3115 } |
3116 | |
3117 BLOCK_INPUT; | |
3118 mouse_track_width = 0; | |
3119 mouse_track_left = mouse_track_top = -1; | |
3120 | |
3121 do | |
3122 { | |
3123 if ((x_mouse_x != mouse_track_left | |
3124 && (x_mouse_x < mouse_track_left | |
3125 || x_mouse_x > (mouse_track_left + mouse_track_width))) | |
3126 || x_mouse_y != mouse_track_top) | |
3127 { | |
3128 int hp = 0; /* Horizontal position */ | |
771 | 3129 int len = FRAME_CURRENT_GLYPHS (f)->used[x_mouse_y]; |
3130 int p = FRAME_CURRENT_GLYPHS (f)->bufp[x_mouse_y]; | |
389 | 3131 int tab_width = XINT (b->tab_width); |
485 | 3132 int ctl_arrow_p = !NILP (b->ctl_arrow); |
389 | 3133 unsigned char c; |
3134 int mode_line_vpos = XFASTINT (w->height) + XFASTINT (w->top) - 1; | |
3135 int in_mode_line = 0; | |
3136 | |
771 | 3137 if (! FRAME_CURRENT_GLYPHS (f)->enable[x_mouse_y]) |
389 | 3138 break; |
3139 | |
3140 /* Erase previous rectangle. */ | |
3141 if (mouse_track_width) | |
3142 { | |
771 | 3143 x_rectangle (f, f->display.x->reverse_gc, |
389 | 3144 mouse_track_left, mouse_track_top, |
3145 mouse_track_width, 1); | |
3146 | |
771 | 3147 if ((mouse_track_left == f->phys_cursor_x |
3148 || mouse_track_left == f->phys_cursor_x - 1) | |
3149 && mouse_track_top == f->phys_cursor_y) | |
389 | 3150 { |
771 | 3151 x_display_cursor (f, 1); |
389 | 3152 } |
3153 } | |
3154 | |
3155 mouse_track_left = x_mouse_x; | |
3156 mouse_track_top = x_mouse_y; | |
3157 mouse_track_width = 0; | |
3158 | |
3159 if (mouse_track_left > len) /* Past the end of line. */ | |
3160 goto draw_or_not; | |
3161 | |
3162 if (mouse_track_top == mode_line_vpos) | |
3163 { | |
3164 in_mode_line = 1; | |
3165 goto draw_or_not; | |
3166 } | |
3167 | |
3168 if (tab_width <= 0 || tab_width > 20) tab_width = 8; | |
3169 do | |
3170 { | |
3171 c = FETCH_CHAR (p); | |
771 | 3172 if (len == f->width && hp == len - 1 && c != '\n') |
389 | 3173 goto draw_or_not; |
3174 | |
3175 switch (c) | |
3176 { | |
3177 case '\t': | |
3178 mouse_track_width = tab_width - (hp % tab_width); | |
3179 p++; | |
3180 hp += mouse_track_width; | |
3181 if (hp > x_mouse_x) | |
3182 { | |
3183 mouse_track_left = hp - mouse_track_width; | |
3184 goto draw_or_not; | |
3185 } | |
3186 continue; | |
3187 | |
3188 case '\n': | |
3189 mouse_track_width = -1; | |
3190 goto draw_or_not; | |
3191 | |
3192 default: | |
3193 if (ctl_arrow_p && (c < 040 || c == 0177)) | |
3194 { | |
3195 if (p > ZV) | |
3196 goto draw_or_not; | |
3197 | |
3198 mouse_track_width = 2; | |
3199 p++; | |
3200 hp +=2; | |
3201 if (hp > x_mouse_x) | |
3202 { | |
3203 mouse_track_left = hp - mouse_track_width; | |
3204 goto draw_or_not; | |
3205 } | |
3206 } | |
3207 else | |
3208 { | |
3209 mouse_track_width = 1; | |
3210 p++; | |
3211 hp++; | |
3212 } | |
3213 continue; | |
3214 } | |
3215 } | |
3216 while (hp <= x_mouse_x); | |
3217 | |
3218 draw_or_not: | |
3219 if (mouse_track_width) /* Over text; use text pointer shape. */ | |
3220 { | |
3221 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
|
3222 FRAME_X_WINDOW (f), |
771 | 3223 f->display.x->text_cursor); |
3224 x_rectangle (f, f->display.x->cursor_gc, | |
389 | 3225 mouse_track_left, mouse_track_top, |
3226 mouse_track_width, 1); | |
3227 } | |
3228 else if (in_mode_line) | |
3229 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
|
3230 FRAME_X_WINDOW (f), |
771 | 3231 f->display.x->modeline_cursor); |
389 | 3232 else |
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->nontext_cursor); |
389 | 3236 } |
3237 | |
3238 XFlush (x_current_display); | |
3239 UNBLOCK_INPUT; | |
3240 | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
3241 obj = read_char (-1, 0, 0, Qnil, 0); |
389 | 3242 BLOCK_INPUT; |
3243 } | |
3244 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
|
3245 && EQ (Fcar (Fcdr (Fcdr (obj))), Qnil) /* Not scroll bar */ |
389 | 3246 && EQ (Vmouse_depressed, Qnil) /* Only motion events */ |
3247 && EQ (Vmouse_window, selected_window) /* In this window */ | |
771 | 3248 && x_mouse_frame); |
389 | 3249 |
1601
a371ec79bc31
* xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents:
1528
diff
changeset
|
3250 unread_command_event = obj; |
389 | 3251 |
3252 if (mouse_track_width) | |
3253 { | |
771 | 3254 x_rectangle (f, f->display.x->reverse_gc, |
389 | 3255 mouse_track_left, mouse_track_top, |
3256 mouse_track_width, 1); | |
3257 mouse_track_width = 0; | |
771 | 3258 if ((mouse_track_left == f->phys_cursor_x |
3259 || mouse_track_left - 1 == f->phys_cursor_x) | |
3260 && mouse_track_top == f->phys_cursor_y) | |
389 | 3261 { |
771 | 3262 x_display_cursor (f, 1); |
389 | 3263 } |
3264 } | |
3265 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
|
3266 FRAME_X_WINDOW (f), |
771 | 3267 f->display.x->nontext_cursor); |
389 | 3268 XFlush (x_current_display); |
3269 UNBLOCK_INPUT; | |
3270 | |
3271 return Qnil; | |
3272 } | |
3273 #endif | |
3274 | |
3275 #if 0 | |
3276 #include "glyphs.h" | |
3277 | |
3278 /* Draw a pixmap specified by IMAGE_DATA of dimensions WIDTH and HEIGHT | |
771 | 3279 on the frame F at position X, Y. */ |
3280 | |
3281 x_draw_pixmap (f, x, y, image_data, width, height) | |
3282 struct frame *f; | |
389 | 3283 int x, y, width, height; |
3284 char *image_data; | |
3285 { | |
3286 Pixmap image; | |
3287 | |
3288 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
|
3289 FRAME_X_WINDOW (f), image_data, |
389 | 3290 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
|
3291 XCopyPlane (x_current_display, image, FRAME_X_WINDOW (f), |
771 | 3292 f->display.x->normal_gc, 0, 0, width, height, x, y); |
389 | 3293 } |
3294 #endif | |
3295 | |
3296 #if 0 | |
3297 | |
3298 #ifdef HAVE_X11 | |
3299 #define XMouseEvent XEvent | |
3300 #define WhichMouseButton xbutton.button | |
3301 #define MouseWindow xbutton.window | |
3302 #define MouseX xbutton.x | |
3303 #define MouseY xbutton.y | |
3304 #define MouseTime xbutton.time | |
3305 #define ButtonReleased ButtonRelease | |
3306 #define ButtonPressed ButtonPress | |
3307 #else | |
3308 #define XMouseEvent XButtonEvent | |
3309 #define WhichMouseButton detail | |
3310 #define MouseWindow window | |
3311 #define MouseX x | |
3312 #define MouseY y | |
3313 #define MouseTime time | |
3314 #endif /* X11 */ | |
3315 | |
3316 DEFUN ("x-mouse-events", Fx_mouse_events, Sx_mouse_events, 0, 0, 0, | |
3317 "Return number of pending mouse events from X window system.") | |
3318 () | |
3319 { | |
3320 return make_number (queue_event_count (&x_mouse_queue)); | |
3321 } | |
3322 | |
3323 /* Encode the mouse button events in the form expected by the | |
3324 mouse code in Lisp. For X11, this means moving the masks around. */ | |
3325 | |
3326 static int | |
3327 encode_mouse_button (mouse_event) | |
3328 XMouseEvent mouse_event; | |
3329 { | |
3330 register int event_code; | |
3331 register char key_mask; | |
3332 | |
3333 event_code = mouse_event.detail & 3; | |
3334 key_mask = (mouse_event.detail >> 8) & 0xf0; | |
3335 event_code |= key_mask >> 1; | |
3336 if (mouse_event.type == ButtonReleased) event_code |= 0x04; | |
3337 return event_code; | |
3338 } | |
3339 | |
3340 DEFUN ("x-get-mouse-event", Fx_get_mouse_event, Sx_get_mouse_event, | |
3341 0, 1, 0, | |
3342 "Get next mouse event out of mouse event buffer.\n\ | |
3343 Optional ARG non-nil means return nil immediately if no pending event;\n\ | |
3344 otherwise, wait for an event. Returns a four-part list:\n\ | |
771 | 3345 ((X-POS Y-POS) WINDOW FRAME-PART KEYSEQ TIMESTAMP).\n\ |
3346 Normally X-POS and Y-POS are the position of the click on the frame\n\ | |
389 | 3347 (measured in characters and lines), and WINDOW is the window clicked in.\n\ |
3348 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
|
3349 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
|
3350 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
|
3351 the relative position of the scroll bar's value within that total length,\n\ |
389 | 3352 and a third element OFFSET appears in that list: the height of the thumb-up\n\ |
3353 area at the top of the scroll bar.\n\ | |
771 | 3354 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
|
3355 `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
|
3356 `horizontal-scroll-bar', `horizontal-thumbleft', `horizontal-thumbright'.\n\ |
389 | 3357 TIMESTAMP is the lower 23 bits of the X-server's timestamp for\n\ |
3358 the mouse event.") | |
3359 (arg) | |
3360 Lisp_Object arg; | |
3361 { | |
3362 XMouseEvent xrep; | |
3363 register int com_letter; | |
3364 register Lisp_Object tempx; | |
3365 register Lisp_Object tempy; | |
3366 Lisp_Object part, pos, timestamp; | |
3367 int prefix; | |
771 | 3368 struct frame *f; |
389 | 3369 |
3370 int tem; | |
3371 | |
3372 while (1) | |
3373 { | |
3374 BLOCK_INPUT; | |
3375 tem = dequeue_event (&xrep, &x_mouse_queue); | |
3376 UNBLOCK_INPUT; | |
3377 | |
3378 if (tem) | |
3379 { | |
3380 switch (xrep.type) | |
3381 { | |
3382 case ButtonPressed: | |
3383 case ButtonReleased: | |
3384 | |
3385 com_letter = encode_mouse_button (xrep); | |
3386 mouse_timestamp = xrep.MouseTime; | |
3387 | |
771 | 3388 if ((f = x_window_to_frame (xrep.MouseWindow)) != 0) |
389 | 3389 { |
771 | 3390 Lisp_Object frame; |
389 | 3391 |
771 | 3392 if (f->display.x->icon_desc == xrep.MouseWindow) |
389 | 3393 { |
771 | 3394 x_make_frame_visible (f); |
389 | 3395 continue; |
3396 } | |
3397 | |
3398 XSET (tempx, Lisp_Int, | |
771 | 3399 min (f->width-1, max (0, (xrep.MouseX - f->display.x->internal_border_width)/FONT_WIDTH (f->display.x->font)))); |
389 | 3400 XSET (tempy, Lisp_Int, |
771 | 3401 min (f->height-1, max (0, (xrep.MouseY - f->display.x->internal_border_width)/FONT_HEIGHT (f->display.x->font)))); |
389 | 3402 XSET (timestamp, Lisp_Int, (xrep.MouseTime & 0x7fffff)); |
771 | 3403 XSET (frame, Lisp_Frame, f); |
389 | 3404 |
3405 pos = Fcons (tempx, Fcons (tempy, Qnil)); | |
3406 Vmouse_window | |
771 | 3407 = Flocate_window_from_coordinates (frame, pos); |
389 | 3408 |
3409 Vmouse_event | |
3410 = Fcons (pos, | |
3411 Fcons (Vmouse_window, | |
3412 Fcons (Qnil, | |
3413 Fcons (Fchar_to_string (make_number (com_letter)), | |
3414 Fcons (timestamp, Qnil))))); | |
3415 return Vmouse_event; | |
3416 } | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3417 else if ((f = x_window_to_scroll_bar (xrep.MouseWindow, &part, &prefix)) != 0) |
389 | 3418 { |
3419 int pos, len; | |
3420 Lisp_Object keyseq; | |
3421 char *partname; | |
3422 | |
3423 keyseq = concat2 (Fchar_to_string (make_number (prefix)), | |
3424 Fchar_to_string (make_number (com_letter))); | |
3425 | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3426 pos = xrep.MouseY - (f->display.x->v_scroll_bar_width - 2); |
389 | 3427 XSET (tempx, Lisp_Int, pos); |
771 | 3428 len = ((FONT_HEIGHT (f->display.x->font) * f->height) |
3429 + 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
|
3430 - (2 * (f->display.x->v_scroll_bar_width - 2))); |
389 | 3431 XSET (tempy, Lisp_Int, len); |
3432 XSET (timestamp, Lisp_Int, (xrep.MouseTime & 0x7fffff)); | |
771 | 3433 Vmouse_window = f->selected_window; |
389 | 3434 Vmouse_event |
3435 = Fcons (Fcons (tempx, Fcons (tempy, | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3436 Fcons (make_number (f->display.x->v_scroll_bar_width - 2), |
389 | 3437 Qnil))), |
3438 Fcons (Vmouse_window, | |
3439 Fcons (intern (part), | |
3440 Fcons (keyseq, Fcons (timestamp, | |
3441 Qnil))))); | |
3442 return Vmouse_event; | |
3443 } | |
3444 else | |
3445 continue; | |
3446 | |
3447 #ifdef HAVE_X11 | |
3448 case MotionNotify: | |
3449 | |
3450 com_letter = x11_encode_mouse_button (xrep); | |
771 | 3451 if ((f = x_window_to_frame (xrep.MouseWindow)) != 0) |
389 | 3452 { |
771 | 3453 Lisp_Object frame; |
389 | 3454 |
3455 XSET (tempx, Lisp_Int, | |
771 | 3456 min (f->width-1, |
3457 max (0, (xrep.MouseX - f->display.x->internal_border_width) | |
3458 / FONT_WIDTH (f->display.x->font)))); | |
389 | 3459 XSET (tempy, Lisp_Int, |
771 | 3460 min (f->height-1, |
3461 max (0, (xrep.MouseY - f->display.x->internal_border_width) | |
3462 / FONT_HEIGHT (f->display.x->font)))); | |
389 | 3463 |
771 | 3464 XSET (frame, Lisp_Frame, f); |
389 | 3465 XSET (timestamp, Lisp_Int, (xrep.MouseTime & 0x7fffff)); |
3466 | |
3467 pos = Fcons (tempx, Fcons (tempy, Qnil)); | |
3468 Vmouse_window | |
771 | 3469 = Flocate_window_from_coordinates (frame, pos); |
389 | 3470 |
3471 Vmouse_event | |
3472 = Fcons (pos, | |
3473 Fcons (Vmouse_window, | |
3474 Fcons (Qnil, | |
3475 Fcons (Fchar_to_string (make_number (com_letter)), | |
3476 Fcons (timestamp, Qnil))))); | |
3477 return Vmouse_event; | |
3478 } | |
3479 | |
3480 break; | |
3481 #endif /* HAVE_X11 */ | |
3482 | |
3483 default: | |
771 | 3484 if (f = x_window_to_frame (xrep.MouseWindow)) |
3485 Vmouse_window = f->selected_window; | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3486 else if (f = x_window_to_scroll_bar (xrep.MouseWindow, &part, &prefix)) |
771 | 3487 Vmouse_window = f->selected_window; |
389 | 3488 return Vmouse_event = Qnil; |
3489 } | |
3490 } | |
3491 | |
485 | 3492 if (!NILP (arg)) |
389 | 3493 return Qnil; |
3494 | |
3495 /* Wait till we get another mouse event. */ | |
3496 wait_reading_process_input (0, 0, 2, 0); | |
3497 } | |
3498 } | |
3499 #endif | |
3500 | |
3501 | |
3502 #ifndef HAVE_X11 | |
3503 DEFUN ("x-store-cut-buffer", Fx_store_cut_buffer, Sx_store_cut_buffer, | |
3504 1, 1, "sStore text in cut buffer: ", | |
3505 "Store contents of STRING into the cut buffer of the X window system.") | |
3506 (string) | |
3507 register Lisp_Object string; | |
3508 { | |
3509 int mask; | |
3510 | |
3511 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
|
3512 if (! FRAME_X_P (selected_frame)) |
771 | 3513 error ("Selected frame does not understand X protocol."); |
389 | 3514 |
3515 BLOCK_INPUT; | |
3516 XStoreBytes ((char *) XSTRING (string)->data, XSTRING (string)->size); | |
3517 UNBLOCK_INPUT; | |
3518 | |
3519 return Qnil; | |
3520 } | |
3521 | |
3522 DEFUN ("x-get-cut-buffer", Fx_get_cut_buffer, Sx_get_cut_buffer, 0, 0, 0, | |
3523 "Return contents of cut buffer of the X window system, as a string.") | |
3524 () | |
3525 { | |
3526 int len; | |
3527 register Lisp_Object string; | |
3528 int mask; | |
3529 register char *d; | |
3530 | |
3531 BLOCK_INPUT; | |
3532 d = XFetchBytes (&len); | |
3533 string = make_string (d, len); | |
3534 XFree (d); | |
3535 UNBLOCK_INPUT; | |
3536 return string; | |
3537 } | |
3538 #endif /* X10 */ | |
3539 | |
3540 #ifdef HAVE_X11 | |
3541 DEFUN ("x-rebind-key", Fx_rebind_key, Sx_rebind_key, 3, 3, 0, | |
3542 "Rebind X keysym KEYSYM, with MODIFIERS, to generate NEWSTRING.\n\ | |
3543 KEYSYM is a string which conforms to the X keysym definitions found\n\ | |
3544 in X11/keysymdef.h, sans the initial XK_. MODIFIERS is nil or a\n\ | |
3545 list of strings specifying modifier keys such as Control_L, which must\n\ | |
3546 also be depressed for NEWSTRING to appear.") | |
3547 (x_keysym, modifiers, newstring) | |
3548 register Lisp_Object x_keysym; | |
3549 register Lisp_Object modifiers; | |
3550 register Lisp_Object newstring; | |
3551 { | |
3552 char *rawstring; | |
642 | 3553 register KeySym keysym; |
3554 KeySym modifier_list[16]; | |
389 | 3555 |
3556 CHECK_STRING (x_keysym, 1); | |
3557 CHECK_STRING (newstring, 3); | |
3558 | |
3559 keysym = XStringToKeysym ((char *) XSTRING (x_keysym)->data); | |
3560 if (keysym == NoSymbol) | |
3561 error ("Keysym does not exist"); | |
3562 | |
485 | 3563 if (NILP (modifiers)) |
389 | 3564 XRebindKeysym (x_current_display, keysym, modifier_list, 0, |
3565 XSTRING (newstring)->data, XSTRING (newstring)->size); | |
3566 else | |
3567 { | |
3568 register Lisp_Object rest, mod; | |
3569 register int i = 0; | |
3570 | |
485 | 3571 for (rest = modifiers; !NILP (rest); rest = Fcdr (rest)) |
389 | 3572 { |
3573 if (i == 16) | |
3574 error ("Can't have more than 16 modifiers"); | |
3575 | |
3576 mod = Fcar (rest); | |
3577 CHECK_STRING (mod, 3); | |
3578 modifier_list[i] = XStringToKeysym ((char *) XSTRING (mod)->data); | |
3579 if (modifier_list[i] == NoSymbol | |
3580 || !IsModifierKey (modifier_list[i])) | |
3581 error ("Element is not a modifier keysym"); | |
3582 i++; | |
3583 } | |
3584 | |
3585 XRebindKeysym (x_current_display, keysym, modifier_list, i, | |
3586 XSTRING (newstring)->data, XSTRING (newstring)->size); | |
3587 } | |
3588 | |
3589 return Qnil; | |
3590 } | |
3591 | |
3592 DEFUN ("x-rebind-keys", Fx_rebind_keys, Sx_rebind_keys, 2, 2, 0, | |
3593 "Rebind KEYCODE to list of strings STRINGS.\n\ | |
3594 STRINGS should be a list of 16 elements, one for each shift combination.\n\ | |
3595 nil as element means don't change.\n\ | |
3596 See the documentation of `x-rebind-key' for more information.") | |
3597 (keycode, strings) | |
3598 register Lisp_Object keycode; | |
3599 register Lisp_Object strings; | |
3600 { | |
3601 register Lisp_Object item; | |
3602 register unsigned char *rawstring; | |
3603 KeySym rawkey, modifier[1]; | |
3604 int strsize; | |
3605 register unsigned i; | |
3606 | |
3607 CHECK_NUMBER (keycode, 1); | |
3608 CHECK_CONS (strings, 2); | |
3609 rawkey = (KeySym) ((unsigned) (XINT (keycode))) & 255; | |
3610 for (i = 0; i <= 15; strings = Fcdr (strings), i++) | |
3611 { | |
3612 item = Fcar (strings); | |
485 | 3613 if (!NILP (item)) |
389 | 3614 { |
3615 CHECK_STRING (item, 2); | |
3616 strsize = XSTRING (item)->size; | |
3617 rawstring = (unsigned char *) xmalloc (strsize); | |
3618 bcopy (XSTRING (item)->data, rawstring, strsize); | |
3619 modifier[1] = 1 << i; | |
3620 XRebindKeysym (x_current_display, rawkey, modifier, 1, | |
3621 rawstring, strsize); | |
3622 } | |
3623 } | |
3624 return Qnil; | |
3625 } | |
3626 #else | |
3627 DEFUN ("x-rebind-key", Fx_rebind_key, Sx_rebind_key, 3, 3, 0, | |
3628 "Rebind KEYCODE, with shift bits SHIFT-MASK, to new string NEWSTRING.\n\ | |
3629 KEYCODE and SHIFT-MASK should be numbers representing the X keyboard code\n\ | |
3630 and shift mask respectively. NEWSTRING is an arbitrary string of keystrokes.\n\ | |
3631 If SHIFT-MASK is nil, then KEYCODE's key will be bound to NEWSTRING for\n\ | |
3632 all shift combinations.\n\ | |
3633 Shift Lock 1 Shift 2\n\ | |
3634 Meta 4 Control 8\n\ | |
3635 \n\ | |
3636 For values of KEYCODE, see /usr/lib/Xkeymap.txt (remember that the codes\n\ | |
3637 in that file are in octal!)\n\ | |
3638 \n\ | |
3639 NOTE: due to an X bug, this function will not take effect unless one has\n\ | |
3640 a `~/.Xkeymap' file. (See the documentation for the `keycomp' program.)\n\ | |
3641 This problem will be fixed in X version 11.") | |
3642 | |
3643 (keycode, shift_mask, newstring) | |
3644 register Lisp_Object keycode; | |
3645 register Lisp_Object shift_mask; | |
3646 register Lisp_Object newstring; | |
3647 { | |
3648 char *rawstring; | |
3649 int keysym, rawshift; | |
3650 int i, strsize; | |
3651 | |
3652 CHECK_NUMBER (keycode, 1); | |
485 | 3653 if (!NILP (shift_mask)) |
389 | 3654 CHECK_NUMBER (shift_mask, 2); |
3655 CHECK_STRING (newstring, 3); | |
3656 strsize = XSTRING (newstring)->size; | |
3657 rawstring = (char *) xmalloc (strsize); | |
3658 bcopy (XSTRING (newstring)->data, rawstring, strsize); | |
3659 | |
3660 keysym = ((unsigned) (XINT (keycode))) & 255; | |
3661 | |
485 | 3662 if (NILP (shift_mask)) |
389 | 3663 { |
3664 for (i = 0; i <= 15; i++) | |
3665 XRebindCode (keysym, i<<11, rawstring, strsize); | |
3666 } | |
3667 else | |
3668 { | |
3669 rawshift = (((unsigned) (XINT (shift_mask))) & 15) << 11; | |
3670 XRebindCode (keysym, rawshift, rawstring, strsize); | |
3671 } | |
3672 return Qnil; | |
3673 } | |
3674 | |
3675 DEFUN ("x-rebind-keys", Fx_rebind_keys, Sx_rebind_keys, 2, 2, 0, | |
3676 "Rebind KEYCODE to list of strings STRINGS.\n\ | |
3677 STRINGS should be a list of 16 elements, one for each shift combination.\n\ | |
3678 nil as element means don't change.\n\ | |
3679 See the documentation of `x-rebind-key' for more information.") | |
3680 (keycode, strings) | |
3681 register Lisp_Object keycode; | |
3682 register Lisp_Object strings; | |
3683 { | |
3684 register Lisp_Object item; | |
3685 register char *rawstring; | |
3686 KeySym rawkey, modifier[1]; | |
3687 int strsize; | |
3688 register unsigned i; | |
3689 | |
3690 CHECK_NUMBER (keycode, 1); | |
3691 CHECK_CONS (strings, 2); | |
3692 rawkey = (KeySym) ((unsigned) (XINT (keycode))) & 255; | |
3693 for (i = 0; i <= 15; strings = Fcdr (strings), i++) | |
3694 { | |
3695 item = Fcar (strings); | |
485 | 3696 if (!NILP (item)) |
389 | 3697 { |
3698 CHECK_STRING (item, 2); | |
3699 strsize = XSTRING (item)->size; | |
3700 rawstring = (char *) xmalloc (strsize); | |
3701 bcopy (XSTRING (item)->data, rawstring, strsize); | |
3702 XRebindCode (rawkey, i << 11, rawstring, strsize); | |
3703 } | |
3704 } | |
3705 return Qnil; | |
3706 } | |
3707 #endif /* not HAVE_X11 */ | |
3708 | |
3709 #ifdef HAVE_X11 | |
3710 Visual * | |
3711 select_visual (screen, depth) | |
3712 Screen *screen; | |
3713 unsigned int *depth; | |
3714 { | |
3715 Visual *v; | |
3716 XVisualInfo *vinfo, vinfo_template; | |
3717 int n_visuals; | |
3718 | |
3719 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
|
3720 |
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
|
3721 #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
|
3722 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
|
3723 #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
|
3724 vinfo_template.visualid = x->visualid; |
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 #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
|
3726 |
389 | 3727 vinfo = XGetVisualInfo (x_current_display, VisualIDMask, &vinfo_template, |
3728 &n_visuals); | |
3729 if (n_visuals != 1) | |
3730 fatal ("Can't get proper X visual info"); | |
3731 | |
3732 if ((1 << vinfo->depth) == vinfo->colormap_size) | |
3733 *depth = vinfo->depth; | |
3734 else | |
3735 { | |
3736 int i = 0; | |
3737 int n = vinfo->colormap_size - 1; | |
3738 while (n) | |
3739 { | |
3740 n = n >> 1; | |
3741 i++; | |
3742 } | |
3743 *depth = i; | |
3744 } | |
3745 | |
3746 XFree ((char *) vinfo); | |
3747 return v; | |
3748 } | |
3749 #endif /* HAVE_X11 */ | |
3750 | |
3751 DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection, | |
3752 1, 2, 0, "Open a connection to an X server.\n\ | |
3753 DISPLAY is the name of the display to connect to. Optional second\n\ | |
3754 arg XRM_STRING is a string of resources in xrdb format.") | |
3755 (display, xrm_string) | |
3756 Lisp_Object display, xrm_string; | |
3757 { | |
3758 unsigned int n_planes; | |
3759 unsigned char *xrm_option; | |
3760 | |
3761 CHECK_STRING (display, 0); | |
3762 if (x_current_display != 0) | |
3763 error ("X server connection is already initialized"); | |
3764 | |
3765 /* This is what opens the connection and sets x_current_display. | |
3766 This also initializes many symbols, such as those used for input. */ | |
3767 x_term_init (XSTRING (display)->data); | |
3768 | |
3769 #ifdef HAVE_X11 | |
3770 XFASTINT (Vwindow_system_version) = 11; | |
3771 | |
3772 if (!EQ (xrm_string, Qnil)) | |
3773 { | |
3774 CHECK_STRING (xrm_string, 1); | |
3775 xrm_option = (unsigned char *) XSTRING (xrm_string); | |
3776 } | |
3777 else | |
3778 xrm_option = (unsigned char *) 0; | |
3779 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
|
3780 #ifdef HAVE_X11R5 |
997f8e481bf8
* xfns.c (Fx_open_connection): If we have X11R5, use
Jim Blandy <jimb@redhat.com>
parents:
2279
diff
changeset
|
3781 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
|
3782 #else |
389 | 3783 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
|
3784 #endif |
389 | 3785 |
3786 x_screen = DefaultScreenOfDisplay (x_current_display); | |
3787 | |
3788 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
|
3789 x_screen_planes = n_planes; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3790 x_screen_height = HeightOfScreen (x_screen); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3791 x_screen_width = WidthOfScreen (x_screen); |
389 | 3792 |
3793 /* X Atoms used by emacs. */ | |
2197
fb5a1caebef6
(Xatom_wm_change_state): Just declare.
Richard M. Stallman <rms@gnu.org>
parents:
2136
diff
changeset
|
3794 Xatoms_of_xselect (); |
389 | 3795 BLOCK_INPUT; |
641 | 3796 Xatom_wm_protocols = XInternAtom (x_current_display, "WM_PROTOCOLS", |
3797 False); | |
3798 Xatom_wm_take_focus = XInternAtom (x_current_display, "WM_TAKE_FOCUS", | |
3799 False); | |
3800 Xatom_wm_save_yourself = XInternAtom (x_current_display, "WM_SAVE_YOURSELF", | |
3801 False); | |
3802 Xatom_wm_delete_window = XInternAtom (x_current_display, "WM_DELETE_WINDOW", | |
3803 False); | |
3804 Xatom_wm_change_state = XInternAtom (x_current_display, "WM_CHANGE_STATE", | |
3805 False); | |
3806 Xatom_wm_configure_denied = XInternAtom (x_current_display, | |
3807 "WM_CONFIGURE_DENIED", False); | |
3808 Xatom_wm_window_moved = XInternAtom (x_current_display, "WM_MOVED", | |
3809 False); | |
389 | 3810 UNBLOCK_INPUT; |
3811 #else /* not HAVE_X11 */ | |
3812 XFASTINT (Vwindow_system_version) = 10; | |
3813 #endif /* not HAVE_X11 */ | |
3814 return Qnil; | |
3815 } | |
3816 | |
3817 DEFUN ("x-close-current-connection", Fx_close_current_connection, | |
3818 Sx_close_current_connection, | |
3819 0, 0, 0, "Close the connection to the current X server.") | |
3820 () | |
3821 { | |
3822 #ifdef HAVE_X11 | |
3823 /* This is ONLY used when killing emacs; For switching displays | |
3824 we'll have to take care of setting CloseDownMode elsewhere. */ | |
3825 | |
3826 if (x_current_display) | |
3827 { | |
3828 BLOCK_INPUT; | |
3829 XSetCloseDownMode (x_current_display, DestroyAll); | |
3830 XCloseDisplay (x_current_display); | |
3831 } | |
3832 else | |
3833 fatal ("No current X display connection to close\n"); | |
3834 #endif | |
3835 return Qnil; | |
3836 } | |
3837 | |
3838 DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, | |
3839 1, 1, 0, "If ON is non-nil, report X errors as soon as the erring request is made.\n\ | |
3840 If ON is nil, allow buffering of requests.\n\ | |
3841 Turning on synchronization prohibits the Xlib routines from buffering\n\ | |
3842 requests and seriously degrades performance, but makes debugging much\n\ | |
3843 easier.") | |
3844 (on) | |
3845 Lisp_Object on; | |
3846 { | |
3847 XSynchronize (x_current_display, !EQ (on, Qnil)); | |
3848 | |
3849 return Qnil; | |
3850 } | |
3851 | |
3852 | |
3853 syms_of_xfns () | |
3854 { | |
3855 /* This is zero if not using X windows. */ | |
3856 x_current_display = 0; | |
3857 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3858 /* 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
|
3859 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
|
3860 /*&&& init symbols here &&&*/ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3861 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
|
3862 staticpro (&Qauto_raise); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3863 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
|
3864 staticpro (&Qauto_lower); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3865 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
|
3866 staticpro (&Qbackground_color); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3867 Qbar = intern ("bar"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3868 staticpro (&Qbar); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3869 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
|
3870 staticpro (&Qborder_color); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3871 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
|
3872 staticpro (&Qborder_width); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3873 Qbox = intern ("box"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3874 staticpro (&Qbox); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3875 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
|
3876 staticpro (&Qcursor_color); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3877 Qcursor_type = intern ("cursor-type"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3878 staticpro (&Qcursor_type); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3879 Qfont = intern ("font"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3880 staticpro (&Qfont); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3881 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
|
3882 staticpro (&Qforeground_color); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3883 Qgeometry = intern ("geometry"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3884 staticpro (&Qgeometry); |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
3885 Qicon = intern ("icon"); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
3886 staticpro (&Qicon); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3887 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
|
3888 staticpro (&Qicon_left); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3889 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
|
3890 staticpro (&Qicon_top); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3891 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
|
3892 staticpro (&Qicon_type); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3893 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
|
3894 staticpro (&Qinternal_border_width); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3895 Qleft = intern ("left"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3896 staticpro (&Qleft); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3897 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
|
3898 staticpro (&Qmouse_color); |
1874
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
3899 Qnone = intern ("none"); |
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
3900 staticpro (&Qnone); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3901 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
|
3902 staticpro (&Qparent_id); |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
3903 Qsuppress_icon = intern ("suppress-icon"); |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
3904 staticpro (&Qsuppress_icon); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3905 Qtop = intern ("top"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3906 staticpro (&Qtop); |
389 | 3907 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
|
3908 staticpro (&Qundefined_color); |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3909 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
|
3910 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
|
3911 Qvisibility = intern ("visibility"); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
3912 staticpro (&Qvisibility); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3913 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
|
3914 staticpro (&Qwindow_id); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3915 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
|
3916 staticpro (&Qx_frame_parameter); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3917 /* 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
|
3918 |
389 | 3919 Fput (Qundefined_color, Qerror_conditions, |
3920 Fcons (Qundefined_color, Fcons (Qerror, Qnil))); | |
3921 Fput (Qundefined_color, Qerror_message, | |
3922 build_string ("Undefined color")); | |
3923 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3924 init_x_parm_symbols (); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3925 |
389 | 3926 DEFVAR_INT ("mouse-buffer-offset", &mouse_buffer_offset, |
3927 "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
|
3928 mouse_buffer_offset = 0; |
389 | 3929 |
3930 DEFVAR_INT ("x-pointer-shape", &Vx_pointer_shape, | |
3931 "The shape of the pointer when over text."); | |
3932 Vx_pointer_shape = Qnil; | |
3933 | |
3934 DEFVAR_INT ("x-nontext-pointer-shape", &Vx_nontext_pointer_shape, | |
3935 "The shape of the pointer when not over text."); | |
3936 Vx_nontext_pointer_shape = Qnil; | |
3937 | |
3938 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
|
3939 "The shape of the pointer when over the mode line."); |
389 | 3940 Vx_mode_pointer_shape = Qnil; |
3941 | |
3942 DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel, | |
3943 "A string indicating the foreground color of the cursor box."); | |
3944 Vx_cursor_fore_pixel = Qnil; | |
3945 | |
3946 DEFVAR_LISP ("mouse-grabbed", &Vmouse_depressed, | |
3947 "Non-nil if a mouse button is currently depressed."); | |
3948 Vmouse_depressed = Qnil; | |
3949 | |
3950 DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, | |
3951 "t if no X window manager is in use."); | |
3952 | |
3953 #ifdef HAVE_X11 | |
3954 defsubr (&Sx_get_resource); | |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
3955 #if 0 |
389 | 3956 defsubr (&Sx_draw_rectangle); |
3957 defsubr (&Sx_erase_rectangle); | |
3958 defsubr (&Sx_contour_region); | |
3959 defsubr (&Sx_uncontour_region); | |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
3960 #endif |
2277
773e47f29c5a
(Fx_display_color_p): Renamed from Fx_color_display_p.
Richard M. Stallman <rms@gnu.org>
parents:
2276
diff
changeset
|
3961 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
|
3962 defsubr (&Sx_color_defined_p); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3963 defsubr (&Sx_server_vendor); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3964 defsubr (&Sx_server_version); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3965 defsubr (&Sx_display_pixel_width); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3966 defsubr (&Sx_display_pixel_height); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3967 defsubr (&Sx_display_mm_width); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3968 defsubr (&Sx_display_mm_height); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3969 defsubr (&Sx_display_screens); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3970 defsubr (&Sx_display_planes); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3971 defsubr (&Sx_display_color_cells); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3972 defsubr (&Sx_display_visual_class); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3973 defsubr (&Sx_display_backing_store); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3974 defsubr (&Sx_display_save_under); |
389 | 3975 #if 0 |
3976 defsubr (&Sx_track_pointer); | |
3977 defsubr (&Sx_grab_pointer); | |
3978 defsubr (&Sx_ungrab_pointer); | |
436
6e0a136fca4f
*** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents:
398
diff
changeset
|
3979 #endif |
389 | 3980 #else |
3981 defsubr (&Sx_get_default); | |
3982 defsubr (&Sx_store_cut_buffer); | |
3983 defsubr (&Sx_get_cut_buffer); | |
3984 defsubr (&Sx_set_face); | |
3985 #endif | |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
3986 defsubr (&Sx_parse_geometry); |
771 | 3987 defsubr (&Sx_create_frame); |
3988 defsubr (&Sfocus_frame); | |
3989 defsubr (&Sunfocus_frame); | |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
3990 #if 0 |
389 | 3991 defsubr (&Sx_horizontal_line); |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
3992 #endif |
389 | 3993 defsubr (&Sx_rebind_key); |
3994 defsubr (&Sx_rebind_keys); | |
3995 defsubr (&Sx_open_connection); | |
3996 defsubr (&Sx_close_current_connection); | |
3997 defsubr (&Sx_synchronize); | |
3998 | |
3999 /* This was used in the old event interface which used a separate | |
4000 event queue.*/ | |
4001 #if 0 | |
4002 defsubr (&Sx_mouse_events); | |
4003 defsubr (&Sx_get_mouse_event); | |
4004 #endif | |
4005 } | |
4006 | |
4007 #endif /* HAVE_X_WINDOWS */ |