Mercurial > emacs
annotate src/xfns.c @ 12664:ce1cae301efe
(imenu--history-list): Don't make this buffer-local.
(imenu): Call imenu-choose-buffer-index from interactive spec.
(imenu-generic-expression): Call make-variable-buffer-local.
(imenu-create-index-pattern): Variable deleted.
Many doc fixes.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 25 Jul 1995 21:13:10 +0000 |
parents | 5beb1d2be5c1 |
children | a3466dad7d6d |
rev | line source |
---|---|
389 | 1 /* Functions for the X window system. |
11235 | 2 Copyright (C) 1989, 1992, 1993, 1994, 1995 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 | |
7899 | 24 #include <signal.h> |
25 #include <config.h> | |
26 | |
8091
f40cbe50c74f
(XLIB_ILLEGAL_ACCESS): Defined.
Richard M. Stallman <rms@gnu.org>
parents:
8090
diff
changeset
|
27 /* This makes the fields of a Display accessible, in Xlib header files. */ |
f40cbe50c74f
(XLIB_ILLEGAL_ACCESS): Defined.
Richard M. Stallman <rms@gnu.org>
parents:
8090
diff
changeset
|
28 #define XLIB_ILLEGAL_ACCESS |
f40cbe50c74f
(XLIB_ILLEGAL_ACCESS): Defined.
Richard M. Stallman <rms@gnu.org>
parents:
8090
diff
changeset
|
29 |
389 | 30 #include "lisp.h" |
31 #include "xterm.h" | |
771 | 32 #include "frame.h" |
389 | 33 #include "window.h" |
34 #include "buffer.h" | |
35 #include "dispextern.h" | |
515 | 36 #include "keyboard.h" |
2439
b6c62e4abf59
Put interrupt input blocking in a separate file from xterm.h.
Jim Blandy <jimb@redhat.com>
parents:
2355
diff
changeset
|
37 #include "blockinput.h" |
9563 | 38 #include "paths.h" |
389 | 39 |
40 #ifdef HAVE_X_WINDOWS | |
41 extern void abort (); | |
42 | |
2355
cec8c9490d8a
* xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents:
2341
diff
changeset
|
43 #ifndef VMS |
3821
8f353c2491d0
* xfns.c: Always #include "bitmaps/gray.xbm"; the bitmaps seem to
Jim Blandy <jimb@redhat.com>
parents:
3692
diff
changeset
|
44 #if 1 /* Used to be #ifdef EMACS_BITMAP_FILES, but this should always work. */ |
3512
2657b04dd324
[EMACS_BIT_MAPS]: Include gray.xbm from ./bitmaps.
Richard M. Stallman <rms@gnu.org>
parents:
3507
diff
changeset
|
45 #include "bitmaps/gray.xbm" |
2657b04dd324
[EMACS_BIT_MAPS]: Include gray.xbm from ./bitmaps.
Richard M. Stallman <rms@gnu.org>
parents:
3507
diff
changeset
|
46 #else |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
47 #include <X11/bitmaps/gray> |
3512
2657b04dd324
[EMACS_BIT_MAPS]: Include gray.xbm from ./bitmaps.
Richard M. Stallman <rms@gnu.org>
parents:
3507
diff
changeset
|
48 #endif |
2355
cec8c9490d8a
* xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents:
2341
diff
changeset
|
49 #else |
cec8c9490d8a
* xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents:
2341
diff
changeset
|
50 #include "[.bitmaps]gray.xbm" |
cec8c9490d8a
* xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents:
2341
diff
changeset
|
51 #endif |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
52 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
53 #ifdef USE_X_TOOLKIT |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
54 #include <X11/Shell.h> |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
55 |
12616
ca170048a679
[USE_MOTIF]: Don't include X11/Xaw/Paned.h, X11/Xaw/Label.h.
Richard M. Stallman <rms@gnu.org>
parents:
12546
diff
changeset
|
56 #ifndef USE_MOTIF |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
57 #include <X11/Xaw/Paned.h> |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
58 #include <X11/Xaw/Label.h> |
12616
ca170048a679
[USE_MOTIF]: Don't include X11/Xaw/Paned.h, X11/Xaw/Label.h.
Richard M. Stallman <rms@gnu.org>
parents:
12546
diff
changeset
|
59 #endif /* USE_MOTIF */ |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
60 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
61 #ifdef USG |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
62 #undef USG /* ####KLUDGE for Solaris 2.2 and up */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
63 #include <X11/Xos.h> |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
64 #define USG |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
65 #else |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
66 #include <X11/Xos.h> |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
67 #endif |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
68 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
69 #include "widget.h" |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
70 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
71 #include "../lwlib/lwlib.h" |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
72 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
73 /* Do the EDITRES protocol if running X11R5 */ |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
74 #if (XtSpecificationRelease >= 5) |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
75 #define HACK_EDITRES |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
76 extern void _XEditResCheckMessages (); |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
77 #endif /* R5 + Athena */ |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
78 |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
79 /* Unique id counter for widgets created by the Lucid Widget |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
80 Library. */ |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
81 extern LWLIB_ID widget_id_tick; |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
82 |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
83 /* This is part of a kludge--see lwlib/xlwmenu.c. */ |
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
84 XFontStruct *xlwmenu_default_font; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
85 |
5900
284c0d70a50a
(x_set_menu_bar_lines) [USE_X_TOOLKIT]: Dont Call XtDestroyWidget but
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5899
diff
changeset
|
86 extern void free_frame_menubar (); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
87 #endif /* USE_X_TOOLKIT */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
88 |
389 | 89 #define min(a,b) ((a) < (b) ? (a) : (b)) |
90 #define max(a,b) ((a) > (b) ? (a) : (b)) | |
91 | |
4279 | 92 #ifdef HAVE_X11R4 |
93 #define MAXREQUEST(dpy) (XMaxRequestSize (dpy)) | |
94 #else | |
95 #define MAXREQUEST(dpy) ((dpy)->max_request_size) | |
96 #endif | |
97 | |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
98 /* The name we're using in resource queries. */ |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
99 Lisp_Object Vx_resource_name; |
3170
647229114f47
* xfns.c: Make resource manager work correctly even when
Jim Blandy <jimb@redhat.com>
parents:
3141
diff
changeset
|
100 |
389 | 101 /* The background and shape of the mouse pointer, and shape when not |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
102 over text or in the modeline. */ |
389 | 103 Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape; |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
104 /* The shape when over mouse-sensitive text. */ |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
105 Lisp_Object Vx_sensitive_text_pointer_shape; |
389 | 106 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
107 /* Color of chars displayed in cursor box. */ |
389 | 108 Lisp_Object Vx_cursor_fore_pixel; |
109 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
110 /* Nonzero if using X. */ |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
111 static int x_in_use; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
112 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
113 /* Non nil if no window manager is in use. */ |
389 | 114 Lisp_Object Vx_no_window_manager; |
115 | |
9563 | 116 /* Search path for bitmap files. */ |
117 Lisp_Object Vx_bitmap_file_path; | |
118 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
119 /* 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
|
120 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
|
121 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
|
122 evaluate this expression. |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
123 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
124 (progn |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
125 ;; 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
|
126 ;; 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
|
127 (goto-char (point-min)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
128 (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
|
129 (let (symbol-list) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
130 (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
|
131 (setq symbol-list |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
132 (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
|
133 symbol-list)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
134 (forward-line 1)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
135 (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
|
136 ;; 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
|
137 (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
|
138 (let ((start (point))) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
139 (while (looking-at "^ Q") |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
140 (forward-line 2)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
141 (kill-region start (point))) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
142 ;; 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
|
143 (while symbol-list |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
144 (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
|
145 (let ((start (point))) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
146 (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
|
147 (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
|
148 (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
|
149 (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
|
150 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
151 */ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
152 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
153 /*&&& symbols declared here &&&*/ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
154 Lisp_Object Qauto_raise; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
155 Lisp_Object Qauto_lower; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
156 Lisp_Object Qbackground_color; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
157 Lisp_Object Qbar; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
158 Lisp_Object Qborder_color; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
159 Lisp_Object Qborder_width; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
160 Lisp_Object Qbox; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
161 Lisp_Object Qcursor_color; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
162 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
|
163 Lisp_Object Qfont; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
164 Lisp_Object Qforeground_color; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
165 Lisp_Object Qgeometry; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
166 Lisp_Object Qicon_left; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
167 Lisp_Object Qicon_top; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
168 Lisp_Object Qicon_type; |
12073 | 169 Lisp_Object Qicon_name; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
170 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
|
171 Lisp_Object Qleft; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
172 Lisp_Object Qmouse_color; |
1874
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
173 Lisp_Object Qnone; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
174 Lisp_Object Qparent_id; |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
175 Lisp_Object Qscroll_bar_width; |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
176 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
|
177 Lisp_Object Qtop; |
389 | 178 Lisp_Object Qundefined_color; |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
179 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
|
180 Lisp_Object Qvisibility; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
181 Lisp_Object Qwindow_id; |
771 | 182 Lisp_Object Qx_frame_parameter; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
183 Lisp_Object Qx_resource_name; |
7251
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
184 Lisp_Object Quser_position; |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
185 Lisp_Object Quser_size; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
186 Lisp_Object Qdisplay; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
187 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
188 /* 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
|
189 extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth; |
3650
16510ca14405
(syms_of_xfns): Don't set up Qicon.
Richard M. Stallman <rms@gnu.org>
parents:
3640
diff
changeset
|
190 extern Lisp_Object Qunsplittable, Qmenu_bar_lines; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
191 |
389 | 192 extern Lisp_Object Vwindow_system_version; |
193 | |
194 | |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
195 /* Error if we are not connected to X. */ |
5948 | 196 void |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
197 check_x () |
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
198 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
199 if (! x_in_use) |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
200 error ("X windows are not in use or not initialized"); |
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
201 } |
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
202 |
7791
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
203 /* Nonzero if using X for display. */ |
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
204 |
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
205 int |
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
206 using_x_p () |
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
207 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
208 return x_in_use; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
209 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
210 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
211 /* Extract a frame as a FRAME_PTR, defaulting to the selected frame |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
212 and checking validity for X. */ |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
213 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
214 FRAME_PTR |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
215 check_x_frame (frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
216 Lisp_Object frame; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
217 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
218 FRAME_PTR f; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
219 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
220 if (NILP (frame)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
221 f = selected_frame; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
222 else |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
223 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
224 CHECK_LIVE_FRAME (frame, 0); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
225 f = XFRAME (frame); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
226 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
227 if (! FRAME_X_P (f)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
228 error ("non-X frame used"); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
229 return f; |
7791
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
230 } |
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
231 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
232 /* Let the user specify an X display with a frame. |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
233 nil stands for the selected frame--or, if that is not an X frame, |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
234 the first X display on the list. */ |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
235 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
236 static struct x_display_info * |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
237 check_x_display_info (frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
238 Lisp_Object frame; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
239 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
240 if (NILP (frame)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
241 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
242 if (FRAME_X_P (selected_frame)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
243 return FRAME_X_DISPLAY_INFO (selected_frame); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
244 else if (x_display_list != 0) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
245 return x_display_list; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
246 else |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
247 error ("X windows are not in use or not initialized"); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
248 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
249 else if (STRINGP (frame)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
250 return x_display_info_for_name (frame); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
251 else |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
252 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
253 FRAME_PTR f; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
254 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
255 CHECK_LIVE_FRAME (frame, 0); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
256 f = XFRAME (frame); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
257 if (! FRAME_X_P (f)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
258 error ("non-X frame used"); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
259 return FRAME_X_DISPLAY_INFO (f); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
260 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
261 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
262 |
771 | 263 /* Return the Emacs frame-object corresponding to an X window. |
264 It could be the frame's main window or an icon window. */ | |
265 | |
9948
982820033564
(x_window_to_frame, x_any_window_to_frame, x_top_window_to_frame): Use the new
Karl Heuer <kwzh@gnu.org>
parents:
9813
diff
changeset
|
266 /* This function can be called during GC, so use GC_xxx type test macros. */ |
2964
a0ff2bc5dd05
(x_window_to_frame): Use XGCTYPE.
Richard M. Stallman <rms@gnu.org>
parents:
2936
diff
changeset
|
267 |
771 | 268 struct frame * |
11197
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
269 x_window_to_frame (dpyinfo, wdesc) |
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
270 struct x_display_info *dpyinfo; |
389 | 271 int wdesc; |
272 { | |
771 | 273 Lisp_Object tail, frame; |
274 struct frame *f; | |
275 | |
9948
982820033564
(x_window_to_frame, x_any_window_to_frame, x_top_window_to_frame): Use the new
Karl Heuer <kwzh@gnu.org>
parents:
9813
diff
changeset
|
276 for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr) |
389 | 277 { |
771 | 278 frame = XCONS (tail)->car; |
9948
982820033564
(x_window_to_frame, x_any_window_to_frame, x_top_window_to_frame): Use the new
Karl Heuer <kwzh@gnu.org>
parents:
9813
diff
changeset
|
279 if (!GC_FRAMEP (frame)) |
389 | 280 continue; |
771 | 281 f = XFRAME (frame); |
11220
dd1c883953a2
(x_window_to_frame): Skip non-X frames before testing dpyinfo.
Karl Heuer <kwzh@gnu.org>
parents:
11197
diff
changeset
|
282 if (f->display.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo) |
11197
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
283 continue; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
284 #ifdef USE_X_TOOLKIT |
6011
5ef8aed59f2e
(x_window_to_frame): Add parens for clarity.
Richard M. Stallman <rms@gnu.org>
parents:
5998
diff
changeset
|
285 if ((f->display.x->edit_widget |
5ef8aed59f2e
(x_window_to_frame): Add parens for clarity.
Richard M. Stallman <rms@gnu.org>
parents:
5998
diff
changeset
|
286 && XtWindow (f->display.x->edit_widget) == wdesc) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
287 || f->display.x->icon_desc == wdesc) |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
288 return f; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
289 #else /* not USE_X_TOOLKIT */ |
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
|
290 if (FRAME_X_WINDOW (f) == wdesc |
771 | 291 || f->display.x->icon_desc == wdesc) |
292 return f; | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
293 #endif /* not USE_X_TOOLKIT */ |
389 | 294 } |
295 return 0; | |
296 } | |
297 | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
298 #ifdef USE_X_TOOLKIT |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
299 /* Like x_window_to_frame but also compares the window with the widget's |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
300 windows. */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
301 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
302 struct frame * |
11197
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
303 x_any_window_to_frame (dpyinfo, wdesc) |
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
304 struct x_display_info *dpyinfo; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
305 int wdesc; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
306 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
307 Lisp_Object tail, frame; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
308 struct frame *f; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
309 struct x_display *x; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
310 |
9948
982820033564
(x_window_to_frame, x_any_window_to_frame, x_top_window_to_frame): Use the new
Karl Heuer <kwzh@gnu.org>
parents:
9813
diff
changeset
|
311 for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
312 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
313 frame = XCONS (tail)->car; |
9948
982820033564
(x_window_to_frame, x_any_window_to_frame, x_top_window_to_frame): Use the new
Karl Heuer <kwzh@gnu.org>
parents:
9813
diff
changeset
|
314 if (!GC_FRAMEP (frame)) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
315 continue; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
316 f = XFRAME (frame); |
11220
dd1c883953a2
(x_window_to_frame): Skip non-X frames before testing dpyinfo.
Karl Heuer <kwzh@gnu.org>
parents:
11197
diff
changeset
|
317 if (f->display.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo) |
11197
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
318 continue; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
319 x = f->display.x; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
320 /* This frame matches if the window is any of its widgets. */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
321 if (wdesc == XtWindow (x->widget) |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
322 || wdesc == XtWindow (x->column_widget) |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
323 || wdesc == XtWindow (x->edit_widget)) |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
324 return f; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
325 /* Match if the window is this frame's menubar. */ |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
326 if (lw_window_is_in_menubar (wdesc, x->menubar_widget)) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
327 return f; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
328 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
329 return 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
330 } |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
331 |
11611
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
332 /* Likewise, but exclude the menu bar widget. */ |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
333 |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
334 struct frame * |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
335 x_non_menubar_window_to_frame (dpyinfo, wdesc) |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
336 struct x_display_info *dpyinfo; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
337 int wdesc; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
338 { |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
339 Lisp_Object tail, frame; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
340 struct frame *f; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
341 struct x_display *x; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
342 |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
343 for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr) |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
344 { |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
345 frame = XCONS (tail)->car; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
346 if (!GC_FRAMEP (frame)) |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
347 continue; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
348 f = XFRAME (frame); |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
349 if (f->display.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo) |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
350 continue; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
351 x = f->display.x; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
352 /* This frame matches if the window is any of its widgets. */ |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
353 if (wdesc == XtWindow (x->widget) |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
354 || wdesc == XtWindow (x->column_widget) |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
355 || wdesc == XtWindow (x->edit_widget)) |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
356 return f; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
357 } |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
358 return 0; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
359 } |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
360 |
12656
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
361 /* Likewise, but consider only the menu bar widget. */ |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
362 |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
363 struct frame * |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
364 x_menubar_window_to_frame (dpyinfo, wdesc) |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
365 struct x_display_info *dpyinfo; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
366 int wdesc; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
367 { |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
368 Lisp_Object tail, frame; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
369 struct frame *f; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
370 struct x_display *x; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
371 |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
372 for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr) |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
373 { |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
374 frame = XCONS (tail)->car; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
375 if (!GC_FRAMEP (frame)) |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
376 continue; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
377 f = XFRAME (frame); |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
378 if (f->display.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo) |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
379 continue; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
380 x = f->display.x; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
381 /* Match if the window is this frame's menubar. */ |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
382 if (lw_window_is_in_menubar (wdesc, x->menubar_widget)) |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
383 return f; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
384 } |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
385 return 0; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
386 } |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
387 |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
388 /* Return the frame whose principal (outermost) window is WDESC. |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
389 If WDESC is some other (smaller) window, we return 0. */ |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
390 |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
391 struct frame * |
11197
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
392 x_top_window_to_frame (dpyinfo, wdesc) |
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
393 struct x_display_info *dpyinfo; |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
394 int wdesc; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
395 { |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
396 Lisp_Object tail, frame; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
397 struct frame *f; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
398 struct x_display *x; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
399 |
9948
982820033564
(x_window_to_frame, x_any_window_to_frame, x_top_window_to_frame): Use the new
Karl Heuer <kwzh@gnu.org>
parents:
9813
diff
changeset
|
400 for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr) |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
401 { |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
402 frame = XCONS (tail)->car; |
9948
982820033564
(x_window_to_frame, x_any_window_to_frame, x_top_window_to_frame): Use the new
Karl Heuer <kwzh@gnu.org>
parents:
9813
diff
changeset
|
403 if (!GC_FRAMEP (frame)) |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
404 continue; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
405 f = XFRAME (frame); |
11220
dd1c883953a2
(x_window_to_frame): Skip non-X frames before testing dpyinfo.
Karl Heuer <kwzh@gnu.org>
parents:
11197
diff
changeset
|
406 if (f->display.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo) |
11197
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
407 continue; |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
408 x = f->display.x; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
409 /* This frame matches if the window is its topmost widget. */ |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
410 if (wdesc == XtWindow (x->widget)) |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
411 return f; |
12019
63ee64941021
(x_top_window_to_frame): Don't match menu-bar widget.
Karl Heuer <kwzh@gnu.org>
parents:
12011
diff
changeset
|
412 #if 0 /* I don't know why it did this, |
63ee64941021
(x_top_window_to_frame): Don't match menu-bar widget.
Karl Heuer <kwzh@gnu.org>
parents:
12011
diff
changeset
|
413 but it seems logically wrong, |
63ee64941021
(x_top_window_to_frame): Don't match menu-bar widget.
Karl Heuer <kwzh@gnu.org>
parents:
12011
diff
changeset
|
414 and it causes trouble for MapNotify events. */ |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
415 /* Match if the window is this frame's menubar. */ |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
416 if (x->menubar_widget |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
417 && wdesc == XtWindow (x->menubar_widget)) |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
418 return f; |
12019
63ee64941021
(x_top_window_to_frame): Don't match menu-bar widget.
Karl Heuer <kwzh@gnu.org>
parents:
12011
diff
changeset
|
419 #endif |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
420 } |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
421 return 0; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
422 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
423 #endif /* USE_X_TOOLKIT */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
424 |
389 | 425 |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
426 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
427 /* Code to deal with bitmaps. Bitmaps are referenced by their bitmap |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
428 id, which is just an int that this section returns. Bitmaps are |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
429 reference counted so they can be shared among frames. |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
430 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
431 Bitmap indices are guaranteed to be > 0, so a negative number can |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
432 be used to indicate no bitmap. |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
433 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
434 If you use x_create_bitmap_from_data, then you must keep track of |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
435 the bitmaps yourself. That is, creating a bitmap from the same |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
436 data more than once will not be caught. */ |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
437 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
438 |
9563 | 439 /* Functions to access the contents of a bitmap, given an id. */ |
440 | |
441 int | |
442 x_bitmap_height (f, id) | |
443 FRAME_PTR f; | |
444 int id; | |
445 { | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
446 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].height; |
9563 | 447 } |
448 | |
449 int | |
450 x_bitmap_width (f, id) | |
451 FRAME_PTR f; | |
452 int id; | |
453 { | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
454 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].width; |
9563 | 455 } |
456 | |
457 int | |
458 x_bitmap_pixmap (f, id) | |
459 FRAME_PTR f; | |
460 int id; | |
461 { | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
462 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap; |
9563 | 463 } |
464 | |
465 | |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
466 /* Allocate a new bitmap record. Returns index of new record. */ |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
467 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
468 static int |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
469 x_allocate_bitmap_record (f) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
470 FRAME_PTR f; |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
471 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
472 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
473 int i; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
474 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
475 if (dpyinfo->bitmaps == NULL) |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
476 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
477 dpyinfo->bitmaps_size = 10; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
478 dpyinfo->bitmaps |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
479 = (struct x_bitmap_record *) xmalloc (dpyinfo->bitmaps_size * sizeof (struct x_bitmap_record)); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
480 dpyinfo->bitmaps_last = 1; |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
481 return 1; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
482 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
483 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
484 if (dpyinfo->bitmaps_last < dpyinfo->bitmaps_size) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
485 return ++dpyinfo->bitmaps_last; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
486 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
487 for (i = 0; i < dpyinfo->bitmaps_size; ++i) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
488 if (dpyinfo->bitmaps[i].refcount == 0) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
489 return i + 1; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
490 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
491 dpyinfo->bitmaps_size *= 2; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
492 dpyinfo->bitmaps |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
493 = (struct x_bitmap_record *) xrealloc (dpyinfo->bitmaps, |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
494 dpyinfo->bitmaps_size * sizeof (struct x_bitmap_record)); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
495 return ++dpyinfo->bitmaps_last; |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
496 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
497 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
498 /* Add one reference to the reference count of the bitmap with id ID. */ |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
499 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
500 void |
9563 | 501 x_reference_bitmap (f, id) |
502 FRAME_PTR f; | |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
503 int id; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
504 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
505 ++FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].refcount; |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
506 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
507 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
508 /* Create a bitmap for frame F from a HEIGHT x WIDTH array of bits at BITS. */ |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
509 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
510 int |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
511 x_create_bitmap_from_data (f, bits, width, height) |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
512 struct frame *f; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
513 char *bits; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
514 unsigned int width, height; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
515 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
516 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
517 Pixmap bitmap; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
518 int id; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
519 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
520 bitmap = XCreateBitmapFromData (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
521 bits, width, height); |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
522 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
523 if (! bitmap) |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
524 return -1; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
525 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
526 id = x_allocate_bitmap_record (f); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
527 dpyinfo->bitmaps[id - 1].pixmap = bitmap; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
528 dpyinfo->bitmaps[id - 1].file = NULL; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
529 dpyinfo->bitmaps[id - 1].refcount = 1; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
530 dpyinfo->bitmaps[id - 1].depth = 1; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
531 dpyinfo->bitmaps[id - 1].height = height; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
532 dpyinfo->bitmaps[id - 1].width = width; |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
533 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
534 return id; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
535 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
536 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
537 /* Create bitmap from file FILE for frame F. */ |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
538 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
539 int |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
540 x_create_bitmap_from_file (f, file) |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
541 struct frame *f; |
9563 | 542 Lisp_Object file; |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
543 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
544 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
545 unsigned int width, height; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
546 Pixmap bitmap; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
547 int xhot, yhot, result, id; |
9563 | 548 Lisp_Object found; |
549 int fd; | |
550 char *filename; | |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
551 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
552 /* Look for an existing bitmap with the same name. */ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
553 for (id = 0; id < dpyinfo->bitmaps_last; ++id) |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
554 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
555 if (dpyinfo->bitmaps[id].refcount |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
556 && dpyinfo->bitmaps[id].file |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
557 && !strcmp (dpyinfo->bitmaps[id].file, (char *) XSTRING (file)->data)) |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
558 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
559 ++dpyinfo->bitmaps[id].refcount; |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
560 return id + 1; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
561 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
562 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
563 |
9563 | 564 /* Search bitmap-file-path for the file, if appropriate. */ |
565 fd = openp (Vx_bitmap_file_path, file, "", &found, 0); | |
566 if (fd < 0) | |
567 return -1; | |
568 close (fd); | |
569 | |
570 filename = (char *) XSTRING (found)->data; | |
571 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
572 result = XReadBitmapFile (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
9563 | 573 filename, &width, &height, &bitmap, &xhot, &yhot); |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
574 if (result != BitmapSuccess) |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
575 return -1; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
576 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
577 id = x_allocate_bitmap_record (f); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
578 dpyinfo->bitmaps[id - 1].pixmap = bitmap; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
579 dpyinfo->bitmaps[id - 1].refcount = 1; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
580 dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (XSTRING (file)->size + 1); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
581 dpyinfo->bitmaps[id - 1].depth = 1; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
582 dpyinfo->bitmaps[id - 1].height = height; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
583 dpyinfo->bitmaps[id - 1].width = width; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
584 strcpy (dpyinfo->bitmaps[id - 1].file, XSTRING (file)->data); |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
585 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
586 return id; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
587 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
588 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
589 /* Remove reference to bitmap with id number ID. */ |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
590 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
591 int |
9563 | 592 x_destroy_bitmap (f, id) |
593 FRAME_PTR f; | |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
594 int id; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
595 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
596 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
597 |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
598 if (id > 0) |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
599 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
600 --dpyinfo->bitmaps[id - 1].refcount; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
601 if (dpyinfo->bitmaps[id - 1].refcount == 0) |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
602 { |
12051
f193ce9efe24
(x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents:
12046
diff
changeset
|
603 BLOCK_INPUT; |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
604 XFreePixmap (FRAME_X_DISPLAY (f), dpyinfo->bitmaps[id - 1].pixmap); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
605 if (dpyinfo->bitmaps[id - 1].file) |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
606 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
607 free (dpyinfo->bitmaps[id - 1].file); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
608 dpyinfo->bitmaps[id - 1].file = NULL; |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
609 } |
12051
f193ce9efe24
(x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents:
12046
diff
changeset
|
610 UNBLOCK_INPUT; |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
611 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
612 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
613 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
614 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
615 /* Free all the bitmaps for the display specified by DPYINFO. */ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
616 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
617 static void |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
618 x_destroy_all_bitmaps (dpyinfo) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
619 struct x_display_info *dpyinfo; |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
620 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
621 int i; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
622 for (i = 0; i < dpyinfo->bitmaps_last; i++) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
623 if (dpyinfo->bitmaps[i].refcount > 0) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
624 { |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
625 XFreePixmap (dpyinfo->display, dpyinfo->bitmaps[i].pixmap); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
626 if (dpyinfo->bitmaps[i].file) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
627 free (dpyinfo->bitmaps[i].file); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
628 } |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
629 dpyinfo->bitmaps_last = 0; |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
630 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
631 |
771 | 632 /* Connect the frame-parameter names for X frames |
389 | 633 to the ways of passing the parameter values to the window system. |
634 | |
635 The name of a parameter, as a Lisp symbol, | |
771 | 636 has an `x-frame-parameter' property which is an integer in Lisp |
637 but can be interpreted as an `enum x_frame_parm' in C. */ | |
638 | |
639 enum x_frame_parm | |
389 | 640 { |
641 X_PARM_FOREGROUND_COLOR, | |
642 X_PARM_BACKGROUND_COLOR, | |
643 X_PARM_MOUSE_COLOR, | |
644 X_PARM_CURSOR_COLOR, | |
645 X_PARM_BORDER_COLOR, | |
646 X_PARM_ICON_TYPE, | |
647 X_PARM_FONT, | |
648 X_PARM_BORDER_WIDTH, | |
649 X_PARM_INTERNAL_BORDER_WIDTH, | |
650 X_PARM_NAME, | |
651 X_PARM_AUTORAISE, | |
652 X_PARM_AUTOLOWER, | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
653 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
|
654 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
|
655 X_PARM_MENU_BAR_LINES |
389 | 656 }; |
657 | |
658 | |
771 | 659 struct x_frame_parm_table |
389 | 660 { |
661 char *name; | |
771 | 662 void (*setter)( /* struct frame *frame, Lisp_Object val, oldval */ ); |
389 | 663 }; |
664 | |
665 void x_set_foreground_color (); | |
666 void x_set_background_color (); | |
667 void x_set_mouse_color (); | |
668 void x_set_cursor_color (); | |
669 void x_set_border_color (); | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
670 void x_set_cursor_type (); |
389 | 671 void x_set_icon_type (); |
12073 | 672 void x_set_icon_name (); |
389 | 673 void x_set_font (); |
674 void x_set_border_width (); | |
675 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
|
676 void x_explicitly_set_name (); |
389 | 677 void x_set_autoraise (); |
678 void x_set_autolower (); | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
679 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
|
680 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
|
681 void x_set_menu_bar_lines (); |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
682 void x_set_scroll_bar_width (); |
9580
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
683 void x_set_unsplittable (); |
389 | 684 |
771 | 685 static struct x_frame_parm_table x_frame_parms[] = |
389 | 686 { |
687 "foreground-color", x_set_foreground_color, | |
688 "background-color", x_set_background_color, | |
689 "mouse-color", x_set_mouse_color, | |
690 "cursor-color", x_set_cursor_color, | |
691 "border-color", x_set_border_color, | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
692 "cursor-type", x_set_cursor_type, |
389 | 693 "icon-type", x_set_icon_type, |
12073 | 694 "icon-name", x_set_icon_name, |
389 | 695 "font", x_set_font, |
696 "border-width", x_set_border_width, | |
697 "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
|
698 "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
|
699 "auto-raise", x_set_autoraise, |
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
700 "auto-lower", x_set_autolower, |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
701 "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
|
702 "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
|
703 "menu-bar-lines", x_set_menu_bar_lines, |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
704 "scroll-bar-width", x_set_scroll_bar_width, |
9580
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
705 "unsplittable", x_set_unsplittable, |
389 | 706 }; |
707 | |
771 | 708 /* Attach the `x-frame-parameter' properties to |
389 | 709 the Lisp symbol names of parameters relevant to X. */ |
710 | |
711 init_x_parm_symbols () | |
712 { | |
713 int i; | |
714 | |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
715 for (i = 0; i < sizeof (x_frame_parms) / sizeof (x_frame_parms[0]); i++) |
771 | 716 Fput (intern (x_frame_parms[i].name), Qx_frame_parameter, |
389 | 717 make_number (i)); |
718 } | |
719 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
720 /* 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
|
721 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
|
722 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
|
723 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
724 void |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
725 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
|
726 FRAME_PTR f; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
727 Lisp_Object alist; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
728 { |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
729 Lisp_Object tail; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
730 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
731 /* 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
|
732 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
|
733 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
|
734 Lisp_Object width, height; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
735 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
736 /* Same here. */ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
737 Lisp_Object left, top; |
3203
1055aa1b7547
* xfns.c (x_set_frame_parameters): Use the first
Jim Blandy <jimb@redhat.com>
parents:
3173
diff
changeset
|
738 |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
739 /* Same with these. */ |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
740 Lisp_Object icon_left, icon_top; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
741 |
3447
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
742 /* Record in these vectors all the parms specified. */ |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
743 Lisp_Object *parms; |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
744 Lisp_Object *values; |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
745 int i; |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
746 int left_no_change = 0, top_no_change = 0; |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
747 int icon_left_no_change = 0, icon_top_no_change = 0; |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
748 |
3447
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
749 i = 0; |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
750 for (tail = alist; CONSP (tail); tail = Fcdr (tail)) |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
751 i++; |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
752 |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
753 parms = (Lisp_Object *) alloca (i * sizeof (Lisp_Object)); |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
754 values = (Lisp_Object *) alloca (i * sizeof (Lisp_Object)); |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
755 |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
756 /* Extract parm names and values into those vectors. */ |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
757 |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
758 i = 0; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
759 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
|
760 { |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
761 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
|
762 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
763 elt = Fcar (tail); |
3447
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
764 parms[i] = Fcar (elt); |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
765 values[i] = Fcdr (elt); |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
766 i++; |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
767 } |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
768 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
769 width = height = top = left = Qunbound; |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
770 icon_left = icon_top = Qunbound; |
3447
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
771 |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
772 /* Now process them in reverse of specified order. */ |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
773 for (i--; i >= 0; i--) |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
774 { |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
775 Lisp_Object prop, val; |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
776 |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
777 prop = parms[i]; |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
778 val = values[i]; |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
779 |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
780 if (EQ (prop, Qwidth)) |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
781 width = val; |
3447
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
782 else if (EQ (prop, Qheight)) |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
783 height = val; |
3447
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
784 else if (EQ (prop, Qtop)) |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
785 top = val; |
3447
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
786 else if (EQ (prop, Qleft)) |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
787 left = val; |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
788 else if (EQ (prop, Qicon_top)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
789 icon_top = val; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
790 else if (EQ (prop, Qicon_left)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
791 icon_left = val; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
792 else |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
793 { |
6519
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
794 register Lisp_Object param_index, old_value; |
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
795 |
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
796 param_index = Fget (prop, Qx_frame_parameter); |
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
797 old_value = get_frame_param (f, prop); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
798 store_frame_param (f, prop, val); |
9956
cc76b76a1ed1
(CHECK_NATNUM): Use NATNUMP instead of its expansion.
Karl Heuer <kwzh@gnu.org>
parents:
9948
diff
changeset
|
799 if (NATNUMP (param_index) |
cc76b76a1ed1
(CHECK_NATNUM): Use NATNUMP instead of its expansion.
Karl Heuer <kwzh@gnu.org>
parents:
9948
diff
changeset
|
800 && (XFASTINT (param_index) |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
801 < sizeof (x_frame_parms)/sizeof (x_frame_parms[0]))) |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
802 (*x_frame_parms[XINT (param_index)].setter)(f, val, old_value); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
803 } |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
804 } |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
805 |
4617
807ba8bcc309
(x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents:
4606
diff
changeset
|
806 /* Don't die if just one of these was set. */ |
807ba8bcc309
(x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents:
4606
diff
changeset
|
807 if (EQ (left, Qunbound)) |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
808 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
809 left_no_change = 1; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
810 if (f->display.x->left_pos < 0) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
811 left = Fcons (Qplus, Fcons (make_number (f->display.x->left_pos), Qnil)); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
812 else |
9285
75f1c0d90b3d
(x_set_frame_parameters, x_set_visibility, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9240
diff
changeset
|
813 XSETINT (left, f->display.x->left_pos); |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
814 } |
4617
807ba8bcc309
(x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents:
4606
diff
changeset
|
815 if (EQ (top, Qunbound)) |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
816 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
817 top_no_change = 1; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
818 if (f->display.x->top_pos < 0) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
819 top = Fcons (Qplus, Fcons (make_number (f->display.x->top_pos), Qnil)); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
820 else |
9285
75f1c0d90b3d
(x_set_frame_parameters, x_set_visibility, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9240
diff
changeset
|
821 XSETINT (top, f->display.x->top_pos); |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
822 } |
4617
807ba8bcc309
(x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents:
4606
diff
changeset
|
823 |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
824 /* If one of the icon positions was not set, preserve or default it. */ |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
825 if (EQ (icon_left, Qunbound) || ! INTEGERP (icon_left)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
826 { |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
827 icon_left_no_change = 1; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
828 icon_left = Fcdr (Fassq (Qicon_left, f->param_alist)); |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
829 if (NILP (icon_left)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
830 XSETINT (icon_left, 0); |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
831 } |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
832 if (EQ (icon_top, Qunbound) || ! INTEGERP (icon_top)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
833 { |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
834 icon_top_no_change = 1; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
835 icon_top = Fcdr (Fassq (Qicon_top, f->param_alist)); |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
836 if (NILP (icon_top)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
837 XSETINT (icon_top, 0); |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
838 } |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
839 |
4617
807ba8bcc309
(x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents:
4606
diff
changeset
|
840 /* Don't die if just one of these was set. */ |
807ba8bcc309
(x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents:
4606
diff
changeset
|
841 if (EQ (width, Qunbound)) |
9285
75f1c0d90b3d
(x_set_frame_parameters, x_set_visibility, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9240
diff
changeset
|
842 XSETINT (width, FRAME_WIDTH (f)); |
4617
807ba8bcc309
(x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents:
4606
diff
changeset
|
843 if (EQ (height, Qunbound)) |
9285
75f1c0d90b3d
(x_set_frame_parameters, x_set_visibility, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9240
diff
changeset
|
844 XSETINT (height, FRAME_HEIGHT (f)); |
4617
807ba8bcc309
(x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents:
4606
diff
changeset
|
845 |
11932
f3fb1e5dfde1
(x_set_frame_parameters) Fix typo.
Karl Heuer <kwzh@gnu.org>
parents:
11917
diff
changeset
|
846 /* Don't set these parameters unless they've been explicitly |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
847 specified. The window might be mapped or resized while we're in |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
848 this function, and we don't want to override that unless the lisp |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
849 code has asked for it. |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
850 |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
851 Don't set these parameters unless they actually differ from the |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
852 window's current parameters; the window may not actually exist |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
853 yet. */ |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
854 { |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
855 Lisp_Object frame; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
856 |
5107
2a019dd8ed51
(x_set_frame_parameters): Call check_frame_size
Richard M. Stallman <rms@gnu.org>
parents:
4771
diff
changeset
|
857 check_frame_size (f, &height, &width); |
2a019dd8ed51
(x_set_frame_parameters): Call check_frame_size
Richard M. Stallman <rms@gnu.org>
parents:
4771
diff
changeset
|
858 |
9285
75f1c0d90b3d
(x_set_frame_parameters, x_set_visibility, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9240
diff
changeset
|
859 XSETFRAME (frame, f); |
4617
807ba8bcc309
(x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents:
4606
diff
changeset
|
860 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
861 if ((NUMBERP (width) && XINT (width) != FRAME_WIDTH (f)) |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
862 || (NUMBERP (height) && XINT (height) != FRAME_HEIGHT (f))) |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
863 Fset_frame_size (frame, width, height); |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
864 |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
865 if ((!NILP (left) || !NILP (top)) |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
866 && ! (left_no_change && top_no_change) |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
867 && ! (NUMBERP (left) && XINT (left) == f->display.x->left_pos |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
868 && NUMBERP (top) && XINT (top) == f->display.x->top_pos)) |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
869 { |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
870 int leftpos = 0; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
871 int toppos = 0; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
872 |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
873 /* Record the signs. */ |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
874 f->display.x->size_hint_flags &= ~ (XNegative | YNegative); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
875 if (EQ (left, Qminus)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
876 f->display.x->size_hint_flags |= XNegative; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
877 else if (INTEGERP (left)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
878 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
879 leftpos = XINT (left); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
880 if (leftpos < 0) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
881 f->display.x->size_hint_flags |= XNegative; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
882 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
883 else if (CONSP (left) && EQ (XCONS (left)->car, Qminus) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
884 && CONSP (XCONS (left)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
885 && INTEGERP (XCONS (XCONS (left)->cdr)->car)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
886 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
887 leftpos = - XINT (XCONS (XCONS (left)->cdr)->car); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
888 f->display.x->size_hint_flags |= XNegative; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
889 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
890 else if (CONSP (left) && EQ (XCONS (left)->car, Qplus) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
891 && CONSP (XCONS (left)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
892 && INTEGERP (XCONS (XCONS (left)->cdr)->car)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
893 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
894 leftpos = XINT (XCONS (XCONS (left)->cdr)->car); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
895 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
896 |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
897 if (EQ (top, Qminus)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
898 f->display.x->size_hint_flags |= YNegative; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
899 else if (INTEGERP (top)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
900 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
901 toppos = XINT (top); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
902 if (toppos < 0) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
903 f->display.x->size_hint_flags |= YNegative; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
904 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
905 else if (CONSP (top) && EQ (XCONS (top)->car, Qminus) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
906 && CONSP (XCONS (top)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
907 && INTEGERP (XCONS (XCONS (top)->cdr)->car)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
908 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
909 toppos = - XINT (XCONS (XCONS (top)->cdr)->car); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
910 f->display.x->size_hint_flags |= YNegative; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
911 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
912 else if (CONSP (top) && EQ (XCONS (top)->car, Qplus) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
913 && CONSP (XCONS (top)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
914 && INTEGERP (XCONS (XCONS (top)->cdr)->car)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
915 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
916 toppos = XINT (XCONS (XCONS (top)->cdr)->car); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
917 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
918 |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
919 |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
920 /* Store the numeric value of the position. */ |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
921 f->display.x->top_pos = toppos; |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
922 f->display.x->left_pos = leftpos; |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
923 |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
924 f->display.x->win_gravity = NorthWestGravity; |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
925 |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
926 /* Actually set that position, and convert to absolute. */ |
11989
0deb4505c0f0
(x_set_frame_parameters): Pass -1 to x_set_offset.
Karl Heuer <kwzh@gnu.org>
parents:
11986
diff
changeset
|
927 x_set_offset (f, leftpos, toppos, -1); |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
928 } |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
929 |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
930 if ((!NILP (icon_left) || !NILP (icon_top)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
931 && ! (icon_left_no_change && icon_top_no_change)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
932 x_wm_set_icon_position (f, XINT (icon_left), XINT (icon_top)); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
933 } |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
934 } |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
935 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
936 /* Store the screen positions of frame F into XPTR and YPTR. |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
937 These are the positions of the containing window manager window, |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
938 not Emacs's own window. */ |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
939 |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
940 void |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
941 x_real_positions (f, xptr, yptr) |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
942 FRAME_PTR f; |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
943 int *xptr, *yptr; |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
944 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
945 int win_x, win_y; |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
946 Window child; |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
947 |
7946
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
948 /* This is pretty gross, but seems to be the easiest way out of |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
949 the problem that arises when restarting window-managers. */ |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
950 |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
951 #ifdef USE_X_TOOLKIT |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
952 Window outer = XtWindow (f->display.x->widget); |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
953 #else |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
954 Window outer = f->display.x->window_desc; |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
955 #endif |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
956 Window tmp_root_window; |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
957 Window *tmp_children; |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
958 int tmp_nchildren; |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
959 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
960 while (1) |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
961 { |
12111
832023e90d4d
(x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents:
12094
diff
changeset
|
962 x_catch_errors (FRAME_X_DISPLAY (f)); |
832023e90d4d
(x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents:
12094
diff
changeset
|
963 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
964 XQueryTree (FRAME_X_DISPLAY (f), outer, &tmp_root_window, |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
965 &f->display.x->parent_desc, |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
966 &tmp_children, &tmp_nchildren); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
967 xfree (tmp_children); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
968 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
969 win_x = win_y = 0; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
970 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
971 /* Find the position of the outside upper-left corner of |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
972 the inner window, with respect to the outer window. */ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
973 if (f->display.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
974 { |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
975 XTranslateCoordinates (FRAME_X_DISPLAY (f), |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
976 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
977 /* From-window, to-window. */ |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
978 #ifdef USE_X_TOOLKIT |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
979 XtWindow (f->display.x->widget), |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
980 #else |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
981 f->display.x->window_desc, |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
982 #endif |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
983 f->display.x->parent_desc, |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
984 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
985 /* From-position, to-position. */ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
986 0, 0, &win_x, &win_y, |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
987 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
988 /* Child of win. */ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
989 &child); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
990 |
11900
54186a96c5b2
(x_set_frame_parameters): Pass 1 as change_gravity
Karl Heuer <kwzh@gnu.org>
parents:
11897
diff
changeset
|
991 #if 0 /* The values seem to be right without this and wrong with. */ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
992 win_x += f->display.x->border_width; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
993 win_y += f->display.x->border_width; |
11900
54186a96c5b2
(x_set_frame_parameters): Pass 1 as change_gravity
Karl Heuer <kwzh@gnu.org>
parents:
11897
diff
changeset
|
994 #endif |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
995 } |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
996 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
997 /* It is possible for the window returned by the XQueryNotify |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
998 to become invalid by the time we call XTranslateCoordinates. |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
999 That can happen when you restart some window managers. |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
1000 If so, we get an error in XTranslateCoordinates. |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
1001 Detect that and try the whole thing over. */ |
9703
85ac0e4030d4
(x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents:
9690
diff
changeset
|
1002 if (! x_had_errors_p (FRAME_X_DISPLAY (f))) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
1003 break; |
12111
832023e90d4d
(x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents:
12094
diff
changeset
|
1004 |
832023e90d4d
(x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents:
12094
diff
changeset
|
1005 x_uncatch_errors (FRAME_X_DISPLAY (f)); |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
1006 } |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
1007 |
9703
85ac0e4030d4
(x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents:
9690
diff
changeset
|
1008 x_uncatch_errors (FRAME_X_DISPLAY (f)); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
1009 |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
1010 *xptr = f->display.x->left_pos - win_x; |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
1011 *yptr = f->display.x->top_pos - win_y; |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
1012 } |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
1013 |
771 | 1014 /* Insert a description of internally-recorded parameters of frame X |
389 | 1015 into the parameter alist *ALISTPTR that is to be given to the user. |
1016 Only parameters that are specific to the X window system | |
771 | 1017 and whose values are not correctly recorded in the frame's |
389 | 1018 param_alist need to be considered here. */ |
1019 | |
771 | 1020 x_report_frame_params (f, alistptr) |
1021 struct frame *f; | |
389 | 1022 Lisp_Object *alistptr; |
1023 { | |
1024 char buf[16]; | |
11986
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1025 Lisp_Object tem; |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1026 |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1027 /* Represent negative positions (off the top or left screen edge) |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1028 in a way that Fmodify_frame_parameters will understand correctly. */ |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1029 XSETINT (tem, f->display.x->left_pos); |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1030 if (f->display.x->left_pos >= 0) |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1031 store_in_alist (alistptr, Qleft, tem); |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1032 else |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1033 store_in_alist (alistptr, Qleft, Fcons (Qplus, Fcons (tem, Qnil))); |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1034 |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1035 XSETINT (tem, f->display.x->top_pos); |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1036 if (f->display.x->top_pos >= 0) |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1037 store_in_alist (alistptr, Qtop, tem); |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1038 else |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1039 store_in_alist (alistptr, Qtop, Fcons (Qplus, Fcons (tem, Qnil))); |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1040 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1041 store_in_alist (alistptr, Qborder_width, |
771 | 1042 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
|
1043 store_in_alist (alistptr, Qinternal_border_width, |
771 | 1044 make_number (f->display.x->internal_border_width)); |
9182
516fdeee89d6
(x_report_frame_params): Fix format/arg mismatch.
Karl Heuer <kwzh@gnu.org>
parents:
9166
diff
changeset
|
1045 sprintf (buf, "%ld", (long) 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
|
1046 store_in_alist (alistptr, Qwindow_id, |
389 | 1047 build_string (buf)); |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
1048 store_in_alist (alistptr, Qicon_name, f->icon_name); |
6522
eecaa7b19b6c
(x_report_frame_params): Sample visibility.
Karl Heuer <kwzh@gnu.org>
parents:
6519
diff
changeset
|
1049 FRAME_SAMPLE_VISIBILITY (f); |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1050 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
|
1051 (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
|
1052 : FRAME_ICONIFIED_P (f) ? Qicon : Qnil)); |
11483
089f81a81ba6
(x_report_frame_params): Report value of `display' parm.
Richard M. Stallman <rms@gnu.org>
parents:
11417
diff
changeset
|
1053 store_in_alist (alistptr, Qdisplay, |
089f81a81ba6
(x_report_frame_params): Report value of `display' parm.
Richard M. Stallman <rms@gnu.org>
parents:
11417
diff
changeset
|
1054 XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->car); |
389 | 1055 } |
1056 | |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1057 |
8675
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
1058 /* Decide if color named COLOR is valid for the display associated with |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
1059 the selected frame; if so, return the rgb values in COLOR_DEF. |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
1060 If ALLOC is nonzero, allocate a new colormap cell. */ |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
1061 |
389 | 1062 int |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1063 defined_color (f, color, color_def, alloc) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1064 FRAME_PTR f; |
389 | 1065 char *color; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1066 XColor *color_def; |
8675
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
1067 int alloc; |
389 | 1068 { |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1069 register int status; |
389 | 1070 Colormap screen_colormap; |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1071 Display *display = FRAME_X_DISPLAY (f); |
389 | 1072 |
1073 BLOCK_INPUT; | |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1074 screen_colormap = DefaultColormap (display, XDefaultScreen (display)); |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1075 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1076 status = XParseColor (display, screen_colormap, color, color_def); |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1077 if (status && alloc) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1078 { |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1079 status = XAllocColor (display, screen_colormap, color_def); |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1080 if (!status) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1081 { |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1082 /* If we got to this point, the colormap is full, so we're |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1083 going to try and get the next closest color. |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1084 The algorithm used is a least-squares matching, which is |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1085 what X uses for closest color matching with StaticColor visuals. */ |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1086 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1087 XColor *cells; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1088 int no_cells; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1089 int nearest; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1090 long nearest_delta, trial_delta; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1091 int x; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1092 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1093 no_cells = XDisplayCells (display, XDefaultScreen (display)); |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1094 cells = (XColor *) alloca (sizeof (XColor) * no_cells); |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1095 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1096 for (x = 0; x < no_cells; x++) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1097 cells[x].pixel = x; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1098 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1099 XQueryColors (display, screen_colormap, cells, no_cells); |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1100 nearest = 0; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1101 /* I'm assuming CSE so I'm not going to condense this. */ |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1102 nearest_delta = ((((color_def->red >> 8) - (cells[0].red >> 8)) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1103 * ((color_def->red >> 8) - (cells[0].red >> 8))) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1104 + |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1105 (((color_def->green >> 8) - (cells[0].green >> 8)) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1106 * ((color_def->green >> 8) - (cells[0].green >> 8))) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1107 + |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1108 (((color_def->blue >> 8) - (cells[0].blue >> 8)) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1109 * ((color_def->blue >> 8) - (cells[0].blue >> 8)))); |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1110 for (x = 1; x < no_cells; x++) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1111 { |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1112 trial_delta = ((((color_def->red >> 8) - (cells[x].red >> 8)) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1113 * ((color_def->red >> 8) - (cells[x].red >> 8))) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1114 + |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1115 (((color_def->green >> 8) - (cells[x].green >> 8)) |
11353
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1116 * ((color_def->green >> 8) - (cells[x].green >> 8))) |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1117 + |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1118 (((color_def->blue >> 8) - (cells[x].blue >> 8)) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1119 * ((color_def->blue >> 8) - (cells[x].blue >> 8)))); |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1120 if (trial_delta < nearest_delta) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1121 { |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1122 nearest = x; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1123 nearest_delta = trial_delta; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1124 } |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1125 } |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1126 color_def->red = cells[nearest].red; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1127 color_def->green = cells[nearest].green; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1128 color_def->blue = cells[nearest].blue; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1129 status = XAllocColor (display, screen_colormap, color_def); |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1130 } |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1131 } |
389 | 1132 UNBLOCK_INPUT; |
1133 | |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1134 if (status) |
389 | 1135 return 1; |
1136 else | |
1137 return 0; | |
1138 } | |
1139 | |
1140 /* Given a string ARG naming a color, compute a pixel value from it | |
771 | 1141 suitable for screen F. |
1142 If F is not a color screen, return DEF (default) regardless of what | |
389 | 1143 ARG says. */ |
1144 | |
1145 int | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1146 x_decode_color (f, arg, def) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1147 FRAME_PTR f; |
389 | 1148 Lisp_Object arg; |
1149 int def; | |
1150 { | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1151 XColor cdef; |
389 | 1152 |
1153 CHECK_STRING (arg, 0); | |
1154 | |
1155 if (strcmp (XSTRING (arg)->data, "black") == 0) | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1156 return BLACK_PIX_DEFAULT (f); |
389 | 1157 else if (strcmp (XSTRING (arg)->data, "white") == 0) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1158 return WHITE_PIX_DEFAULT (f); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1159 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1160 if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1) |
389 | 1161 return def; |
1162 | |
11060
0a7048d331e6
(x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents:
11014
diff
changeset
|
1163 /* defined_color is responsible for coping with failures |
0a7048d331e6
(x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents:
11014
diff
changeset
|
1164 by looking for a near-miss. */ |
0a7048d331e6
(x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents:
11014
diff
changeset
|
1165 if (defined_color (f, XSTRING (arg)->data, &cdef, 1)) |
0a7048d331e6
(x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents:
11014
diff
changeset
|
1166 return cdef.pixel; |
0a7048d331e6
(x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents:
11014
diff
changeset
|
1167 |
0a7048d331e6
(x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents:
11014
diff
changeset
|
1168 /* defined_color failed; return an ultimate default. */ |
0a7048d331e6
(x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents:
11014
diff
changeset
|
1169 return def; |
389 | 1170 } |
1171 | |
771 | 1172 /* Functions called only from `x_set_frame_param' |
389 | 1173 to set individual parameters. |
1174 | |
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
|
1175 If FRAME_X_WINDOW (f) is 0, |
771 | 1176 the frame is being created and its X-window does not exist yet. |
389 | 1177 In that case, just record the parameter's new value |
1178 in the standard place; do not attempt to change the window. */ | |
1179 | |
1180 void | |
771 | 1181 x_set_foreground_color (f, arg, oldval) |
1182 struct frame *f; | |
389 | 1183 Lisp_Object arg, oldval; |
1184 { | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1185 f->display.x->foreground_pixel |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1186 = x_decode_color (f, arg, BLACK_PIX_DEFAULT (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
|
1187 if (FRAME_X_WINDOW (f) != 0) |
389 | 1188 { |
1189 BLOCK_INPUT; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1190 XSetForeground (FRAME_X_DISPLAY (f), f->display.x->normal_gc, |
771 | 1191 f->display.x->foreground_pixel); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1192 XSetBackground (FRAME_X_DISPLAY (f), f->display.x->reverse_gc, |
771 | 1193 f->display.x->foreground_pixel); |
389 | 1194 UNBLOCK_INPUT; |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1195 recompute_basic_faces (f); |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1196 if (FRAME_VISIBLE_P (f)) |
771 | 1197 redraw_frame (f); |
389 | 1198 } |
1199 } | |
1200 | |
1201 void | |
771 | 1202 x_set_background_color (f, arg, oldval) |
1203 struct frame *f; | |
389 | 1204 Lisp_Object arg, oldval; |
1205 { | |
1206 Pixmap temp; | |
1207 int mask; | |
1208 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1209 f->display.x->background_pixel |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1210 = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); |
771 | 1211 |
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
|
1212 if (FRAME_X_WINDOW (f) != 0) |
389 | 1213 { |
1214 BLOCK_INPUT; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1215 /* The main frame area. */ |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1216 XSetBackground (FRAME_X_DISPLAY (f), f->display.x->normal_gc, |
771 | 1217 f->display.x->background_pixel); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1218 XSetForeground (FRAME_X_DISPLAY (f), f->display.x->reverse_gc, |
771 | 1219 f->display.x->background_pixel); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1220 XSetForeground (FRAME_X_DISPLAY (f), f->display.x->cursor_gc, |
4359
7aae955c725b
* xfns.c (x_set_background_color): Change the foreground color of
Jim Blandy <jimb@redhat.com>
parents:
4348
diff
changeset
|
1221 f->display.x->background_pixel); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1222 XSetWindowBackground (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
771 | 1223 f->display.x->background_pixel); |
7599
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1224 { |
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1225 Lisp_Object bar; |
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1226 for (bar = FRAME_SCROLL_BARS (f); !NILP (bar); |
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1227 bar = XSCROLL_BAR (bar)->next) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1228 XSetWindowBackground (FRAME_X_DISPLAY (f), |
7599
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1229 SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)), |
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1230 f->display.x->background_pixel); |
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1231 } |
389 | 1232 UNBLOCK_INPUT; |
1233 | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1234 recompute_basic_faces (f); |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1235 |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1236 if (FRAME_VISIBLE_P (f)) |
771 | 1237 redraw_frame (f); |
389 | 1238 } |
1239 } | |
1240 | |
1241 void | |
771 | 1242 x_set_mouse_color (f, arg, oldval) |
1243 struct frame *f; | |
389 | 1244 Lisp_Object arg, oldval; |
1245 { | |
6759
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
1246 Cursor cursor, nontext_cursor, mode_cursor, cross_cursor; |
389 | 1247 int mask_color; |
1248 | |
1249 if (!EQ (Qnil, arg)) | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1250 f->display.x->mouse_pixel |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1251 = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
771 | 1252 mask_color = f->display.x->background_pixel; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1253 /* No invisible pointers. */ |
771 | 1254 if (mask_color == f->display.x->mouse_pixel |
1255 && mask_color == f->display.x->background_pixel) | |
1256 f->display.x->mouse_pixel = f->display.x->foreground_pixel; | |
389 | 1257 |
1258 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
|
1259 |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3512
diff
changeset
|
1260 /* It's not okay to crash if the user selects a screwy cursor. */ |
9703
85ac0e4030d4
(x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents:
9690
diff
changeset
|
1261 x_catch_errors (FRAME_X_DISPLAY (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
|
1262 |
389 | 1263 if (!EQ (Qnil, Vx_pointer_shape)) |
1264 { | |
1265 CHECK_NUMBER (Vx_pointer_shape, 0); | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1266 cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XINT (Vx_pointer_shape)); |
389 | 1267 } |
1268 else | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1269 cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_xterm); |
9703
85ac0e4030d4
(x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents:
9690
diff
changeset
|
1270 x_check_errors (FRAME_X_DISPLAY (f), "bad text pointer cursor: %s"); |
389 | 1271 |
1272 if (!EQ (Qnil, Vx_nontext_pointer_shape)) | |
1273 { | |
1274 CHECK_NUMBER (Vx_nontext_pointer_shape, 0); | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1275 nontext_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), |
389 | 1276 XINT (Vx_nontext_pointer_shape)); |
1277 } | |
1278 else | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1279 nontext_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_left_ptr); |
9703
85ac0e4030d4
(x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents:
9690
diff
changeset
|
1280 x_check_errors (FRAME_X_DISPLAY (f), "bad nontext pointer cursor: %s"); |
389 | 1281 |
1282 if (!EQ (Qnil, Vx_mode_pointer_shape)) | |
1283 { | |
1284 CHECK_NUMBER (Vx_mode_pointer_shape, 0); | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1285 mode_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1286 XINT (Vx_mode_pointer_shape)); |
389 | 1287 } |
1288 else | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1289 mode_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_xterm); |
9703
85ac0e4030d4
(x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents:
9690
diff
changeset
|
1290 x_check_errors (FRAME_X_DISPLAY (f), "bad modeline pointer cursor: %s"); |
6759
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
1291 |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
1292 if (!EQ (Qnil, Vx_sensitive_text_pointer_shape)) |
6759
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
1293 { |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
1294 CHECK_NUMBER (Vx_sensitive_text_pointer_shape, 0); |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
1295 cross_cursor |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1296 = XCreateFontCursor (FRAME_X_DISPLAY (f), |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
1297 XINT (Vx_sensitive_text_pointer_shape)); |
6759
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
1298 } |
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
1299 else |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1300 cross_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_crosshair); |
389 | 1301 |
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
|
1302 /* Check and report errors with the above calls. */ |
9703
85ac0e4030d4
(x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents:
9690
diff
changeset
|
1303 x_check_errors (FRAME_X_DISPLAY (f), "can't set cursor shape: %s"); |
85ac0e4030d4
(x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents:
9690
diff
changeset
|
1304 x_uncatch_errors (FRAME_X_DISPLAY (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
|
1305 |
389 | 1306 { |
1307 XColor fore_color, back_color; | |
1308 | |
771 | 1309 fore_color.pixel = f->display.x->mouse_pixel; |
389 | 1310 back_color.pixel = mask_color; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1311 XQueryColor (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1312 DefaultColormap (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1313 DefaultScreen (FRAME_X_DISPLAY (f))), |
389 | 1314 &fore_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1315 XQueryColor (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1316 DefaultColormap (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1317 DefaultScreen (FRAME_X_DISPLAY (f))), |
389 | 1318 &back_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1319 XRecolorCursor (FRAME_X_DISPLAY (f), cursor, |
389 | 1320 &fore_color, &back_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1321 XRecolorCursor (FRAME_X_DISPLAY (f), nontext_cursor, |
389 | 1322 &fore_color, &back_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1323 XRecolorCursor (FRAME_X_DISPLAY (f), mode_cursor, |
389 | 1324 &fore_color, &back_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1325 XRecolorCursor (FRAME_X_DISPLAY (f), cross_cursor, |
6759
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
1326 &fore_color, &back_color); |
389 | 1327 } |
1328 | |
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
|
1329 if (FRAME_X_WINDOW (f) != 0) |
389 | 1330 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1331 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor); |
389 | 1332 } |
1333 | |
771 | 1334 if (cursor != f->display.x->text_cursor && f->display.x->text_cursor != 0) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1335 XFreeCursor (FRAME_X_DISPLAY (f), f->display.x->text_cursor); |
771 | 1336 f->display.x->text_cursor = cursor; |
8782
51241477cfc5
Delete X11 conditionals.
Richard M. Stallman <rms@gnu.org>
parents:
8780
diff
changeset
|
1337 |
771 | 1338 if (nontext_cursor != f->display.x->nontext_cursor |
1339 && f->display.x->nontext_cursor != 0) | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1340 XFreeCursor (FRAME_X_DISPLAY (f), f->display.x->nontext_cursor); |
771 | 1341 f->display.x->nontext_cursor = nontext_cursor; |
1342 | |
1343 if (mode_cursor != f->display.x->modeline_cursor | |
1344 && f->display.x->modeline_cursor != 0) | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1345 XFreeCursor (FRAME_X_DISPLAY (f), f->display.x->modeline_cursor); |
771 | 1346 f->display.x->modeline_cursor = mode_cursor; |
6759
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
1347 if (cross_cursor != f->display.x->cross_cursor |
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
1348 && f->display.x->cross_cursor != 0) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1349 XFreeCursor (FRAME_X_DISPLAY (f), f->display.x->cross_cursor); |
6759
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
1350 f->display.x->cross_cursor = cross_cursor; |
389 | 1351 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1352 XFlush (FRAME_X_DISPLAY (f)); |
389 | 1353 UNBLOCK_INPUT; |
1354 } | |
1355 | |
1356 void | |
771 | 1357 x_set_cursor_color (f, arg, oldval) |
1358 struct frame *f; | |
389 | 1359 Lisp_Object arg, oldval; |
1360 { | |
1361 unsigned long fore_pixel; | |
1362 | |
1363 if (!EQ (Vx_cursor_fore_pixel, Qnil)) | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1364 fore_pixel = x_decode_color (f, Vx_cursor_fore_pixel, |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1365 WHITE_PIX_DEFAULT (f)); |
389 | 1366 else |
771 | 1367 fore_pixel = f->display.x->background_pixel; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1368 f->display.x->cursor_pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1369 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1370 /* Make sure that the cursor color differs from the background color. */ |
771 | 1371 if (f->display.x->cursor_pixel == f->display.x->background_pixel) |
389 | 1372 { |
7308
7ad4cc8f0a92
(x_set_cursor_color): Fix typo.
Richard M. Stallman <rms@gnu.org>
parents:
7307
diff
changeset
|
1373 f->display.x->cursor_pixel = f->display.x->mouse_pixel; |
771 | 1374 if (f->display.x->cursor_pixel == fore_pixel) |
1375 fore_pixel = f->display.x->background_pixel; | |
389 | 1376 } |
2842
b002f2c288d3
(x_set_cursor_color): Set cursor_foreground_pixel.
Richard M. Stallman <rms@gnu.org>
parents:
2738
diff
changeset
|
1377 f->display.x->cursor_foreground_pixel = fore_pixel; |
389 | 1378 |
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
|
1379 if (FRAME_X_WINDOW (f) != 0) |
389 | 1380 { |
1381 BLOCK_INPUT; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1382 XSetBackground (FRAME_X_DISPLAY (f), f->display.x->cursor_gc, |
771 | 1383 f->display.x->cursor_pixel); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1384 XSetForeground (FRAME_X_DISPLAY (f), f->display.x->cursor_gc, |
389 | 1385 fore_pixel); |
1386 UNBLOCK_INPUT; | |
1387 | |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1388 if (FRAME_VISIBLE_P (f)) |
389 | 1389 { |
771 | 1390 x_display_cursor (f, 0); |
1391 x_display_cursor (f, 1); | |
389 | 1392 } |
1393 } | |
1394 } | |
1395 | |
771 | 1396 /* Set the border-color of frame F to value described by ARG. |
389 | 1397 ARG can be a string naming a color. |
1398 The border-color is used for the border that is drawn by the X server. | |
1399 Note that this does not fully take effect if done before | |
771 | 1400 F has an x-window; it must be redone when the window is created. |
389 | 1401 |
1402 Note: this is done in two routines because of the way X10 works. | |
1403 | |
1404 Note: under X11, this is normally the province of the window manager, | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1405 and so emacs' border colors may be overridden. */ |
389 | 1406 |
1407 void | |
771 | 1408 x_set_border_color (f, arg, oldval) |
1409 struct frame *f; | |
389 | 1410 Lisp_Object arg, oldval; |
1411 { | |
1412 unsigned char *str; | |
1413 int pix; | |
1414 | |
1415 CHECK_STRING (arg, 0); | |
1416 str = XSTRING (arg)->data; | |
1417 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1418 pix = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
389 | 1419 |
771 | 1420 x_set_border_pixel (f, pix); |
389 | 1421 } |
1422 | |
771 | 1423 /* Set the border-color of frame F to pixel value PIX. |
389 | 1424 Note that this does not fully take effect if done before |
771 | 1425 F has an x-window. */ |
1426 | |
1427 x_set_border_pixel (f, pix) | |
1428 struct frame *f; | |
389 | 1429 int pix; |
1430 { | |
771 | 1431 f->display.x->border_pixel = pix; |
1432 | |
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
|
1433 if (FRAME_X_WINDOW (f) != 0 && f->display.x->border_width > 0) |
389 | 1434 { |
1435 Pixmap temp; | |
1436 int mask; | |
1437 | |
1438 BLOCK_INPUT; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1439 XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
11882
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
1440 (unsigned long)pix); |
389 | 1441 UNBLOCK_INPUT; |
1442 | |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1443 if (FRAME_VISIBLE_P (f)) |
771 | 1444 redraw_frame (f); |
389 | 1445 } |
1446 } | |
1447 | |
1448 void | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1449 x_set_cursor_type (f, arg, oldval) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1450 FRAME_PTR f; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1451 Lisp_Object arg, oldval; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1452 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1453 if (EQ (arg, Qbar)) |
10742
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1454 { |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1455 FRAME_DESIRED_CURSOR (f) = bar_cursor; |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1456 f->display.x->cursor_width = 2; |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1457 } |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1458 else if (CONSP (arg) && EQ (XCONS (arg)->car, Qbar) |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1459 && INTEGERP (XCONS (arg)->cdr)) |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1460 { |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1461 FRAME_DESIRED_CURSOR (f) = bar_cursor; |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1462 f->display.x->cursor_width = XINT (XCONS (arg)->cdr); |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1463 } |
3134
efdaaa695ad4
(x_set_cursor_type): If arg not recognized, use box cursor.
Richard M. Stallman <rms@gnu.org>
parents:
3108
diff
changeset
|
1464 else |
10742
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1465 /* Treat anything unknown as "box cursor". |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1466 It was bad to signal an error; people have trouble fixing |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1467 .Xdefaults with Emacs, when it has something bad in it. */ |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1468 FRAME_DESIRED_CURSOR (f) = filled_box_cursor; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1469 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1470 /* 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
|
1471 often do people change cursor types? */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1472 update_mode_lines++; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1473 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1474 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1475 void |
771 | 1476 x_set_icon_type (f, arg, oldval) |
1477 struct frame *f; | |
389 | 1478 Lisp_Object arg, oldval; |
1479 { | |
1480 Lisp_Object tem; | |
1481 int result; | |
1482 | |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1483 if (STRINGP (arg)) |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1484 { |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1485 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1486 return; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1487 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1488 else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil)) |
389 | 1489 return; |
1490 | |
1491 BLOCK_INPUT; | |
485 | 1492 if (NILP (arg)) |
12073 | 1493 result = x_text_icon (f, |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
1494 (char *) XSTRING ((!NILP (f->icon_name) |
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
1495 ? f->icon_name |
12073 | 1496 : f->name))->data); |
9563 | 1497 else |
1498 result = x_bitmap_icon (f, arg); | |
389 | 1499 |
1500 if (result) | |
1501 { | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1502 UNBLOCK_INPUT; |
9353
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1503 error ("No icon window available"); |
389 | 1504 } |
1505 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1506 XFlush (FRAME_X_DISPLAY (f)); |
389 | 1507 UNBLOCK_INPUT; |
1508 } | |
1509 | |
9563 | 1510 /* Return non-nil if frame F wants a bitmap icon. */ |
1511 | |
1512 Lisp_Object | |
9353
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1513 x_icon_type (f) |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1514 FRAME_PTR f; |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1515 { |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1516 Lisp_Object tem; |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1517 |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1518 tem = assq_no_quit (Qicon_type, f->param_alist); |
9563 | 1519 if (CONSP (tem)) |
1520 return XCONS (tem)->cdr; | |
1521 else | |
1522 return Qnil; | |
9353
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1523 } |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1524 |
12073 | 1525 void |
1526 x_set_icon_name (f, arg, oldval) | |
1527 struct frame *f; | |
1528 Lisp_Object arg, oldval; | |
1529 { | |
1530 Lisp_Object tem; | |
1531 int result; | |
1532 | |
1533 if (STRINGP (arg)) | |
1534 { | |
1535 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) | |
1536 return; | |
1537 } | |
1538 else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil)) | |
1539 return; | |
1540 | |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
1541 f->icon_name = arg; |
12073 | 1542 |
1543 if (f->display.x->icon_bitmap != 0) | |
1544 return; | |
1545 | |
1546 BLOCK_INPUT; | |
1547 | |
1548 result = x_text_icon (f, | |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
1549 (char *) XSTRING ((!NILP (f->icon_name) |
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
1550 ? f->icon_name |
12073 | 1551 : f->name))->data); |
1552 | |
1553 if (result) | |
1554 { | |
1555 UNBLOCK_INPUT; | |
1556 error ("No icon window available"); | |
1557 } | |
1558 | |
1559 XFlush (FRAME_X_DISPLAY (f)); | |
1560 UNBLOCK_INPUT; | |
1561 } | |
1562 | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1563 extern Lisp_Object x_new_font (); |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1564 |
389 | 1565 void |
771 | 1566 x_set_font (f, arg, oldval) |
1567 struct frame *f; | |
389 | 1568 Lisp_Object arg, oldval; |
1569 { | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1570 Lisp_Object result; |
389 | 1571 |
1572 CHECK_STRING (arg, 1); | |
1573 | |
1574 BLOCK_INPUT; | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1575 result = x_new_font (f, XSTRING (arg)->data); |
389 | 1576 UNBLOCK_INPUT; |
1577 | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1578 if (EQ (result, Qnil)) |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1579 error ("Font \"%s\" is not defined", XSTRING (arg)->data); |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1580 else if (EQ (result, Qt)) |
3015
fac66d9828d7
* xterm.c (x_new_font): Reject fonts with varying spacing. We
Jim Blandy <jimb@redhat.com>
parents:
2999
diff
changeset
|
1581 error ("the characters of the given font have varying widths"); |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1582 else if (STRINGP (result)) |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1583 { |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1584 recompute_basic_faces (f); |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1585 store_frame_param (f, Qfont, result); |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1586 } |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1587 else |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1588 abort (); |
389 | 1589 } |
1590 | |
1591 void | |
771 | 1592 x_set_border_width (f, arg, oldval) |
1593 struct frame *f; | |
389 | 1594 Lisp_Object arg, oldval; |
1595 { | |
1596 CHECK_NUMBER (arg, 0); | |
1597 | |
771 | 1598 if (XINT (arg) == f->display.x->border_width) |
389 | 1599 return; |
1600 | |
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
|
1601 if (FRAME_X_WINDOW (f) != 0) |
389 | 1602 error ("Cannot change the border width of a window"); |
1603 | |
771 | 1604 f->display.x->border_width = XINT (arg); |
389 | 1605 } |
1606 | |
1607 void | |
771 | 1608 x_set_internal_border_width (f, arg, oldval) |
1609 struct frame *f; | |
389 | 1610 Lisp_Object arg, oldval; |
1611 { | |
1612 int mask; | |
771 | 1613 int old = f->display.x->internal_border_width; |
389 | 1614 |
1615 CHECK_NUMBER (arg, 0); | |
771 | 1616 f->display.x->internal_border_width = XINT (arg); |
1617 if (f->display.x->internal_border_width < 0) | |
1618 f->display.x->internal_border_width = 0; | |
1619 | |
1620 if (f->display.x->internal_border_width == old) | |
389 | 1621 return; |
1622 | |
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
|
1623 if (FRAME_X_WINDOW (f) != 0) |
389 | 1624 { |
1625 BLOCK_INPUT; | |
5899
4e8f26a0f2b7
*** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5721
diff
changeset
|
1626 x_set_window_size (f, 0, f->width, f->height); |
389 | 1627 #if 0 |
771 | 1628 x_set_resize_hint (f); |
389 | 1629 #endif |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1630 XFlush (FRAME_X_DISPLAY (f)); |
389 | 1631 UNBLOCK_INPUT; |
771 | 1632 SET_FRAME_GARBAGED (f); |
389 | 1633 } |
1634 } | |
1635 | |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1636 void |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1637 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
|
1638 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
|
1639 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
|
1640 { |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1641 Lisp_Object frame; |
9285
75f1c0d90b3d
(x_set_frame_parameters, x_set_visibility, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9240
diff
changeset
|
1642 XSETFRAME (frame, f); |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1643 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1644 if (NILP (value)) |
5899
4e8f26a0f2b7
*** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5721
diff
changeset
|
1645 Fmake_frame_invisible (frame, Qt); |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1646 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
|
1647 Ficonify_frame (frame); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1648 else |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1649 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
|
1650 } |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1651 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1652 static void |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1653 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
|
1654 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
|
1655 int n; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1656 { |
3477
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1657 struct window *w = XWINDOW (window); |
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1658 |
9329
4e1048594e7f
(x_set_menu_bar_lines_1): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents:
9327
diff
changeset
|
1659 XSETFASTINT (w->top, XFASTINT (w->top) + n); |
4e1048594e7f
(x_set_menu_bar_lines_1): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents:
9327
diff
changeset
|
1660 XSETFASTINT (w->height, XFASTINT (w->height) - n); |
3477
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1661 |
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1662 /* Handle just the top child in a vertical split. */ |
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1663 if (!NILP (w->vchild)) |
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1664 x_set_menu_bar_lines_1 (w->vchild, n); |
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1665 |
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1666 /* Adjust all children in a horizontal split. */ |
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1667 for (window = w->hchild; !NILP (window); window = w->next) |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1668 { |
3477
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1669 w = XWINDOW (window); |
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1670 x_set_menu_bar_lines_1 (window, n); |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1671 } |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1672 } |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1673 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1674 void |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1675 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
|
1676 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
|
1677 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
|
1678 { |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1679 int nlines; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1680 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
|
1681 |
2880
9a78169e44df
* xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents:
2842
diff
changeset
|
1682 /* Right now, menu bars don't work properly in minibuf-only frames; |
9a78169e44df
* xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents:
2842
diff
changeset
|
1683 most of the commands try to apply themselves to the minibuffer |
9a78169e44df
* xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents:
2842
diff
changeset
|
1684 frame itslef, and get an error because you can't switch buffers |
9a78169e44df
* xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents:
2842
diff
changeset
|
1685 in or split the minibuffer window. */ |
2885
cb1709f302e9
(x_set_menu_bar_lines): Fix typo in last change.
Richard M. Stallman <rms@gnu.org>
parents:
2880
diff
changeset
|
1686 if (FRAME_MINIBUF_ONLY_P (f)) |
2880
9a78169e44df
* xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents:
2842
diff
changeset
|
1687 return; |
9a78169e44df
* xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents:
2842
diff
changeset
|
1688 |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
1689 if (INTEGERP (value)) |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1690 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
|
1691 else |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1692 nlines = 0; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1693 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1694 #ifdef USE_X_TOOLKIT |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1695 FRAME_MENU_BAR_LINES (f) = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1696 if (nlines) |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1697 FRAME_EXTERNAL_MENU_BAR (f) = 1; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1698 else |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1699 { |
5900
284c0d70a50a
(x_set_menu_bar_lines) [USE_X_TOOLKIT]: Dont Call XtDestroyWidget but
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5899
diff
changeset
|
1700 if (FRAME_EXTERNAL_MENU_BAR (f) == 1) |
284c0d70a50a
(x_set_menu_bar_lines) [USE_X_TOOLKIT]: Dont Call XtDestroyWidget but
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5899
diff
changeset
|
1701 free_frame_menubar (f); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1702 FRAME_EXTERNAL_MENU_BAR (f) = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1703 f->display.x->menubar_widget = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1704 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1705 #else /* not USE_X_TOOLKIT */ |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1706 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
|
1707 x_set_menu_bar_lines_1 (f->root_window, nlines - olines); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1708 #endif /* not USE_X_TOOLKIT */ |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1709 } |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1710 |
4650 | 1711 /* Change the name of frame F to NAME. If NAME is nil, set F's name to |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1712 x_id_name. |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1713 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1714 If EXPLICIT is non-zero, that indicates that lisp code is setting the |
4650 | 1715 name; if NAME is a string, set F's name to NAME and set |
1716 F->explicit_name; if NAME is Qnil, then clear F->explicit_name. | |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1717 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1718 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
|
1719 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
|
1720 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
|
1721 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1722 void |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1723 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
|
1724 struct frame *f; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1725 Lisp_Object name; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1726 int explicit; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1727 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1728 /* 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
|
1729 Emacs redisplay code. */ |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1730 if (explicit) |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1731 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1732 /* 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
|
1733 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
|
1734 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
|
1735 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
|
1736 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1737 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
|
1738 } |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1739 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
|
1740 return; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1741 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1742 /* 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
|
1743 if (NILP (name)) |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
1744 { |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
1745 /* Check for no change needed in this very common case |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
1746 before we do any consing. */ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
1747 if (!strcmp (FRAME_X_DISPLAY_INFO (f)->x_id_name, |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
1748 XSTRING (f->name)->data)) |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
1749 return; |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
1750 name = build_string (FRAME_X_DISPLAY_INFO (f)->x_id_name); |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
1751 } |
833 | 1752 else |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1753 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
|
1754 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1755 /* 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
|
1756 if (! NILP (Fstring_equal (name, f->name))) |
727 | 1757 return; |
1758 | |
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
|
1759 if (FRAME_X_WINDOW (f)) |
389 | 1760 { |
708 | 1761 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
|
1762 #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
|
1763 { |
12073 | 1764 XTextProperty text, icon; |
1765 Lisp_Object icon_name; | |
1766 | |
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
|
1767 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
|
1768 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
|
1769 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
|
1770 text.nitems = XSTRING (name)->size; |
12073 | 1771 |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
1772 icon_name = (!NILP (f->icon_name) ? f->icon_name : name); |
12073 | 1773 |
1774 icon.value = XSTRING (icon_name)->data; | |
1775 icon.encoding = XA_STRING; | |
1776 icon.format = 8; | |
1777 icon.nitems = XSTRING (icon_name)->size; | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1778 #ifdef USE_X_TOOLKIT |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1779 XSetWMName (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1780 XtWindow (f->display.x->widget), &text); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1781 XSetWMIconName (FRAME_X_DISPLAY (f), XtWindow (f->display.x->widget), |
12073 | 1782 &icon); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1783 #else /* not USE_X_TOOLKIT */ |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1784 XSetWMName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text); |
12073 | 1785 XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1786 #endif /* not USE_X_TOOLKIT */ |
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
|
1787 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1788 #else /* not HAVE_X11R4 */ |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1789 XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (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
|
1790 XSTRING (name)->data); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1791 XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (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
|
1792 XSTRING (name)->data); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1793 #endif /* not HAVE_X11R4 */ |
708 | 1794 UNBLOCK_INPUT; |
389 | 1795 } |
727 | 1796 |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1797 f->name = name; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1798 } |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1799 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1800 /* 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
|
1801 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
|
1802 redisplay code. */ |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1803 void |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1804 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
|
1805 FRAME_PTR f; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1806 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
|
1807 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1808 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
|
1809 } |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1810 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1811 /* 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
|
1812 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
|
1813 lisp code. */ |
1125
059624bf9bf0
Declare x_implicitly_set_name to be void.
Jim Blandy <jimb@redhat.com>
parents:
1096
diff
changeset
|
1814 void |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1815 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
|
1816 FRAME_PTR f; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1817 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
|
1818 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1819 x_set_name (f, arg, 0); |
389 | 1820 } |
1821 | |
1822 void | |
771 | 1823 x_set_autoraise (f, arg, oldval) |
1824 struct frame *f; | |
389 | 1825 Lisp_Object arg, oldval; |
1826 { | |
771 | 1827 f->auto_raise = !EQ (Qnil, arg); |
389 | 1828 } |
1829 | |
1830 void | |
771 | 1831 x_set_autolower (f, arg, oldval) |
1832 struct frame *f; | |
389 | 1833 Lisp_Object arg, oldval; |
1834 { | |
771 | 1835 f->auto_lower = !EQ (Qnil, arg); |
389 | 1836 } |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1837 |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1838 void |
9580
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1839 x_set_unsplittable (f, arg, oldval) |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1840 struct frame *f; |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1841 Lisp_Object arg, oldval; |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1842 { |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1843 f->no_split = !NILP (arg); |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1844 } |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1845 |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1846 void |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1847 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
|
1848 struct frame *f; |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1849 Lisp_Object arg, oldval; |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1850 { |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1851 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
|
1852 { |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1853 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
|
1854 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1855 /* 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
|
1856 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
|
1857 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
|
1858 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
|
1859 if (FRAME_X_WINDOW (f)) |
5899
4e8f26a0f2b7
*** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5721
diff
changeset
|
1860 x_set_window_size (f, 0, 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
|
1861 } |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1862 } |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1863 |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1864 void |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1865 x_set_scroll_bar_width (f, arg, oldval) |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1866 struct frame *f; |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1867 Lisp_Object arg, oldval; |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1868 { |
9166
44b44e900cf1
(x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents:
9103
diff
changeset
|
1869 if (NILP (arg)) |
44b44e900cf1
(x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents:
9103
diff
changeset
|
1870 { |
44b44e900cf1
(x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents:
9103
diff
changeset
|
1871 FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = 0; |
44b44e900cf1
(x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents:
9103
diff
changeset
|
1872 FRAME_SCROLL_BAR_COLS (f) = 2; |
44b44e900cf1
(x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents:
9103
diff
changeset
|
1873 } |
44b44e900cf1
(x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents:
9103
diff
changeset
|
1874 else if (INTEGERP (arg) && XINT (arg) > 0 |
44b44e900cf1
(x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents:
9103
diff
changeset
|
1875 && XFASTINT (arg) != FRAME_SCROLL_BAR_PIXEL_WIDTH (f)) |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1876 { |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1877 int wid = FONT_WIDTH (f->display.x->font); |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1878 FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = XFASTINT (arg); |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1879 FRAME_SCROLL_BAR_COLS (f) = (XFASTINT (arg) + wid-1) / wid; |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1880 if (FRAME_X_WINDOW (f)) |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1881 x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f)); |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1882 } |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1883 } |
389 | 1884 |
771 | 1885 /* Subroutines of creating an X frame. */ |
389 | 1886 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1887 /* Make sure that Vx_resource_name is set to a reasonable value. |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1888 Fix it up, or set it to `emacs' if it is too hopeless. */ |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1889 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1890 static void |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1891 validate_x_resource_name () |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1892 { |
11353
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1893 int len; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1894 /* Number of valid characters in the resource name. */ |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1895 int good_count = 0; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1896 /* Number of invalid characters in the resource name. */ |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1897 int bad_count = 0; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1898 Lisp_Object new; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1899 int i; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1900 |
7525
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1901 if (STRINGP (Vx_resource_name)) |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1902 { |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1903 unsigned char *p = XSTRING (Vx_resource_name)->data; |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1904 int i; |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1905 |
11353
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1906 len = XSTRING (Vx_resource_name)->size; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1907 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1908 /* Only letters, digits, - and _ are valid in resource names. |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1909 Count the valid characters and count the invalid ones. */ |
7525
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1910 for (i = 0; i < len; i++) |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1911 { |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1912 int c = p[i]; |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1913 if (! ((c >= 'a' && c <= 'z') |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1914 || (c >= 'A' && c <= 'Z') |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1915 || (c >= '0' && c <= '9') |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1916 || c == '-' || c == '_')) |
11353
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1917 bad_count++; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1918 else |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1919 good_count++; |
7525
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1920 } |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1921 } |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1922 else |
11353
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1923 /* Not a string => completely invalid. */ |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1924 bad_count = 5, good_count = 0; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1925 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1926 /* If name is valid already, return. */ |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1927 if (bad_count == 0) |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1928 return; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1929 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1930 /* If name is entirely invalid, or nearly so, use `emacs'. */ |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1931 if (good_count == 0 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1932 || (good_count == 1 && bad_count > 0)) |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1933 { |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1934 Vx_resource_name = build_string ("emacs"); |
11353
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1935 return; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1936 } |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1937 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1938 /* Name is partly valid. Copy it and replace the invalid characters |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1939 with underscores. */ |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1940 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1941 Vx_resource_name = new = Fcopy_sequence (Vx_resource_name); |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1942 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1943 for (i = 0; i < len; i++) |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1944 { |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1945 int c = XSTRING (new)->data[i]; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1946 if (! ((c >= 'a' && c <= 'z') |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1947 || (c >= 'A' && c <= 'Z') |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1948 || (c >= '0' && c <= '9') |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1949 || c == '-' || c == '_')) |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1950 XSTRING (new)->data[i] = '_'; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1951 } |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1952 } |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1953 |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1954 |
389 | 1955 extern char *x_get_string_resource (); |
1956 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1957 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
|
1958 "Return the value of ATTRIBUTE, of class CLASS, from the X defaults database.\n\ |
8961
940ca63c26c8
(Fx_get_resource): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
8942
diff
changeset
|
1959 This uses `INSTANCE.ATTRIBUTE' as the key and `Emacs.CLASS' as the\n\ |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1960 class, where INSTANCE is the name under which Emacs was invoked, or\n\ |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1961 the name specified by the `-name' or `-rn' command-line arguments.\n\ |
389 | 1962 \n\ |
1733
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1963 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
|
1964 class, respectively. You must specify both of them or neither.\n\ |
8961
940ca63c26c8
(Fx_get_resource): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
8942
diff
changeset
|
1965 If you specify them, the key is `INSTANCE.COMPONENT.ATTRIBUTE'\n\ |
940ca63c26c8
(Fx_get_resource): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
8942
diff
changeset
|
1966 and the class is `Emacs.CLASS.SUBCLASS'.") |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1967 (attribute, class, component, subclass) |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1968 Lisp_Object attribute, class, component, subclass; |
389 | 1969 { |
1970 register char *value; | |
1971 char *name_key; | |
1972 char *class_key; | |
1973 | |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
1974 check_x (); |
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
1975 |
389 | 1976 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
|
1977 CHECK_STRING (class, 0); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1978 |
1733
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1979 if (!NILP (component)) |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1980 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
|
1981 if (!NILP (subclass)) |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
1982 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
|
1983 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
|
1984 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
|
1985 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1986 validate_x_resource_name (); |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1987 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1988 /* Allocate space for the components, the dots which separate them, |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1989 and the final '\0'. Make them big enough for the worst case. */ |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1990 name_key = (char *) alloca (XSTRING (Vx_resource_name)->size |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1991 + (STRINGP (component) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1992 ? XSTRING (component)->size : 0) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1993 + XSTRING (attribute)->size |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1994 + 3); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1995 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1996 class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1997 + XSTRING (class)->size |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1998 + (STRINGP (subclass) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1999 ? XSTRING (subclass)->size : 0) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2000 + 3); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2001 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2002 /* Start with emacs.FRAMENAME for the name (the specific one) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2003 and with `Emacs' for the class key (the general one). */ |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2004 strcpy (name_key, XSTRING (Vx_resource_name)->data); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2005 strcpy (class_key, EMACS_CLASS); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2006 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2007 strcat (class_key, "."); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2008 strcat (class_key, XSTRING (class)->data); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2009 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2010 if (!NILP (component)) |
389 | 2011 { |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2012 strcat (class_key, "."); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2013 strcat (class_key, XSTRING (subclass)->data); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2014 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2015 strcat (name_key, "."); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2016 strcat (name_key, XSTRING (component)->data); |
389 | 2017 } |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2018 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2019 strcat (name_key, "."); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2020 strcat (name_key, XSTRING (attribute)->data); |
389 | 2021 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2022 value = x_get_string_resource (check_x_display_info (Qnil)->xrdb, |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2023 name_key, class_key); |
389 | 2024 |
2025 if (value != (char *) 0) | |
2026 return build_string (value); | |
2027 else | |
2028 return Qnil; | |
2029 } | |
2030 | |
3173
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2031 /* Used when C code wants a resource value. */ |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2032 |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2033 char * |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2034 x_get_resource_string (attribute, class) |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2035 char *attribute, *class; |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2036 { |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2037 register char *value; |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2038 char *name_key; |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2039 char *class_key; |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2040 |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2041 /* Allocate space for the components, the dots which separate them, |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2042 and the final '\0'. */ |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2043 name_key = (char *) alloca (XSTRING (Vinvocation_name)->size |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2044 + strlen (attribute) + 2); |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2045 class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2046 + strlen (class) + 2); |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2047 |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2048 sprintf (name_key, "%s.%s", |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2049 XSTRING (Vinvocation_name)->data, |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2050 attribute); |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2051 sprintf (class_key, "%s.%s", EMACS_CLASS, class); |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2052 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2053 return x_get_string_resource (FRAME_X_DISPLAY_INFO (selected_frame)->xrdb, |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2054 name_key, class_key); |
3173
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2055 } |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2056 |
398 | 2057 /* Types we might convert a resource string into. */ |
2058 enum resource_types | |
2059 { | |
4571
25bee4fe64aa
(enum resource_types): Delete final comma.
Richard M. Stallman <rms@gnu.org>
parents:
4367
diff
changeset
|
2060 number, boolean, string, symbol |
398 | 2061 }; |
2062 | |
389 | 2063 /* Return the value of parameter PARAM. |
398 | 2064 |
771 | 2065 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
|
2066 database, using ATTRIBUTE as the attribute name and CLASS as its class. |
398 | 2067 |
2068 Convert the resource to the type specified by desired_type. | |
2069 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2070 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
|
2071 x_get_arg, make sure you deal with Qunbound in a reasonable way, |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2072 and don't let it get stored in any Lisp-visible variables! */ |
389 | 2073 |
2074 static Lisp_Object | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2075 x_get_arg (alist, param, attribute, class, type) |
641 | 2076 Lisp_Object alist, param; |
398 | 2077 char *attribute; |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2078 char *class; |
398 | 2079 enum resource_types type; |
389 | 2080 { |
2081 register Lisp_Object tem; | |
2082 | |
2083 tem = Fassq (param, alist); | |
2084 if (EQ (tem, Qnil)) | |
771 | 2085 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
|
2086 if (EQ (tem, Qnil)) |
389 | 2087 { |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2088 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2089 if (attribute) |
398 | 2090 { |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2091 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
|
2092 build_string (class), |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2093 Qnil, Qnil); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2094 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2095 if (NILP (tem)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2096 return Qunbound; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2097 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2098 switch (type) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2099 { |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2100 case number: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2101 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
|
2102 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2103 case boolean: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2104 tem = Fdowncase (tem); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2105 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
|
2106 || !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
|
2107 return Qt; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2108 else |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2109 return Qnil; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2110 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2111 case string: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2112 return tem; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2113 |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2114 case symbol: |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2115 /* 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
|
2116 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
|
2117 { |
6519
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
2118 Lisp_Object lower; |
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
2119 lower = Fdowncase (tem); |
6523
d9d9ab5951dd
(x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents:
6522
diff
changeset
|
2120 if (!strcmp (XSTRING (lower)->data, "on") |
d9d9ab5951dd
(x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents:
6522
diff
changeset
|
2121 || !strcmp (XSTRING (lower)->data, "true")) |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2122 return Qt; |
6523
d9d9ab5951dd
(x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents:
6522
diff
changeset
|
2123 else if (!strcmp (XSTRING (lower)->data, "off") |
d9d9ab5951dd
(x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents:
6522
diff
changeset
|
2124 || !strcmp (XSTRING (lower)->data, "false")) |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2125 return Qnil; |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2126 else |
2686
a84b9a78ab08
(x_get_arg): Call Fintern, not intern.
Richard M. Stallman <rms@gnu.org>
parents:
2439
diff
changeset
|
2127 return Fintern (tem, Qnil); |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2128 } |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2129 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2130 default: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2131 abort (); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2132 } |
398 | 2133 } |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2134 else |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2135 return Qunbound; |
389 | 2136 } |
2137 return Fcdr (tem); | |
2138 } | |
2139 | |
771 | 2140 /* Record in frame F the specified or default value according to ALIST |
389 | 2141 of the parameter named PARAM (a Lisp symbol). |
2142 If no value is specified for PARAM, look for an X default for XPROP | |
771 | 2143 on the frame named NAME. |
389 | 2144 If that is not found either, use the value DEFLT. */ |
2145 | |
2146 static Lisp_Object | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2147 x_default_parameter (f, alist, prop, deflt, xprop, xclass, type) |
771 | 2148 struct frame *f; |
389 | 2149 Lisp_Object alist; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2150 Lisp_Object prop; |
389 | 2151 Lisp_Object deflt; |
2152 char *xprop; | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2153 char *xclass; |
398 | 2154 enum resource_types type; |
389 | 2155 { |
2156 Lisp_Object tem; | |
2157 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2158 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
|
2159 if (EQ (tem, Qunbound)) |
389 | 2160 tem = deflt; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2161 x_set_frame_parameters (f, Fcons (Fcons (prop, tem), Qnil)); |
389 | 2162 return tem; |
2163 } | |
2164 | |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2165 DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0, |
389 | 2166 "Parse an X-style geometry string STRING.\n\ |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2167 Returns an alist of the form ((top . TOP), (left . LEFT) ... ).\n\ |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2168 The properties returned may include `top', `left', `height', and `width'.\n\ |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2169 The value of `left' or `top' may be an integer,\n\ |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2170 or a list (+ N) meaning N pixels relative to top/left corner,\n\ |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2171 or a list (- N) meaning -N pixels relative to bottom/right corner.") |
389 | 2172 (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
|
2173 Lisp_Object string; |
389 | 2174 { |
2175 int geometry, x, y; | |
2176 unsigned int width, height; | |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2177 Lisp_Object result; |
389 | 2178 |
2179 CHECK_STRING (string, 0); | |
2180 | |
2181 geometry = XParseGeometry ((char *) XSTRING (string)->data, | |
2182 &x, &y, &width, &height); | |
2183 | |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2184 #if 0 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2185 if (!!(geometry & XValue) != !!(geometry & YValue)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2186 error ("Must specify both x and y position, or neither"); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2187 #endif |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2188 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2189 result = Qnil; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2190 if (geometry & XValue) |
389 | 2191 { |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2192 Lisp_Object element; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2193 |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2194 if (x >= 0 && (geometry & XNegative)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2195 element = Fcons (Qleft, Fcons (Qminus, Fcons (make_number (-x), Qnil))); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2196 else if (x < 0 && ! (geometry & XNegative)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2197 element = Fcons (Qleft, Fcons (Qplus, Fcons (make_number (x), Qnil))); |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2198 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2199 element = Fcons (Qleft, make_number (x)); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2200 result = Fcons (element, result); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2201 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2202 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2203 if (geometry & YValue) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2204 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2205 Lisp_Object element; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2206 |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2207 if (y >= 0 && (geometry & YNegative)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2208 element = Fcons (Qtop, Fcons (Qminus, Fcons (make_number (-y), Qnil))); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2209 else if (y < 0 && ! (geometry & YNegative)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2210 element = Fcons (Qtop, Fcons (Qplus, Fcons (make_number (y), Qnil))); |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2211 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2212 element = Fcons (Qtop, make_number (y)); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2213 result = Fcons (element, result); |
389 | 2214 } |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2215 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2216 if (geometry & WidthValue) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2217 result = Fcons (Fcons (Qwidth, make_number (width)), result); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2218 if (geometry & HeightValue) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2219 result = Fcons (Fcons (Qheight, make_number (height)), result); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2220 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2221 return result; |
389 | 2222 } |
2223 | |
2224 /* Calculate the desired size and position of this window, | |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2225 and return the flags saying which aspects were specified. |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2226 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2227 This function does not make the coordinates positive. */ |
389 | 2228 |
2229 #define DEFAULT_ROWS 40 | |
2230 #define DEFAULT_COLS 80 | |
2231 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2232 static int |
771 | 2233 x_figure_window_size (f, parms) |
2234 struct frame *f; | |
389 | 2235 Lisp_Object parms; |
2236 { | |
7251
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2237 register Lisp_Object tem0, tem1, tem2; |
389 | 2238 int height, width, left, top; |
2239 register int geometry; | |
2240 long window_prompting = 0; | |
2241 | |
2242 /* Default values if we fall through. | |
2243 Actually, if that happens we should get | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2244 window manager prompting. */ |
771 | 2245 f->width = DEFAULT_COLS; |
2246 f->height = DEFAULT_ROWS; | |
3108
461470daafaa
(x_figure_window_size): Make the default frame coords (0,0).
Richard M. Stallman <rms@gnu.org>
parents:
3080
diff
changeset
|
2247 /* Window managers expect that if program-specified |
461470daafaa
(x_figure_window_size): Make the default frame coords (0,0).
Richard M. Stallman <rms@gnu.org>
parents:
3080
diff
changeset
|
2248 positions are not (0,0), they're intentional, not defaults. */ |
461470daafaa
(x_figure_window_size): Make the default frame coords (0,0).
Richard M. Stallman <rms@gnu.org>
parents:
3080
diff
changeset
|
2249 f->display.x->top_pos = 0; |
461470daafaa
(x_figure_window_size): Make the default frame coords (0,0).
Richard M. Stallman <rms@gnu.org>
parents:
3080
diff
changeset
|
2250 f->display.x->left_pos = 0; |
389 | 2251 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2252 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
|
2253 tem1 = x_get_arg (parms, Qwidth, 0, 0, number); |
7251
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2254 tem2 = x_get_arg (parms, Quser_size, 0, 0, number); |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2255 if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) |
389 | 2256 { |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2257 if (!EQ (tem0, Qunbound)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2258 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2259 CHECK_NUMBER (tem0, 0); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2260 f->height = XINT (tem0); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2261 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2262 if (!EQ (tem1, Qunbound)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2263 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2264 CHECK_NUMBER (tem1, 0); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2265 f->width = XINT (tem1); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2266 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2267 if (!NILP (tem2) && !EQ (tem2, Qunbound)) |
7251
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2268 window_prompting |= USSize; |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2269 else |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2270 window_prompting |= PSize; |
389 | 2271 } |
2272 | |
3293
03e4cad68481
(Fx_close_current_connection): Clear x_current_display.
Richard M. Stallman <rms@gnu.org>
parents:
3203
diff
changeset
|
2273 f->display.x->vertical_scroll_bar_extra |
9240
60497ceed71a
(x_figure_window_size): Use new formula for scroll bar width.
Karl Heuer <kwzh@gnu.org>
parents:
9231
diff
changeset
|
2274 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) |
60497ceed71a
(x_figure_window_size): Use new formula for scroll bar width.
Karl Heuer <kwzh@gnu.org>
parents:
9231
diff
changeset
|
2275 ? 0 |
60497ceed71a
(x_figure_window_size): Use new formula for scroll bar width.
Karl Heuer <kwzh@gnu.org>
parents:
9231
diff
changeset
|
2276 : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
2277 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) |
9240
60497ceed71a
(x_figure_window_size): Use new formula for scroll bar width.
Karl Heuer <kwzh@gnu.org>
parents:
9231
diff
changeset
|
2278 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->display.x->font))); |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
2279 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
|
2280 f->display.x->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height); |
389 | 2281 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2282 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
|
2283 tem1 = x_get_arg (parms, Qleft, 0, 0, number); |
7251
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2284 tem2 = x_get_arg (parms, Quser_position, 0, 0, number); |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2285 if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) |
389 | 2286 { |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2287 if (EQ (tem0, Qminus)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2288 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2289 f->display.x->top_pos = 0; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2290 window_prompting |= YNegative; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2291 } |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2292 else if (CONSP (tem0) && EQ (XCONS (tem0)->car, Qminus) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2293 && CONSP (XCONS (tem0)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2294 && INTEGERP (XCONS (XCONS (tem0)->cdr)->car)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2295 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2296 f->display.x->top_pos = - XINT (XCONS (XCONS (tem0)->cdr)->car); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2297 window_prompting |= YNegative; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2298 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2299 else if (CONSP (tem0) && EQ (XCONS (tem0)->car, Qplus) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2300 && CONSP (XCONS (tem0)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2301 && INTEGERP (XCONS (XCONS (tem0)->cdr)->car)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2302 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2303 f->display.x->top_pos = XINT (XCONS (XCONS (tem0)->cdr)->car); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2304 } |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2305 else if (EQ (tem0, Qunbound)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2306 f->display.x->top_pos = 0; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2307 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2308 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2309 CHECK_NUMBER (tem0, 0); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2310 f->display.x->top_pos = XINT (tem0); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2311 if (f->display.x->top_pos < 0) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2312 window_prompting |= YNegative; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2313 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2314 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2315 if (EQ (tem1, Qminus)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2316 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2317 f->display.x->left_pos = 0; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2318 window_prompting |= XNegative; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2319 } |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2320 else if (CONSP (tem1) && EQ (XCONS (tem1)->car, Qminus) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2321 && CONSP (XCONS (tem1)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2322 && INTEGERP (XCONS (XCONS (tem1)->cdr)->car)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2323 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2324 f->display.x->left_pos = - XINT (XCONS (XCONS (tem1)->cdr)->car); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2325 window_prompting |= XNegative; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2326 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2327 else if (CONSP (tem1) && EQ (XCONS (tem1)->car, Qplus) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2328 && CONSP (XCONS (tem1)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2329 && INTEGERP (XCONS (XCONS (tem1)->cdr)->car)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2330 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2331 f->display.x->left_pos = XINT (XCONS (XCONS (tem1)->cdr)->car); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2332 } |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2333 else if (EQ (tem1, Qunbound)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2334 f->display.x->left_pos = 0; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2335 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2336 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2337 CHECK_NUMBER (tem1, 0); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2338 f->display.x->left_pos = XINT (tem1); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2339 if (f->display.x->left_pos < 0) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2340 window_prompting |= XNegative; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2341 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2342 |
10264
92dcc001aa20
(x_figure_window_size): Treat missing user-position parm as nil.
Richard M. Stallman <rms@gnu.org>
parents:
10222
diff
changeset
|
2343 if (!NILP (tem2) && ! EQ (tem2, Qunbound)) |
7251
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2344 window_prompting |= USPosition; |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2345 else |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2346 window_prompting |= PPosition; |
389 | 2347 } |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2348 |
3293
03e4cad68481
(Fx_close_current_connection): Clear x_current_display.
Richard M. Stallman <rms@gnu.org>
parents:
3203
diff
changeset
|
2349 return window_prompting; |
389 | 2350 } |
2351 | |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2352 #if !defined (HAVE_X11R4) && !defined (HAVE_XSETWMPROTOCOLS) |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2353 |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2354 Status |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2355 XSetWMProtocols (dpy, w, protocols, count) |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2356 Display *dpy; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2357 Window w; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2358 Atom *protocols; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2359 int count; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2360 { |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2361 Atom prop; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2362 prop = XInternAtom (dpy, "WM_PROTOCOLS", False); |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2363 if (prop == None) return False; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2364 XChangeProperty (dpy, w, prop, XA_ATOM, 32, PropModeReplace, |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2365 (unsigned char *) protocols, count); |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2366 return True; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2367 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2368 #endif /* not HAVE_X11R4 && not HAVE_XSETWMPROTOCOLS */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2369 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2370 #ifdef USE_X_TOOLKIT |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2371 |
9528
db02bc274f20
(Fx_create_frame): Init the FRAME_X_SCREEN as soon as can be done.
Richard M. Stallman <rms@gnu.org>
parents:
9353
diff
changeset
|
2372 /* If the WM_PROTOCOLS property does not already contain WM_TAKE_FOCUS, |
db02bc274f20
(Fx_create_frame): Init the FRAME_X_SCREEN as soon as can be done.
Richard M. Stallman <rms@gnu.org>
parents:
9353
diff
changeset
|
2373 WM_DELETE_WINDOW, and WM_SAVE_YOURSELF, then add them. (They may |
8845
c4b7fda8f611
(hack_wm_protocols): Arrange to handle WM_SAVE_YOURSELF.
Richard M. Stallman <rms@gnu.org>
parents:
8782
diff
changeset
|
2374 already be present because of the toolkit (Motif adds some of them, |
c4b7fda8f611
(hack_wm_protocols): Arrange to handle WM_SAVE_YOURSELF.
Richard M. Stallman <rms@gnu.org>
parents:
8782
diff
changeset
|
2375 for example, but Xt doesn't). */ |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2376 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2377 static void |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2378 hack_wm_protocols (f, widget) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2379 FRAME_PTR f; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2380 Widget widget; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2381 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2382 Display *dpy = XtDisplay (widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2383 Window w = XtWindow (widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2384 int need_delete = 1; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2385 int need_focus = 1; |
8845
c4b7fda8f611
(hack_wm_protocols): Arrange to handle WM_SAVE_YOURSELF.
Richard M. Stallman <rms@gnu.org>
parents:
8782
diff
changeset
|
2386 int need_save = 1; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2387 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2388 BLOCK_INPUT; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2389 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2390 Atom type, *atoms = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2391 int format = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2392 unsigned long nitems = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2393 unsigned long bytes_after; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2394 |
11882
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
2395 if ((XGetWindowProperty (dpy, w, |
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
2396 FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols, |
11894
b20c45d49063
(hack_wm_protocols): Use cast instead of suffix.
Karl Heuer <kwzh@gnu.org>
parents:
11893
diff
changeset
|
2397 (long)0, (long)100, False, XA_ATOM, |
11882
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
2398 &type, &format, &nitems, &bytes_after, |
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
2399 (unsigned char **) &atoms) |
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
2400 == Success) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2401 && format == 32 && type == XA_ATOM) |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2402 while (nitems > 0) |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2403 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2404 nitems--; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2405 if (atoms[nitems] == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_delete_window) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2406 need_delete = 0; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2407 else if (atoms[nitems] == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_take_focus) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2408 need_focus = 0; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2409 else if (atoms[nitems] == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_save_yourself) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2410 need_save = 0; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2411 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2412 if (atoms) XFree ((char *) atoms); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2413 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2414 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2415 Atom props [10]; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2416 int count = 0; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2417 if (need_delete) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2418 props[count++] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_delete_window; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2419 if (need_focus) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2420 props[count++] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_take_focus; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2421 if (need_save) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2422 props[count++] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_save_yourself; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2423 if (count) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2424 XChangeProperty (dpy, w, FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols, |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2425 XA_ATOM, 32, PropModeAppend, |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2426 (unsigned char *) props, count); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2427 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2428 UNBLOCK_INPUT; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2429 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2430 #endif |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2431 |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2432 #ifdef USE_X_TOOLKIT |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2433 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2434 /* Create and set up the X widget for frame F. */ |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2435 |
389 | 2436 static void |
6604
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2437 x_window (f, window_prompting, minibuffer_only) |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2438 struct frame *f; |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2439 long window_prompting; |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2440 int minibuffer_only; |
389 | 2441 { |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2442 XClassHint class_hints; |
6059
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2443 XSetWindowAttributes attributes; |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2444 unsigned long attribute_mask; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2445 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2446 Widget shell_widget; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2447 Widget pane_widget; |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2448 Widget frame_widget; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2449 Arg al [25]; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2450 int ac; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2451 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2452 BLOCK_INPUT; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2453 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2454 /* Use the resource name as the top-level widget name |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2455 for looking up resources. Make a non-Lisp copy |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2456 for the window manager, so GC relocation won't bother it. |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2457 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2458 Elsewhere we specify the window name for the window manager. */ |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2459 |
11496
db02849ee365
(x_window): Use (or reuse) frame's namebuf instead of a
Karl Heuer <kwzh@gnu.org>
parents:
11483
diff
changeset
|
2460 { |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2461 char *str = (char *) XSTRING (Vx_resource_name)->data; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2462 f->namebuf = (char *) xmalloc (strlen (str) + 1); |
11496
db02849ee365
(x_window): Use (or reuse) frame's namebuf instead of a
Karl Heuer <kwzh@gnu.org>
parents:
11483
diff
changeset
|
2463 strcpy (f->namebuf, str); |
db02849ee365
(x_window): Use (or reuse) frame's namebuf instead of a
Karl Heuer <kwzh@gnu.org>
parents:
11483
diff
changeset
|
2464 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2465 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2466 ac = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2467 XtSetArg (al[ac], XtNallowShellResize, 1); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2468 XtSetArg (al[ac], XtNinput, 1); ac++; |
11707
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2469 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++; |
11897
cbd3724a9696
(x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents:
11894
diff
changeset
|
2470 XtSetArg (al[ac], XtNborderWidth, f->display.x->border_width); ac++; |
11496
db02849ee365
(x_window): Use (or reuse) frame's namebuf instead of a
Karl Heuer <kwzh@gnu.org>
parents:
11483
diff
changeset
|
2471 shell_widget = XtAppCreateShell (f->namebuf, EMACS_CLASS, |
12019
63ee64941021
(x_top_window_to_frame): Don't match menu-bar widget.
Karl Heuer <kwzh@gnu.org>
parents:
12011
diff
changeset
|
2472 applicationShellWidgetClass, |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
2473 FRAME_X_DISPLAY (f), al, ac); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2474 |
6604
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2475 f->display.x->widget = shell_widget; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2476 /* maybe_set_screen_title_format (shell_widget); */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2477 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2478 pane_widget = lw_create_widget ("main", "pane", widget_id_tick++, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2479 (widget_value *) NULL, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2480 shell_widget, False, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2481 (lw_callback) NULL, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2482 (lw_callback) NULL, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2483 (lw_callback) NULL); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2484 |
6604
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2485 f->display.x->column_widget = pane_widget; |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2486 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2487 /* mappedWhenManaged to false tells to the paned window to not map/unmap |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
2488 the emacs screen when changing menubar. This reduces flickering. */ |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2489 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2490 ac = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2491 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2492 XtSetArg (al[ac], XtNshowGrip, 0); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2493 XtSetArg (al[ac], XtNallowResize, 1); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2494 XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2495 XtSetArg (al[ac], XtNemacsFrame, f); ac++; |
11496
db02849ee365
(x_window): Use (or reuse) frame's namebuf instead of a
Karl Heuer <kwzh@gnu.org>
parents:
11483
diff
changeset
|
2496 frame_widget = XtCreateWidget (f->namebuf, |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2497 emacsFrameClass, |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2498 pane_widget, al, ac); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2499 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2500 f->display.x->edit_widget = frame_widget; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2501 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2502 XtManageChild (frame_widget); |
6604
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2503 |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2504 /* Do some needed geometry management. */ |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2505 { |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2506 int len; |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2507 char *tem, shell_position[32]; |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2508 Arg al[2]; |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2509 int ac = 0; |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2510 int extra_borders = 0; |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2511 int menubar_size |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2512 = (f->display.x->menubar_widget |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2513 ? (f->display.x->menubar_widget->core.height |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2514 + f->display.x->menubar_widget->core.border_width) |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2515 : 0); |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2516 extern char *lwlib_toolkit_type; |
6604
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2517 |
7969
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2518 if (FRAME_EXTERNAL_MENU_BAR (f)) |
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2519 { |
9808
4c43c9dbe130
(x_window): Make ibw 0 by default.
Richard M. Stallman <rms@gnu.org>
parents:
9742
diff
changeset
|
2520 Dimension ibw = 0; |
7969
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2521 XtVaGetValues (pane_widget, XtNinternalBorderWidth, &ibw, NULL); |
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2522 menubar_size += ibw; |
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2523 } |
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2524 |
11897
cbd3724a9696
(x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents:
11894
diff
changeset
|
2525 f->display.x->menubar_height = menubar_size; |
cbd3724a9696
(x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents:
11894
diff
changeset
|
2526 |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2527 /* Motif seems to need this amount added to the sizes |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2528 specified for the shell widget. The Athena/Lucid widgets don't. |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2529 Both conclusions reached experimentally. -- rms. */ |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2530 if (!strcmp (lwlib_toolkit_type, "motif")) |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2531 XtVaGetValues (f->display.x->edit_widget, XtNinternalBorderWidth, |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2532 &extra_borders, NULL); |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2533 |
11707
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2534 /* Convert our geometry parameters into a geometry string |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2535 and specify it. |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2536 Note that we do not specify here whether the position |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2537 is a user-specified or program-specified one. |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2538 We pass that information later, in x_wm_set_size_hints. */ |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2539 { |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2540 int left = f->display.x->left_pos; |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2541 int xneg = window_prompting & XNegative; |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2542 int top = f->display.x->top_pos; |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2543 int yneg = window_prompting & YNegative; |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2544 if (xneg) |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2545 left = -left; |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2546 if (yneg) |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2547 top = -top; |
11893
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2548 |
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2549 if (window_prompting & USPosition) |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2550 sprintf (shell_position, "=%dx%d%c%d%c%d", |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2551 PIXEL_WIDTH (f) + extra_borders, |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2552 PIXEL_HEIGHT (f) + menubar_size + extra_borders, |
11893
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2553 (xneg ? '-' : '+'), left, |
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2554 (yneg ? '-' : '+'), top); |
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2555 else |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2556 sprintf (shell_position, "=%dx%d", |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2557 PIXEL_WIDTH (f) + extra_borders, |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2558 PIXEL_HEIGHT (f) + menubar_size + extra_borders); |
11707
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2559 } |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2560 |
6604
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2561 len = strlen (shell_position) + 1; |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2562 tem = (char *) xmalloc (len); |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2563 strncpy (tem, shell_position, len); |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2564 XtSetArg (al[ac], XtNgeometry, tem); ac++; |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2565 XtSetValues (shell_widget, al, ac); |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2566 } |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2567 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2568 XtManageChild (pane_widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2569 XtRealizeWidget (shell_widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2570 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2571 FRAME_X_WINDOW (f) = XtWindow (frame_widget); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2572 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2573 validate_x_resource_name (); |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2574 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2575 class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2576 class_hints.res_class = EMACS_CLASS; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2577 XSetClassHint (FRAME_X_DISPLAY (f), XtWindow (shell_widget), &class_hints); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2578 |
7172
f9eeb75c2b76
(x_window) [USE_X_TOOLKIT]: Call XSetWMHints.
Richard M. Stallman <rms@gnu.org>
parents:
7040
diff
changeset
|
2579 f->display.x->wm_hints.input = True; |
f9eeb75c2b76
(x_window) [USE_X_TOOLKIT]: Call XSetWMHints.
Richard M. Stallman <rms@gnu.org>
parents:
7040
diff
changeset
|
2580 f->display.x->wm_hints.flags |= InputHint; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2581 XSetWMHints (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2582 &f->display.x->wm_hints); |
7172
f9eeb75c2b76
(x_window) [USE_X_TOOLKIT]: Call XSetWMHints.
Richard M. Stallman <rms@gnu.org>
parents:
7040
diff
changeset
|
2583 |
9703
85ac0e4030d4
(x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents:
9690
diff
changeset
|
2584 hack_wm_protocols (f, shell_widget); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2585 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2586 #ifdef HACK_EDITRES |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2587 XtAddEventHandler (shell_widget, 0, True, _XEditResCheckMessages, 0); |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2588 #endif |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2589 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2590 /* Do a stupid property change to force the server to generate a |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2591 propertyNotify event so that the event_stream server timestamp will |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2592 be initialized to something relevant to the time we created the window. |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2593 */ |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2594 XChangeProperty (XtDisplay (frame_widget), XtWindow (frame_widget), |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2595 FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols, |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2596 XA_ATOM, 32, PropModeAppend, |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2597 (unsigned char*) NULL, 0); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2598 |
6059
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2599 /* Make all the standard events reach the Emacs frame. */ |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2600 attributes.event_mask = STANDARD_EVENT_SET; |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2601 attribute_mask = CWEventMask; |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2602 XChangeWindowAttributes (XtDisplay (shell_widget), XtWindow (shell_widget), |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2603 attribute_mask, &attributes); |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2604 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2605 XtMapWidget (frame_widget); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2606 |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2607 /* x_set_name normally ignores requests to set the name if the |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2608 requested name is the same as the current name. This is the one |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2609 place where that assumption isn't correct; f->name is set, but |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2610 the X server hasn't been told. */ |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2611 { |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2612 Lisp_Object name; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2613 int explicit = f->explicit_name; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2614 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2615 f->explicit_name = 0; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2616 name = f->name; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2617 f->name = Qnil; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2618 x_set_name (f, name, explicit); |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2619 } |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2620 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2621 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2622 f->display.x->text_cursor); |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2623 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2624 UNBLOCK_INPUT; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2625 |
11962
f9b853c18bb5
(x_window): Call initialize_frame_menubar
Karl Heuer <kwzh@gnu.org>
parents:
11932
diff
changeset
|
2626 if (!minibuffer_only && FRAME_EXTERNAL_MENU_BAR (f)) |
f9b853c18bb5
(x_window): Call initialize_frame_menubar
Karl Heuer <kwzh@gnu.org>
parents:
11932
diff
changeset
|
2627 initialize_frame_menubar (f); |
12019
63ee64941021
(x_top_window_to_frame): Don't match menu-bar widget.
Karl Heuer <kwzh@gnu.org>
parents:
12011
diff
changeset
|
2628 lw_set_main_areas (pane_widget, f->display.x->menubar_widget, frame_widget); |
11962
f9b853c18bb5
(x_window): Call initialize_frame_menubar
Karl Heuer <kwzh@gnu.org>
parents:
11932
diff
changeset
|
2629 |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2630 if (FRAME_X_WINDOW (f) == 0) |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2631 error ("Unable to create window"); |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2632 } |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2633 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2634 #else /* not USE_X_TOOLKIT */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2635 |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2636 /* Create and set up the X window for frame F. */ |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2637 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2638 x_window (f) |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2639 struct frame *f; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2640 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2641 { |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2642 XClassHint class_hints; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2643 XSetWindowAttributes attributes; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2644 unsigned long attribute_mask; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2645 |
771 | 2646 attributes.background_pixel = f->display.x->background_pixel; |
2647 attributes.border_pixel = f->display.x->border_pixel; | |
389 | 2648 attributes.bit_gravity = StaticGravity; |
2649 attributes.backing_store = NotUseful; | |
2650 attributes.save_under = True; | |
2651 attributes.event_mask = STANDARD_EVENT_SET; | |
2652 attribute_mask = (CWBackPixel | CWBorderPixel | CWBitGravity | |
2653 #if 0 | |
2654 | CWBackingStore | CWSaveUnder | |
2655 #endif | |
2656 | CWEventMask); | |
2657 | |
2658 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
|
2659 FRAME_X_WINDOW (f) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2660 = XCreateWindow (FRAME_X_DISPLAY (f), |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2661 f->display.x->parent_desc, |
771 | 2662 f->display.x->left_pos, |
2663 f->display.x->top_pos, | |
2664 PIXEL_WIDTH (f), PIXEL_HEIGHT (f), | |
2665 f->display.x->border_width, | |
389 | 2666 CopyFromParent, /* depth */ |
2667 InputOutput, /* class */ | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2668 FRAME_X_DISPLAY_INFO (f)->visual, |
389 | 2669 attribute_mask, &attributes); |
2670 | |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2671 validate_x_resource_name (); |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2672 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2673 class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data; |
389 | 2674 class_hints.res_class = EMACS_CLASS; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2675 XSetClassHint (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &class_hints); |
771 | 2676 |
11897
cbd3724a9696
(x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents:
11894
diff
changeset
|
2677 /* The menubar is part of the ordinary display; |
cbd3724a9696
(x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents:
11894
diff
changeset
|
2678 it does not count in addition to the height of the window. */ |
cbd3724a9696
(x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents:
11894
diff
changeset
|
2679 f->display.x->menubar_height = 0; |
cbd3724a9696
(x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents:
11894
diff
changeset
|
2680 |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
2681 /* 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
|
2682 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
|
2683 need to draw the cursor correctly. Accursed bureaucrats. |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2684 XWhipsAndChains (FRAME_X_DISPLAY (f), IronMaiden, &TheRack); */ |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
2685 |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
2686 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
|
2687 f->display.x->wm_hints.flags |= InputHint; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2688 XSetWMHints (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2689 &f->display.x->wm_hints); |
7860
26a1d7b2670b
(x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents:
7802
diff
changeset
|
2690 |
26a1d7b2670b
(x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents:
7802
diff
changeset
|
2691 /* Request "save yourself" and "delete window" commands from wm. */ |
26a1d7b2670b
(x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents:
7802
diff
changeset
|
2692 { |
26a1d7b2670b
(x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents:
7802
diff
changeset
|
2693 Atom protocols[2]; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2694 protocols[0] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_delete_window; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2695 protocols[1] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_save_yourself; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2696 XSetWMProtocols (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), protocols, 2); |
7860
26a1d7b2670b
(x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents:
7802
diff
changeset
|
2697 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2698 |
817 | 2699 /* x_set_name normally ignores requests to set the name if the |
2700 requested name is the same as the current name. This is the one | |
2701 place where that assumption isn't correct; f->name is set, but | |
2702 the X server hasn't been told. */ | |
2703 { | |
6519
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
2704 Lisp_Object name; |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2705 int explicit = f->explicit_name; |
817 | 2706 |
6519
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
2707 f->explicit_name = 0; |
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
2708 name = f->name; |
817 | 2709 f->name = Qnil; |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2710 x_set_name (f, name, explicit); |
817 | 2711 } |
2712 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2713 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
771 | 2714 f->display.x->text_cursor); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2715 |
389 | 2716 UNBLOCK_INPUT; |
2717 | |
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
|
2718 if (FRAME_X_WINDOW (f) == 0) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2719 error ("Unable to create window"); |
389 | 2720 } |
2721 | |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2722 #endif /* not USE_X_TOOLKIT */ |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2723 |
389 | 2724 /* Handle the icon stuff for this window. Perhaps later we might |
2725 want an x_set_icon_position which can be called interactively as | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2726 well. */ |
389 | 2727 |
2728 static void | |
771 | 2729 x_icon (f, parms) |
2730 struct frame *f; | |
389 | 2731 Lisp_Object parms; |
2732 { | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2733 Lisp_Object icon_x, icon_y; |
389 | 2734 |
2735 /* Set the position of the icon. Note that twm groups all | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2736 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
|
2737 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
|
2738 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
|
2739 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) |
389 | 2740 { |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2741 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
|
2742 CHECK_NUMBER (icon_y, 0); |
389 | 2743 } |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2744 else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound)) |
389 | 2745 error ("Both left and top icon corners of icon must be specified"); |
2746 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2747 BLOCK_INPUT; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2748 |
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
|
2749 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
|
2750 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
|
2751 |
389 | 2752 /* 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
|
2753 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
|
2754 (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
|
2755 ? IconicState |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2756 : NormalState)); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2757 |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
2758 x_text_icon (f, (char *) XSTRING ((!NILP (f->icon_name) |
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
2759 ? f->icon_name |
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
2760 : f->name))->data); |
12073 | 2761 |
389 | 2762 UNBLOCK_INPUT; |
2763 } | |
2764 | |
2765 /* Make the GC's needed for this window, setting the | |
2766 background, border and mouse colors; also create the | |
2767 mouse cursor and the gray border tile. */ | |
2768 | |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2769 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
|
2770 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2771 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
|
2772 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
|
2773 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
|
2774 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
|
2775 }; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2776 |
389 | 2777 static void |
771 | 2778 x_make_gc (f) |
2779 struct frame *f; | |
389 | 2780 { |
2781 XGCValues gc_values; | |
2782 GC temp_gc; | |
2783 XImage tileimage; | |
2784 | |
2341
1982e2983822
* xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents:
2328
diff
changeset
|
2785 BLOCK_INPUT; |
1982e2983822
* xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents:
2328
diff
changeset
|
2786 |
771 | 2787 /* Create the GC's of this frame. |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2788 Note that many default values are used. */ |
389 | 2789 |
2790 /* Normal video */ | |
771 | 2791 gc_values.font = f->display.x->font->fid; |
2792 gc_values.foreground = f->display.x->foreground_pixel; | |
2793 gc_values.background = f->display.x->background_pixel; | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2794 gc_values.line_width = 0; /* Means 1 using fast algorithm. */ |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2795 f->display.x->normal_gc = XCreateGC (FRAME_X_DISPLAY (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
|
2796 FRAME_X_WINDOW (f), |
389 | 2797 GCLineWidth | GCFont |
2798 | GCForeground | GCBackground, | |
2799 &gc_values); | |
2800 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2801 /* Reverse video style. */ |
771 | 2802 gc_values.foreground = f->display.x->background_pixel; |
2803 gc_values.background = f->display.x->foreground_pixel; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2804 f->display.x->reverse_gc = XCreateGC (FRAME_X_DISPLAY (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
|
2805 FRAME_X_WINDOW (f), |
389 | 2806 GCFont | GCForeground | GCBackground |
2807 | GCLineWidth, | |
2808 &gc_values); | |
2809 | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2810 /* Cursor has cursor-color background, background-color foreground. */ |
771 | 2811 gc_values.foreground = f->display.x->background_pixel; |
2812 gc_values.background = f->display.x->cursor_pixel; | |
389 | 2813 gc_values.fill_style = FillOpaqueStippled; |
2814 gc_values.stipple | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2815 = XCreateBitmapFromData (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2816 FRAME_X_DISPLAY_INFO (f)->root_window, |
389 | 2817 cursor_bits, 16, 16); |
771 | 2818 f->display.x->cursor_gc |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2819 = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 2820 (GCFont | GCForeground | GCBackground |
2821 | GCFillStyle | GCStipple | GCLineWidth), | |
2822 &gc_values); | |
2823 | |
2824 /* Create the gray border tile used when the pointer is not in | |
771 | 2825 the frame. Since this depends on the frame's pixel values, |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2826 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
|
2827 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
|
2828 = (XCreatePixmapFromBitmapData |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2829 (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window, |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
2830 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
|
2831 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
|
2832 f->display.x->background_pixel, |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2833 DefaultDepth (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2834 XScreenNumberOfScreen (FRAME_X_SCREEN (f))))); |
2341
1982e2983822
* xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents:
2328
diff
changeset
|
2835 |
1982e2983822
* xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents:
2328
diff
changeset
|
2836 UNBLOCK_INPUT; |
389 | 2837 } |
2838 | |
771 | 2839 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, |
389 | 2840 1, 1, 0, |
771 | 2841 "Make a new X window, which is called a \"frame\" in Emacs terms.\n\ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2842 Returns an Emacs frame object.\n\ |
771 | 2843 ALIST is an alist of frame parameters.\n\ |
2844 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
|
2845 and do not specify a specific minibuffer window to use,\n\ |
771 | 2846 then `default-minibuffer-frame' must be a frame whose minibuffer can\n\ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2847 be shared by the new frame.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2848 \n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2849 This function is an internal primitive--use `make-frame' instead.") |
389 | 2850 (parms) |
2851 Lisp_Object parms; | |
2852 { | |
771 | 2853 struct frame *f; |
6935
675e4ec5f14f
(Fx_create_frame): Delete excess args to x_wm_set_size_hint.
Richard M. Stallman <rms@gnu.org>
parents:
6882
diff
changeset
|
2854 Lisp_Object frame, tem; |
389 | 2855 Lisp_Object name; |
2856 int minibuffer_only = 0; | |
2857 long window_prompting = 0; | |
2858 int width, height; | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2859 int count = specpdl_ptr - specpdl; |
8103
b0d56b9856c4
(Fx_create_frame): Add GC protection for local var `f'.
Paul Reilly <pmr@pajato.com>
parents:
8091
diff
changeset
|
2860 struct gcpro gcpro1; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2861 Lisp_Object display; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2862 struct x_display_info *dpyinfo; |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2863 Lisp_Object parent; |
11774
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
2864 struct kboard *kb; |
389 | 2865 |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
2866 check_x (); |
389 | 2867 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2868 /* Use this general default value to start with |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2869 until we know if this frame has a specified name. */ |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2870 Vx_resource_name = Vinvocation_name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2871 |
12316
459ad0d54bef
(Fx_create_frame): Fix last arg to x_get_arg for Qdisplay.
Richard M. Stallman <rms@gnu.org>
parents:
12276
diff
changeset
|
2872 display = x_get_arg (parms, Qdisplay, 0, 0, string); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2873 if (EQ (display, Qunbound)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2874 display = Qnil; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2875 dpyinfo = check_x_display_info (display); |
11774
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
2876 #ifdef MULTI_KBOARD |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
2877 kb = dpyinfo->kboard; |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
2878 #else |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
2879 kb = &the_only_kboard; |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
2880 #endif |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2881 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2882 name = x_get_arg (parms, Qname, "title", "Title", string); |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
2883 if (!STRINGP (name) |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2884 && ! EQ (name, Qunbound) |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2885 && ! NILP (name)) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2886 error ("Invalid frame name--not a string or nil"); |
398 | 2887 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2888 if (STRINGP (name)) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2889 Vx_resource_name = name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2890 |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2891 /* See if parent window is specified. */ |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2892 parent = x_get_arg (parms, Qparent_id, NULL, NULL, number); |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2893 if (EQ (parent, Qunbound)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2894 parent = Qnil; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2895 if (! NILP (parent)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2896 CHECK_NUMBER (parent, 0); |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2897 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2898 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
|
2899 if (EQ (tem, Qnone) || NILP (tem)) |
12011
854e396aabed
(Fx_create_frame): Pass new arg to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11989
diff
changeset
|
2900 f = make_frame_without_minibuffer (Qnil, kb, display); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2901 else if (EQ (tem, Qonly)) |
389 | 2902 { |
771 | 2903 f = make_minibuffer_frame (); |
389 | 2904 minibuffer_only = 1; |
2905 } | |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
2906 else if (WINDOWP (tem)) |
12011
854e396aabed
(Fx_create_frame): Pass new arg to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11989
diff
changeset
|
2907 f = make_frame_without_minibuffer (tem, kb, display); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2908 else |
771 | 2909 f = make_frame (1); |
2910 | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
2911 /* 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
|
2912 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
|
2913 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2914 XSETFRAME (frame, f); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2915 GCPRO1 (frame); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2916 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2917 f->output_method = output_x_window; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2918 f->display.x = (struct x_display *) xmalloc (sizeof (struct x_display)); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2919 bzero (f->display.x, sizeof (struct x_display)); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2920 f->display.x->icon_bitmap = -1; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2921 |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
2922 f->icon_name |
12073 | 2923 = x_get_arg (parms, Qicon_name, "iconName", "Title", string); |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
2924 if (! STRINGP (f->icon_name)) |
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
2925 f->icon_name = Qnil; |
12073 | 2926 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2927 FRAME_X_DISPLAY_INFO (f) = dpyinfo; |
11014
634a98104921
(Fx_create_frame): set the frame's kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10920
diff
changeset
|
2928 #ifdef MULTI_KBOARD |
11774
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
2929 FRAME_KBOARD (f) = kb; |
11014
634a98104921
(Fx_create_frame): set the frame's kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10920
diff
changeset
|
2930 #endif |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2931 |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2932 /* Specify the parent under which to make this X window. */ |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2933 |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2934 if (!NILP (parent)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2935 { |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2936 f->display.x->parent_desc = parent; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2937 f->display.x->explicit_parent = 1; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2938 } |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2939 else |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2940 { |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2941 f->display.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2942 f->display.x->explicit_parent = 0; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2943 } |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
2944 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2945 /* Note that the frame has no physical cursor right now. */ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2946 f->phys_cursor_x = -1; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2947 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2948 /* 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
|
2949 be set. */ |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2950 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
|
2951 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2952 f->name = build_string (dpyinfo->x_id_name); |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2953 f->explicit_name = 0; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2954 } |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2955 else |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2956 { |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2957 f->name = name; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2958 f->explicit_name = 1; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2959 /* use the frame's title when getting resources for this frame. */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2960 specbind (Qx_resource_name, name); |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2961 } |
771 | 2962 |
389 | 2963 /* Extract the window parameters from the supplied values |
2964 that are needed to determine window geometry. */ | |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2965 { |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2966 Lisp_Object font; |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2967 |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
2968 font = x_get_arg (parms, Qfont, "font", "Font", string); |
4150
e2e92cd737bf
* xfns.c (Fx_create_frame): Block input around call to
Jim Blandy <jimb@redhat.com>
parents:
4146
diff
changeset
|
2969 BLOCK_INPUT; |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
2970 /* First, try whatever font the caller has specified. */ |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
2971 if (STRINGP (font)) |
4269
fcbdc9cca97a
(Fx_create_frame): Typo in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
4259
diff
changeset
|
2972 font = x_new_font (f, XSTRING (font)->data); |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
2973 /* Try out a font which we hope has bold and italic variations. */ |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
2974 if (!STRINGP (font)) |
8270
1a0af0f4fb1d
(Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents:
8192
diff
changeset
|
2975 font = x_new_font (f, "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1"); |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
2976 if (! STRINGP (font)) |
8270
1a0af0f4fb1d
(Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents:
8192
diff
changeset
|
2977 font = x_new_font (f, "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1"); |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
2978 if (! STRINGP (font)) |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
2979 /* This was formerly the first thing tried, but it finds too many fonts |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
2980 and takes too long. */ |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
2981 font = x_new_font (f, "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1"); |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
2982 /* If those didn't work, look for something which will at least work. */ |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
2983 if (! STRINGP (font)) |
8270
1a0af0f4fb1d
(Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents:
8192
diff
changeset
|
2984 font = x_new_font (f, "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1"); |
4150
e2e92cd737bf
* xfns.c (Fx_create_frame): Block input around call to
Jim Blandy <jimb@redhat.com>
parents:
4146
diff
changeset
|
2985 UNBLOCK_INPUT; |
e2e92cd737bf
* xfns.c (Fx_create_frame): Block input around call to
Jim Blandy <jimb@redhat.com>
parents:
4146
diff
changeset
|
2986 if (! STRINGP (font)) |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
2987 font = build_string ("fixed"); |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
2988 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2989 x_default_parameter (f, parms, Qfont, font, |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2990 "font", "Font", string); |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2991 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2992 |
9808
4c43c9dbe130
(x_window): Make ibw 0 by default.
Richard M. Stallman <rms@gnu.org>
parents:
9742
diff
changeset
|
2993 #ifdef USE_X_TOOLKIT |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
2994 /* Prevent lwlib/xlwmenu.c from crashing because of a bug |
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
2995 whereby it fails to get any font. */ |
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
2996 xlwmenu_default_font = f->display.x->font; |
9808
4c43c9dbe130
(x_window): Make ibw 0 by default.
Richard M. Stallman <rms@gnu.org>
parents:
9742
diff
changeset
|
2997 #endif |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
2998 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2999 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
|
3000 "borderwidth", "BorderWidth", number); |
3923
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3001 /* This defaults to 2 in order to match xterm. We recognize either |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3002 internalBorderWidth or internalBorder (which is what xterm calls |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3003 it). */ |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3004 if (NILP (Fassq (Qinternal_border_width, parms))) |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3005 { |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3006 Lisp_Object value; |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3007 |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3008 value = x_get_arg (parms, Qinternal_border_width, |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3009 "internalBorder", "BorderWidth", number); |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3010 if (! EQ (value, Qunbound)) |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3011 parms = Fcons (Fcons (Qinternal_border_width, value), |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3012 parms); |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3013 } |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3014 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
|
3015 "internalBorderWidth", "BorderWidth", number); |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3016 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
|
3017 "verticalScrollBars", "ScrollBars", boolean); |
389 | 3018 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3019 /* 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
|
3020 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
|
3021 "foreground", "Foreground", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3022 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
|
3023 "background", "Background", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3024 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
|
3025 "pointerColor", "Foreground", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3026 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
|
3027 "cursorColor", "Foreground", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3028 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
|
3029 "borderColor", "BorderColor", string); |
389 | 3030 |
8758
fac1c4722677
(Fx_create_frame): Make 1 the default for menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
8675
diff
changeset
|
3031 x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1), |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
3032 "menuBar", "MenuBar", number); |
9166
44b44e900cf1
(x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents:
9103
diff
changeset
|
3033 x_default_parameter (f, parms, Qscroll_bar_width, Qnil, |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
3034 "scrollBarWidth", "ScrollBarWidth", number); |
6882
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3035 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3036 f->display.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; |
771 | 3037 window_prompting = x_figure_window_size (f, parms); |
3038 | |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3039 if (window_prompting & XNegative) |
6935
675e4ec5f14f
(Fx_create_frame): Delete excess args to x_wm_set_size_hint.
Richard M. Stallman <rms@gnu.org>
parents:
6882
diff
changeset
|
3040 { |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3041 if (window_prompting & YNegative) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3042 f->display.x->win_gravity = SouthEastGravity; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3043 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3044 f->display.x->win_gravity = NorthEastGravity; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3045 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3046 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3047 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3048 if (window_prompting & YNegative) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3049 f->display.x->win_gravity = SouthWestGravity; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3050 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3051 f->display.x->win_gravity = NorthWestGravity; |
6935
675e4ec5f14f
(Fx_create_frame): Delete excess args to x_wm_set_size_hint.
Richard M. Stallman <rms@gnu.org>
parents:
6882
diff
changeset
|
3052 } |
675e4ec5f14f
(Fx_create_frame): Delete excess args to x_wm_set_size_hint.
Richard M. Stallman <rms@gnu.org>
parents:
6882
diff
changeset
|
3053 |
7263
b7025b4bf659
(Fx_create_frame): Set the size_hint_flags field.
Richard M. Stallman <rms@gnu.org>
parents:
7261
diff
changeset
|
3054 f->display.x->size_hint_flags = window_prompting; |
b7025b4bf659
(Fx_create_frame): Set the size_hint_flags field.
Richard M. Stallman <rms@gnu.org>
parents:
7261
diff
changeset
|
3055 |
6604
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
3056 #ifdef USE_X_TOOLKIT |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
3057 x_window (f, window_prompting, minibuffer_only); |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
3058 #else |
771 | 3059 x_window (f); |
6604
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
3060 #endif |
771 | 3061 x_icon (f, parms); |
3062 x_make_gc (f); | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
3063 init_frame_faces (f); |
771 | 3064 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3065 /* 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
|
3066 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
|
3067 x_default_parameter (f, parms, Qicon_type, Qnil, |
3347
53c89f73e85a
(Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents:
3339
diff
changeset
|
3068 "bitmapIcon", "BitmapIcon", symbol); |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3069 |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3070 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
|
3071 "autoRaise", "AutoRaiseLower", boolean); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3072 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
|
3073 "autoLower", "AutoRaiseLower", boolean); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3074 x_default_parameter (f, parms, Qcursor_type, Qbox, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3075 "cursorType", "CursorType", symbol); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3076 |
771 | 3077 /* Dimensions, especially f->height, must be done via change_frame_size. |
389 | 3078 Change will not be effected unless different from the current |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3079 f->height. */ |
771 | 3080 width = f->width; |
3081 height = f->height; | |
3082 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
|
3083 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
|
3084 |
11707
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
3085 /* Tell the server what size and position, etc, we want, |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
3086 and how badly we want them. */ |
389 | 3087 BLOCK_INPUT; |
7209
ca5e04c9795c
(Fx_create_frame): Pass 0 as 3rd arg to x_wm_set_size_hint.
Richard M. Stallman <rms@gnu.org>
parents:
7172
diff
changeset
|
3088 x_wm_set_size_hint (f, window_prompting, 0); |
389 | 3089 UNBLOCK_INPUT; |
3090 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3091 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean); |
771 | 3092 f->no_split = minibuffer_only || EQ (tem, Qt); |
389 | 3093 |
8103
b0d56b9856c4
(Fx_create_frame): Add GC protection for local var `f'.
Paul Reilly <pmr@pajato.com>
parents:
8091
diff
changeset
|
3094 UNGCPRO; |
b0d56b9856c4
(Fx_create_frame): Add GC protection for local var `f'.
Paul Reilly <pmr@pajato.com>
parents:
8091
diff
changeset
|
3095 |
5429
87c67c389867
(Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents:
5229
diff
changeset
|
3096 /* It is now ok to make the frame official |
87c67c389867
(Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents:
5229
diff
changeset
|
3097 even if we get an error below. |
87c67c389867
(Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents:
5229
diff
changeset
|
3098 And the frame needs to be on Vframe_list |
87c67c389867
(Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents:
5229
diff
changeset
|
3099 or making it visible won't work. */ |
87c67c389867
(Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents:
5229
diff
changeset
|
3100 Vframe_list = Fcons (frame, Vframe_list); |
87c67c389867
(Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents:
5229
diff
changeset
|
3101 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3102 /* Now that the frame is official, it counts as a reference to |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3103 its display. */ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3104 FRAME_X_DISPLAY_INFO (f)->reference_count++; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3105 |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
3106 /* Make the window appear on the frame and enable display, |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3107 unless the caller says not to. However, with explicit parent, |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3108 Emacs cannot control visibility, so don't try. */ |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3109 if (! f->display.x->explicit_parent) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3110 { |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3111 Lisp_Object visibility; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3112 |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3113 visibility = x_get_arg (parms, Qvisibility, 0, 0, symbol); |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3114 if (EQ (visibility, Qunbound)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3115 visibility = Qt; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3116 |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3117 if (EQ (visibility, Qicon)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3118 x_iconify_frame (f); |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3119 else if (! NILP (visibility)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3120 x_make_frame_visible (f); |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3121 else |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3122 /* Must have been Qnil. */ |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3123 ; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3124 } |
771 | 3125 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3126 return unbind_to (count, frame); |
389 | 3127 } |
3128 | |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3129 /* FRAME is used only to get a handle on the X display. We don't pass the |
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3130 display info directly because we're called from frame.c, which doesn't |
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3131 know about that structure. */ |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3132 Lisp_Object |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3133 x_get_focus_frame (frame) |
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3134 struct frame *frame; |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3135 { |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3136 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (frame); |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3137 Lisp_Object xfocus; |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3138 if (! dpyinfo->x_focus_frame) |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3139 return Qnil; |
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3140 |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3141 XSETFRAME (xfocus, dpyinfo->x_focus_frame); |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3142 return xfocus; |
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3143 } |
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3144 |
771 | 3145 DEFUN ("focus-frame", Ffocus_frame, Sfocus_frame, 1, 1, 0, |
3146 "Set the focus on FRAME.") | |
3147 (frame) | |
3148 Lisp_Object frame; | |
389 | 3149 { |
771 | 3150 CHECK_LIVE_FRAME (frame, 0); |
3151 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3152 if (FRAME_X_P (XFRAME (frame))) |
389 | 3153 { |
3154 BLOCK_INPUT; | |
771 | 3155 x_focus_on_frame (XFRAME (frame)); |
389 | 3156 UNBLOCK_INPUT; |
771 | 3157 return frame; |
389 | 3158 } |
3159 | |
3160 return Qnil; | |
3161 } | |
3162 | |
771 | 3163 DEFUN ("unfocus-frame", Funfocus_frame, Sunfocus_frame, 0, 0, 0, |
3164 "If a frame has been focused, release it.") | |
389 | 3165 () |
3166 { | |
11772
b4b862c05017
(Funfocus_frame): Check for live X frame.
Richard M. Stallman <rms@gnu.org>
parents:
11707
diff
changeset
|
3167 if (FRAME_X_P (selected_frame)) |
389 | 3168 { |
11772
b4b862c05017
(Funfocus_frame): Check for live X frame.
Richard M. Stallman <rms@gnu.org>
parents:
11707
diff
changeset
|
3169 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (selected_frame); |
b4b862c05017
(Funfocus_frame): Check for live X frame.
Richard M. Stallman <rms@gnu.org>
parents:
11707
diff
changeset
|
3170 |
b4b862c05017
(Funfocus_frame): Check for live X frame.
Richard M. Stallman <rms@gnu.org>
parents:
11707
diff
changeset
|
3171 if (dpyinfo->x_focus_frame) |
b4b862c05017
(Funfocus_frame): Check for live X frame.
Richard M. Stallman <rms@gnu.org>
parents:
11707
diff
changeset
|
3172 { |
b4b862c05017
(Funfocus_frame): Check for live X frame.
Richard M. Stallman <rms@gnu.org>
parents:
11707
diff
changeset
|
3173 BLOCK_INPUT; |
b4b862c05017
(Funfocus_frame): Check for live X frame.
Richard M. Stallman <rms@gnu.org>
parents:
11707
diff
changeset
|
3174 x_unfocus_frame (dpyinfo->x_focus_frame); |
b4b862c05017
(Funfocus_frame): Check for live X frame.
Richard M. Stallman <rms@gnu.org>
parents:
11707
diff
changeset
|
3175 UNBLOCK_INPUT; |
b4b862c05017
(Funfocus_frame): Check for live X frame.
Richard M. Stallman <rms@gnu.org>
parents:
11707
diff
changeset
|
3176 } |
389 | 3177 } |
3178 | |
3179 return Qnil; | |
3180 } | |
3181 | |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3182 DEFUN ("x-list-fonts", Fx_list_fonts, Sx_list_fonts, 1, 3, 0, |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3183 "Return a list of the names of available fonts matching PATTERN.\n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3184 If optional arguments FACE and FRAME are specified, return only fonts\n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3185 the same size as FACE on FRAME.\n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3186 \n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3187 PATTERN is a string, perhaps with wildcard characters;\n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3188 the * character matches any substring, and\n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3189 the ? character matches any single character.\n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3190 PATTERN is case-insensitive.\n\ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3191 FACE is a face name--a symbol.\n\ |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3192 \n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3193 The return value is a list of strings, suitable as arguments to\n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3194 set-face-font.\n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3195 \n\ |
6783
3122395ded44
(Fx_list_fonts): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
6770
diff
changeset
|
3196 Fonts Emacs can't use (i.e. proportional fonts) may or may not be excluded\n\ |
3122395ded44
(Fx_list_fonts): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
6770
diff
changeset
|
3197 even if they match PATTERN and FACE.") |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3198 (pattern, face, frame) |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3199 Lisp_Object pattern, face, frame; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3200 { |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3201 int num_fonts; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3202 char **names; |
9813
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3203 #ifndef BROKEN_XLISTFONTSWITHINFO |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3204 XFontStruct *info; |
9813
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3205 #endif |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3206 XFontStruct *size_ref; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3207 Lisp_Object list; |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3208 FRAME_PTR f; |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3209 |
5948 | 3210 check_x (); |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3211 CHECK_STRING (pattern, 0); |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3212 if (!NILP (face)) |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3213 CHECK_SYMBOL (face, 1); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3214 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3215 f = check_x_frame (frame); |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3216 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3217 /* Determine the width standard for comparison with the fonts we find. */ |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3218 |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3219 if (NILP (face)) |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3220 size_ref = 0; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3221 else |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3222 { |
6882
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3223 int face_id; |
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3224 |
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3225 /* Don't die if we get called with a terminal frame. */ |
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3226 if (! FRAME_X_P (f)) |
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3227 error ("non-X frame used in `x-list-fonts'"); |
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3228 |
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3229 face_id = face_name_id_number (f, face); |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3230 |
3881
9d92b383b584
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3821
diff
changeset
|
3231 if (face_id < 0 || face_id >= FRAME_N_PARAM_FACES (f) |
9d92b383b584
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3821
diff
changeset
|
3232 || FRAME_PARAM_FACES (f) [face_id] == 0) |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
3233 size_ref = f->display.x->font; |
3347
53c89f73e85a
(Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents:
3339
diff
changeset
|
3234 else |
53c89f73e85a
(Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents:
3339
diff
changeset
|
3235 { |
3881
9d92b383b584
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3821
diff
changeset
|
3236 size_ref = FRAME_PARAM_FACES (f) [face_id]->font; |
3347
53c89f73e85a
(Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents:
3339
diff
changeset
|
3237 if (size_ref == (XFontStruct *) (~0)) |
53c89f73e85a
(Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents:
3339
diff
changeset
|
3238 size_ref = f->display.x->font; |
53c89f73e85a
(Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents:
3339
diff
changeset
|
3239 } |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3240 } |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3241 |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3242 /* See if we cached the result for this particular query. */ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3243 list = Fassoc (pattern, |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3244 XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr); |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3245 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3246 /* We have info in the cache for this PATTERN. */ |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3247 if (!NILP (list)) |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3248 { |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3249 Lisp_Object tem, newlist; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3250 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3251 /* We have info about this pattern. */ |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3252 list = XCONS (list)->cdr; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3253 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3254 if (size_ref == 0) |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3255 return list; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3256 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3257 BLOCK_INPUT; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3258 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3259 /* Filter the cached info and return just the fonts that match FACE. */ |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3260 newlist = Qnil; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3261 for (tem = list; CONSP (tem); tem = XCONS (tem)->cdr) |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3262 { |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3263 XFontStruct *thisinfo; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3264 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3265 thisinfo = XLoadQueryFont (FRAME_X_DISPLAY (f), |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3266 XSTRING (XCONS (tem)->car)->data); |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3267 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3268 if (thisinfo && same_size_fonts (thisinfo, size_ref)) |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3269 newlist = Fcons (XCONS (tem)->car, newlist); |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3270 |
12546
f4fb791df099
(Fx_list_fonts): Don't free thisinfo if it is 0.
Karl Heuer <kwzh@gnu.org>
parents:
12470
diff
changeset
|
3271 if (thisinfo != 0) |
f4fb791df099
(Fx_list_fonts): Don't free thisinfo if it is 0.
Karl Heuer <kwzh@gnu.org>
parents:
12470
diff
changeset
|
3272 XFreeFont (FRAME_X_DISPLAY (f), thisinfo); |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3273 } |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3274 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3275 UNBLOCK_INPUT; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3276 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3277 return newlist; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3278 } |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3279 |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3280 BLOCK_INPUT; |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3281 |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3282 /* Solaris 2.3 has a bug in XListFontsWithInfo. */ |
9813
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3283 #ifndef BROKEN_XLISTFONTSWITHINFO |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3284 if (size_ref) |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3285 names = XListFontsWithInfo (FRAME_X_DISPLAY (f), |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3286 XSTRING (pattern)->data, |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3287 2000, /* maxnames */ |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3288 &num_fonts, /* count_return */ |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3289 &info); /* info_return */ |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3290 else |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3291 #endif |
9813
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3292 names = XListFonts (FRAME_X_DISPLAY (f), |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3293 XSTRING (pattern)->data, |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3294 2000, /* maxnames */ |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3295 &num_fonts); /* count_return */ |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3296 |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3297 UNBLOCK_INPUT; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3298 |
3640
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3299 list = Qnil; |
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3300 |
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3301 if (names) |
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3302 { |
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3303 int i; |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3304 Lisp_Object full_list; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3305 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3306 /* Make a list of all the fonts we got back. |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3307 Store that in the font cache for the display. */ |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3308 full_list = Qnil; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3309 for (i = 0; i < num_fonts; i++) |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3310 full_list = Fcons (build_string (names[i]), full_list); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3311 XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3312 = Fcons (Fcons (pattern, full_list), |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3313 XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr); |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3314 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3315 /* Make a list of the fonts that have the right width. */ |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3316 list = Qnil; |
3640
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3317 for (i = 0; i < num_fonts; i++) |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3318 { |
9813
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3319 int keeper; |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3320 |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3321 if (!size_ref) |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3322 keeper = 1; |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3323 else |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3324 { |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3325 #ifdef BROKEN_XLISTFONTSWITHINFO |
9813
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3326 XFontStruct *thisinfo; |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3327 |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3328 BLOCK_INPUT; |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3329 thisinfo = XLoadQueryFont (FRAME_X_DISPLAY (f), names[i]); |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3330 UNBLOCK_INPUT; |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3331 |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3332 keeper = thisinfo && same_size_fonts (thisinfo, size_ref); |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3333 #else |
9813
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3334 keeper = same_size_fonts (&info[i], size_ref); |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3335 #endif |
9813
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3336 } |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3337 if (keeper) |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3338 list = Fcons (build_string (names[i]), list); |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3339 } |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3340 list = Fnreverse (list); |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3341 |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3342 BLOCK_INPUT; |
9813
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3343 #ifndef BROKEN_XLISTFONTSWITHINFO |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3344 if (size_ref) |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3345 XFreeFontInfo (names, info, num_fonts); |
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3346 else |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3347 #endif |
9813
e33e1c6864de
(Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents:
9808
diff
changeset
|
3348 XFreeFontNames (names); |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3349 UNBLOCK_INPUT; |
3640
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3350 } |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3351 |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3352 return list; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3353 } |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3354 |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3355 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3356 DEFUN ("x-color-defined-p", Fx_color_defined_p, Sx_color_defined_p, 1, 2, 0, |
11417
a5b136d16356
(Fx_color_defined_p): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
11353
diff
changeset
|
3357 "Return non-nil if color COLOR is supported on frame FRAME.\n\ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3358 If FRAME is omitted or nil, use the selected frame.") |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3359 (color, frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3360 Lisp_Object color, frame; |
389 | 3361 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3362 XColor foo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3363 FRAME_PTR f = check_x_frame (frame); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3364 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3365 CHECK_STRING (color, 1); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3366 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3367 if (defined_color (f, XSTRING (color)->data, &foo, 0)) |
8675
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3368 return Qt; |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3369 else |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3370 return Qnil; |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3371 } |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3372 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3373 DEFUN ("x-color-values", Fx_color_values, Sx_color_values, 1, 2, 0, |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3374 "Return a description of the color named COLOR on frame FRAME.\n\ |
8675
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3375 The value is a list of integer RGB values--(RED GREEN BLUE).\n\ |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3376 These values appear to range from 0 to 65280 or 65535, depending\n\ |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3377 on the system; white is (65280 65280 65280) or (65535 65535 65535).\n\ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3378 If FRAME is omitted or nil, use the selected frame.") |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3379 (color, frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3380 Lisp_Object color, frame; |
8675
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3381 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3382 XColor foo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3383 FRAME_PTR f = check_x_frame (frame); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3384 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3385 CHECK_STRING (color, 1); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3386 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3387 if (defined_color (f, XSTRING (color)->data, &foo, 0)) |
8655
4c69fcaaa037
(Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents:
8405
diff
changeset
|
3388 { |
4c69fcaaa037
(Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents:
8405
diff
changeset
|
3389 Lisp_Object rgb[3]; |
4c69fcaaa037
(Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents:
8405
diff
changeset
|
3390 |
4c69fcaaa037
(Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents:
8405
diff
changeset
|
3391 rgb[0] = make_number (foo.red); |
4c69fcaaa037
(Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents:
8405
diff
changeset
|
3392 rgb[1] = make_number (foo.green); |
4c69fcaaa037
(Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents:
8405
diff
changeset
|
3393 rgb[2] = make_number (foo.blue); |
4c69fcaaa037
(Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents:
8405
diff
changeset
|
3394 return Flist (3, rgb); |
4c69fcaaa037
(Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents:
8405
diff
changeset
|
3395 } |
389 | 3396 else |
3397 return Qnil; | |
3398 } | |
3399 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3400 DEFUN ("x-display-color-p", Fx_display_color_p, Sx_display_color_p, 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3401 "Return t if the X display supports color.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3402 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3403 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3404 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3405 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3406 Lisp_Object display; |
389 | 3407 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3408 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3409 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3410 if (dpyinfo->n_planes <= 2) |
389 | 3411 return Qnil; |
3412 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3413 switch (dpyinfo->visual->class) |
389 | 3414 { |
3415 case StaticColor: | |
3416 case PseudoColor: | |
3417 case TrueColor: | |
3418 case DirectColor: | |
3419 return Qt; | |
3420 | |
3421 default: | |
3422 return Qnil; | |
3423 } | |
3424 } | |
3425 | |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3426 DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p, |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3427 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3428 "Return t if the X display supports shades of gray.\n\ |
12347
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3429 Note that color displays do support shades of gray.\n\ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3430 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3431 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3432 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3433 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3434 Lisp_Object display; |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3435 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3436 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3437 |
12347
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3438 if (dpyinfo->n_planes <= 1) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3439 return Qnil; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3440 |
12347
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3441 switch (dpyinfo->visual->class) |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3442 { |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3443 case StaticColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3444 case PseudoColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3445 case TrueColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3446 case DirectColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3447 case StaticGray: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3448 case GrayScale: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3449 return Qt; |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3450 |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3451 default: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3452 return Qnil; |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3453 } |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3454 } |
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3455 |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3456 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
|
3457 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3458 "Returns the width in pixels of the X display DISPLAY.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3459 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3460 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3461 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3462 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3463 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3464 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3465 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3466 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3467 return make_number (dpyinfo->width); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3468 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3469 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3470 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
|
3471 Sx_display_pixel_height, 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3472 "Returns the height in pixels of the X display DISPLAY.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3473 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3474 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3475 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3476 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3477 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3478 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3479 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3480 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3481 return make_number (dpyinfo->height); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3482 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3483 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3484 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
|
3485 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3486 "Returns the number of bitplanes of the X display DISPLAY.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3487 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3488 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3489 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3490 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3491 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3492 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3493 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3494 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3495 return make_number (dpyinfo->n_planes); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3496 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3497 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3498 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
|
3499 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3500 "Returns the number of color cells of the X display DISPLAY.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3501 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3502 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3503 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3504 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3505 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3506 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3507 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3508 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3509 return make_number (DisplayCells (dpyinfo->display, |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3510 XScreenNumberOfScreen (dpyinfo->screen))); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3511 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3512 |
4279 | 3513 DEFUN ("x-server-max-request-size", Fx_server_max_request_size, |
3514 Sx_server_max_request_size, | |
3515 0, 1, 0, | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3516 "Returns the maximum request size of the X server of display DISPLAY.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3517 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3518 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3519 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3520 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3521 Lisp_Object display; |
4279 | 3522 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3523 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3524 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3525 return make_number (MAXREQUEST (dpyinfo->display)); |
4279 | 3526 } |
3527 | |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3528 DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3529 "Returns the vendor ID string of the X server of display DISPLAY.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3530 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3531 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3532 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3533 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3534 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3535 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3536 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3537 char *vendor = ServerVendor (dpyinfo->display); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3538 |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3539 if (! vendor) vendor = ""; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3540 return build_string (vendor); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3541 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3542 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3543 DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3544 "Returns the version numbers of the X server of display DISPLAY.\n\ |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3545 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
|
3546 version numbers of the X Protocol in use, and the vendor-specific release\n\ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3547 number. See also the function `x-server-vendor'.\n\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3548 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3549 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3550 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3551 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3552 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3553 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3554 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3555 Display *dpy = dpyinfo->display; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3556 |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3557 return Fcons (make_number (ProtocolVersion (dpy)), |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3558 Fcons (make_number (ProtocolRevision (dpy)), |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3559 Fcons (make_number (VendorRelease (dpy)), Qnil))); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3560 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3561 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3562 DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3563 "Returns the number of screens on the X server of display DISPLAY.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3564 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3565 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3566 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3567 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3568 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3569 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3570 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3571 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3572 return make_number (ScreenCount (dpyinfo->display)); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3573 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3574 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3575 DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3576 "Returns the height in millimeters of the X display DISPLAY.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3577 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3578 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3579 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3580 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3581 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3582 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3583 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3584 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3585 return make_number (HeightMMOfScreen (dpyinfo->screen)); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3586 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3587 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3588 DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3589 "Returns the width in millimeters of the X display DISPLAY.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3590 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3591 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3592 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3593 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3594 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3595 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3596 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3597 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3598 return make_number (WidthMMOfScreen (dpyinfo->screen)); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3599 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3600 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3601 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
|
3602 Sx_display_backing_store, 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3603 "Returns an indication of whether X display DISPLAY does backing store.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3604 The value may be `always', `when-mapped', or `not-useful'.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3605 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3606 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3607 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3608 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3609 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3610 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3611 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3612 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3613 switch (DoesBackingStore (dpyinfo->screen)) |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3614 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3615 case Always: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3616 return intern ("always"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3617 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3618 case WhenMapped: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3619 return intern ("when-mapped"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3620 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3621 case NotUseful: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3622 return intern ("not-useful"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3623 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3624 default: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3625 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
|
3626 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3627 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3628 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3629 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
|
3630 Sx_display_visual_class, 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3631 "Returns the visual class of the X display DISPLAY.\n\ |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3632 The value is one of the symbols `static-gray', `gray-scale',\n\ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3633 `static-color', `pseudo-color', `true-color', or `direct-color'.\n\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3634 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3635 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3636 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3637 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3638 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3639 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3640 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3641 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3642 switch (dpyinfo->visual->class) |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3643 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3644 case StaticGray: return (intern ("static-gray")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3645 case GrayScale: return (intern ("gray-scale")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3646 case StaticColor: return (intern ("static-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3647 case PseudoColor: return (intern ("pseudo-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3648 case TrueColor: return (intern ("true-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3649 case DirectColor: return (intern ("direct-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3650 default: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3651 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
|
3652 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3653 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3654 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3655 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
|
3656 Sx_display_save_under, 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3657 "Returns t if the X display DISPLAY supports the save-under feature.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3658 The optional argument DISPLAY specifies which display to ask about.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3659 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3660 If omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3661 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3662 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3663 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3664 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3665 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3666 if (DoesSaveUnders (dpyinfo->screen) == True) |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3667 return Qt; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3668 else |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3669 return Qnil; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3670 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3671 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3672 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3673 x_pixel_width (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3674 register struct frame *f; |
389 | 3675 { |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3676 return PIXEL_WIDTH (f); |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3677 } |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3678 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3679 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3680 x_pixel_height (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3681 register struct frame *f; |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3682 { |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3683 return PIXEL_HEIGHT (f); |
389 | 3684 } |
3685 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3686 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3687 x_char_width (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3688 register struct frame *f; |
389 | 3689 { |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3690 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
|
3691 } |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3692 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3693 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3694 x_char_height (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3695 register struct frame *f; |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3696 { |
6770
a41377a11bf0
(x_char_height): Use line_height field.
Richard M. Stallman <rms@gnu.org>
parents:
6759
diff
changeset
|
3697 return f->display.x->line_height; |
389 | 3698 } |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3699 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3700 int |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3701 x_screen_planes (frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3702 Lisp_Object frame; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3703 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3704 return FRAME_X_DISPLAY_INFO (XFRAME (frame))->n_planes; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3705 } |
389 | 3706 |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
3707 #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
|
3708 |
771 | 3709 /* Draw a rectangle on the frame with left top corner including |
389 | 3710 the character specified by LEFT_CHAR and TOP_CHAR. The rectangle is |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3711 CHARS by LINES wide and long and is the color of the cursor. */ |
389 | 3712 |
3713 void | |
771 | 3714 x_rectangle (f, gc, left_char, top_char, chars, lines) |
3715 register struct frame *f; | |
389 | 3716 GC gc; |
3717 register int top_char, left_char, chars, lines; | |
3718 { | |
3719 int width; | |
3720 int height; | |
771 | 3721 int left = (left_char * FONT_WIDTH (f->display.x->font) |
3722 + f->display.x->internal_border_width); | |
6770
a41377a11bf0
(x_char_height): Use line_height field.
Richard M. Stallman <rms@gnu.org>
parents:
6759
diff
changeset
|
3723 int top = (top_char * f->display.x->line_height |
771 | 3724 + f->display.x->internal_border_width); |
389 | 3725 |
3726 if (chars < 0) | |
771 | 3727 width = FONT_WIDTH (f->display.x->font) / 2; |
389 | 3728 else |
771 | 3729 width = FONT_WIDTH (f->display.x->font) * chars; |
389 | 3730 if (lines < 0) |
6770
a41377a11bf0
(x_char_height): Use line_height field.
Richard M. Stallman <rms@gnu.org>
parents:
6759
diff
changeset
|
3731 height = f->display.x->line_height / 2; |
389 | 3732 else |
6770
a41377a11bf0
(x_char_height): Use line_height field.
Richard M. Stallman <rms@gnu.org>
parents:
6759
diff
changeset
|
3733 height = f->display.x->line_height * lines; |
771 | 3734 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3735 XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 3736 gc, left, top, width, height); |
3737 } | |
3738 | |
3739 DEFUN ("x-draw-rectangle", Fx_draw_rectangle, Sx_draw_rectangle, 5, 5, 0, | |
771 | 3740 "Draw a rectangle on FRAME between coordinates specified by\n\ |
389 | 3741 numbers X0, Y0, X1, Y1 in the cursor pixel.") |
771 | 3742 (frame, X0, Y0, X1, Y1) |
3743 register Lisp_Object frame, X0, X1, Y0, Y1; | |
389 | 3744 { |
3745 register int x0, y0, x1, y1, top, left, n_chars, n_lines; | |
3746 | |
771 | 3747 CHECK_LIVE_FRAME (frame, 0); |
389 | 3748 CHECK_NUMBER (X0, 0); |
3749 CHECK_NUMBER (Y0, 1); | |
3750 CHECK_NUMBER (X1, 2); | |
3751 CHECK_NUMBER (Y1, 3); | |
3752 | |
3753 x0 = XINT (X0); | |
3754 x1 = XINT (X1); | |
3755 y0 = XINT (Y0); | |
3756 y1 = XINT (Y1); | |
3757 | |
3758 if (y1 > y0) | |
3759 { | |
3760 top = y0; | |
3761 n_lines = y1 - y0 + 1; | |
3762 } | |
3763 else | |
3764 { | |
3765 top = y1; | |
3766 n_lines = y0 - y1 + 1; | |
3767 } | |
3768 | |
3769 if (x1 > x0) | |
3770 { | |
3771 left = x0; | |
3772 n_chars = x1 - x0 + 1; | |
3773 } | |
3774 else | |
3775 { | |
3776 left = x1; | |
3777 n_chars = x0 - x1 + 1; | |
3778 } | |
3779 | |
3780 BLOCK_INPUT; | |
771 | 3781 x_rectangle (XFRAME (frame), XFRAME (frame)->display.x->cursor_gc, |
389 | 3782 left, top, n_chars, n_lines); |
3783 UNBLOCK_INPUT; | |
3784 | |
3785 return Qt; | |
3786 } | |
3787 | |
3788 DEFUN ("x-erase-rectangle", Fx_erase_rectangle, Sx_erase_rectangle, 5, 5, 0, | |
771 | 3789 "Draw a rectangle drawn on FRAME between coordinates\n\ |
389 | 3790 X0, Y0, X1, Y1 in the regular background-pixel.") |
771 | 3791 (frame, X0, Y0, X1, Y1) |
3792 register Lisp_Object frame, X0, Y0, X1, Y1; | |
389 | 3793 { |
3794 register int x0, y0, x1, y1, top, left, n_chars, n_lines; | |
3795 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3796 CHECK_LIVE_FRAME (frame, 0); |
389 | 3797 CHECK_NUMBER (X0, 0); |
3798 CHECK_NUMBER (Y0, 1); | |
3799 CHECK_NUMBER (X1, 2); | |
3800 CHECK_NUMBER (Y1, 3); | |
3801 | |
3802 x0 = XINT (X0); | |
3803 x1 = XINT (X1); | |
3804 y0 = XINT (Y0); | |
3805 y1 = XINT (Y1); | |
3806 | |
3807 if (y1 > y0) | |
3808 { | |
3809 top = y0; | |
3810 n_lines = y1 - y0 + 1; | |
3811 } | |
3812 else | |
3813 { | |
3814 top = y1; | |
3815 n_lines = y0 - y1 + 1; | |
3816 } | |
3817 | |
3818 if (x1 > x0) | |
3819 { | |
3820 left = x0; | |
3821 n_chars = x1 - x0 + 1; | |
3822 } | |
3823 else | |
3824 { | |
3825 left = x1; | |
3826 n_chars = x0 - x1 + 1; | |
3827 } | |
3828 | |
3829 BLOCK_INPUT; | |
771 | 3830 x_rectangle (XFRAME (frame), XFRAME (frame)->display.x->reverse_gc, |
389 | 3831 left, top, n_chars, n_lines); |
3832 UNBLOCK_INPUT; | |
3833 | |
3834 return Qt; | |
3835 } | |
3836 | |
3837 /* Draw lines around the text region beginning at the character position | |
3838 TOP_X, TOP_Y and ending at BOTTOM_X and BOTTOM_Y. GC specifies the | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3839 pixel and line characteristics. */ |
389 | 3840 |
771 | 3841 #define line_len(line) (FRAME_CURRENT_GLYPHS (f)->used[(line)]) |
389 | 3842 |
3843 static void | |
771 | 3844 outline_region (f, gc, top_x, top_y, bottom_x, bottom_y) |
3845 register struct frame *f; | |
389 | 3846 GC gc; |
3847 int top_x, top_y, bottom_x, bottom_y; | |
3848 { | |
771 | 3849 register int ibw = f->display.x->internal_border_width; |
3850 register int font_w = FONT_WIDTH (f->display.x->font); | |
6770
a41377a11bf0
(x_char_height): Use line_height field.
Richard M. Stallman <rms@gnu.org>
parents:
6759
diff
changeset
|
3851 register int font_h = f->display.x->line_height; |
389 | 3852 int y = top_y; |
3853 int x = line_len (y); | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3854 XPoint *pixel_points |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3855 = (XPoint *) alloca (((bottom_y - top_y + 2) * 4) * sizeof (XPoint)); |
389 | 3856 register XPoint *this_point = pixel_points; |
3857 | |
3858 /* Do the horizontal top line/lines */ | |
3859 if (top_x == 0) | |
3860 { | |
3861 this_point->x = ibw; | |
3862 this_point->y = ibw + (font_h * top_y); | |
3863 this_point++; | |
3864 if (x == 0) | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3865 this_point->x = ibw + (font_w / 2); /* Half-size for newline chars. */ |
389 | 3866 else |
3867 this_point->x = ibw + (font_w * x); | |
3868 this_point->y = (this_point - 1)->y; | |
3869 } | |
3870 else | |
3871 { | |
3872 this_point->x = ibw; | |
3873 this_point->y = ibw + (font_h * (top_y + 1)); | |
3874 this_point++; | |
3875 this_point->x = ibw + (font_w * top_x); | |
3876 this_point->y = (this_point - 1)->y; | |
3877 this_point++; | |
3878 this_point->x = (this_point - 1)->x; | |
3879 this_point->y = ibw + (font_h * top_y); | |
3880 this_point++; | |
3881 this_point->x = ibw + (font_w * x); | |
3882 this_point->y = (this_point - 1)->y; | |
3883 } | |
3884 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3885 /* Now do the right side. */ |
389 | 3886 while (y < bottom_y) |
3887 { /* Right vertical edge */ | |
3888 this_point++; | |
3889 this_point->x = (this_point - 1)->x; | |
3890 this_point->y = ibw + (font_h * (y + 1)); | |
3891 this_point++; | |
3892 | |
3893 y++; /* Horizontal connection to next line */ | |
3894 x = line_len (y); | |
3895 if (x == 0) | |
3896 this_point->x = ibw + (font_w / 2); | |
3897 else | |
3898 this_point->x = ibw + (font_w * x); | |
3899 | |
3900 this_point->y = (this_point - 1)->y; | |
3901 } | |
3902 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3903 /* Now do the bottom and connect to the top left point. */ |
389 | 3904 this_point->x = ibw + (font_w * (bottom_x + 1)); |
3905 | |
3906 this_point++; | |
3907 this_point->x = (this_point - 1)->x; | |
3908 this_point->y = ibw + (font_h * (bottom_y + 1)); | |
3909 this_point++; | |
3910 this_point->x = ibw; | |
3911 this_point->y = (this_point - 1)->y; | |
3912 this_point++; | |
3913 this_point->x = pixel_points->x; | |
3914 this_point->y = pixel_points->y; | |
3915 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3916 XDrawLines (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 3917 gc, pixel_points, |
3918 (this_point - pixel_points + 1), CoordModeOrigin); | |
3919 } | |
3920 | |
3921 DEFUN ("x-contour-region", Fx_contour_region, Sx_contour_region, 1, 1, 0, | |
3922 "Highlight the region between point and the character under the mouse\n\ | |
771 | 3923 selected frame.") |
389 | 3924 (event) |
3925 register Lisp_Object event; | |
3926 { | |
3927 register int x0, y0, x1, y1; | |
771 | 3928 register struct frame *f = selected_frame; |
389 | 3929 register int p1, p2; |
3930 | |
3931 CHECK_CONS (event, 0); | |
3932 | |
3933 BLOCK_INPUT; | |
3934 x0 = XINT (Fcar (Fcar (event))); | |
3935 y0 = XINT (Fcar (Fcdr (Fcar (event)))); | |
3936 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3937 /* If the mouse is past the end of the line, don't that area. */ |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3938 /* ReWrite this... */ |
389 | 3939 |
771 | 3940 x1 = f->cursor_x; |
3941 y1 = f->cursor_y; | |
389 | 3942 |
3943 if (y1 > y0) /* point below mouse */ | |
771 | 3944 outline_region (f, f->display.x->cursor_gc, |
389 | 3945 x0, y0, x1, y1); |
3946 else if (y1 < y0) /* point above mouse */ | |
771 | 3947 outline_region (f, f->display.x->cursor_gc, |
389 | 3948 x1, y1, x0, y0); |
3949 else /* same line: draw horizontal rectangle */ | |
3950 { | |
3951 if (x1 > x0) | |
771 | 3952 x_rectangle (f, f->display.x->cursor_gc, |
389 | 3953 x0, y0, (x1 - x0 + 1), 1); |
3954 else if (x1 < x0) | |
771 | 3955 x_rectangle (f, f->display.x->cursor_gc, |
389 | 3956 x1, y1, (x0 - x1 + 1), 1); |
3957 } | |
3958 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3959 XFlush (FRAME_X_DISPLAY (f)); |
389 | 3960 UNBLOCK_INPUT; |
3961 | |
3962 return Qnil; | |
3963 } | |
3964 | |
3965 DEFUN ("x-uncontour-region", Fx_uncontour_region, Sx_uncontour_region, 1, 1, 0, | |
3966 "Erase any highlighting of the region between point and the character\n\ | |
771 | 3967 at X, Y on the selected frame.") |
389 | 3968 (event) |
3969 register Lisp_Object event; | |
3970 { | |
3971 register int x0, y0, x1, y1; | |
771 | 3972 register struct frame *f = selected_frame; |
389 | 3973 |
3974 BLOCK_INPUT; | |
3975 x0 = XINT (Fcar (Fcar (event))); | |
3976 y0 = XINT (Fcar (Fcdr (Fcar (event)))); | |
771 | 3977 x1 = f->cursor_x; |
3978 y1 = f->cursor_y; | |
389 | 3979 |
3980 if (y1 > y0) /* point below mouse */ | |
771 | 3981 outline_region (f, f->display.x->reverse_gc, |
389 | 3982 x0, y0, x1, y1); |
3983 else if (y1 < y0) /* point above mouse */ | |
771 | 3984 outline_region (f, f->display.x->reverse_gc, |
389 | 3985 x1, y1, x0, y0); |
3986 else /* same line: draw horizontal rectangle */ | |
3987 { | |
3988 if (x1 > x0) | |
771 | 3989 x_rectangle (f, f->display.x->reverse_gc, |
389 | 3990 x0, y0, (x1 - x0 + 1), 1); |
3991 else if (x1 < x0) | |
771 | 3992 x_rectangle (f, f->display.x->reverse_gc, |
389 | 3993 x1, y1, (x0 - x1 + 1), 1); |
3994 } | |
3995 UNBLOCK_INPUT; | |
3996 | |
3997 return Qnil; | |
3998 } | |
3999 | |
4000 #if 0 | |
4001 int contour_begin_x, contour_begin_y; | |
4002 int contour_end_x, contour_end_y; | |
4003 int contour_npoints; | |
4004 | |
4005 /* Clip the top part of the contour lines down (and including) line Y_POS. | |
4006 If X_POS is in the middle (rather than at the end) of the line, drop | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4007 down a line at that character. */ |
389 | 4008 |
4009 static void | |
4010 clip_contour_top (y_pos, x_pos) | |
4011 { | |
4012 register XPoint *begin = contour_lines[y_pos].top_left; | |
4013 register XPoint *end; | |
4014 register int npoints; | |
771 | 4015 register struct display_line *line = selected_frame->phys_lines[y_pos + 1]; |
389 | 4016 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4017 if (x_pos >= line->len - 1) /* Draw one, straight horizontal line. */ |
389 | 4018 { |
4019 end = contour_lines[y_pos].top_right; | |
4020 npoints = (end - begin + 1); | |
4021 XDrawLines (x_current_display, contour_window, | |
4022 contour_erase_gc, begin_erase, npoints, CoordModeOrigin); | |
4023 | |
4024 bcopy (end, begin + 1, contour_last_point - end + 1); | |
4025 contour_last_point -= (npoints - 2); | |
4026 XDrawLines (x_current_display, contour_window, | |
4027 contour_erase_gc, begin, 2, CoordModeOrigin); | |
4028 XFlush (x_current_display); | |
4029 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4030 /* Now, update contour_lines structure. */ |
389 | 4031 } |
4032 /* ______. */ | |
4033 else /* |________*/ | |
4034 { | |
4035 register XPoint *p = begin + 1; | |
4036 end = contour_lines[y_pos].bottom_right; | |
4037 npoints = (end - begin + 1); | |
4038 XDrawLines (x_current_display, contour_window, | |
4039 contour_erase_gc, begin_erase, npoints, CoordModeOrigin); | |
4040 | |
4041 p->y = begin->y; | |
4042 p->x = ibw + (font_w * (x_pos + 1)); | |
4043 p++; | |
4044 p->y = begin->y + font_h; | |
4045 p->x = (p - 1)->x; | |
4046 bcopy (end, begin + 3, contour_last_point - end + 1); | |
4047 contour_last_point -= (npoints - 5); | |
4048 XDrawLines (x_current_display, contour_window, | |
4049 contour_erase_gc, begin, 4, CoordModeOrigin); | |
4050 XFlush (x_current_display); | |
4051 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4052 /* Now, update contour_lines structure. */ |
389 | 4053 } |
4054 } | |
4055 | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3512
diff
changeset
|
4056 /* Erase the top horizontal lines of the contour, and then extend |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4057 the contour upwards. */ |
389 | 4058 |
4059 static void | |
4060 extend_contour_top (line) | |
4061 { | |
4062 } | |
4063 | |
4064 static void | |
4065 clip_contour_bottom (x_pos, y_pos) | |
4066 int x_pos, y_pos; | |
4067 { | |
4068 } | |
4069 | |
4070 static void | |
4071 extend_contour_bottom (x_pos, y_pos) | |
4072 { | |
4073 } | |
4074 | |
4075 DEFUN ("x-select-region", Fx_select_region, Sx_select_region, 1, 1, "e", | |
4076 "") | |
4077 (event) | |
4078 Lisp_Object event; | |
4079 { | |
771 | 4080 register struct frame *f = selected_frame; |
4081 register int point_x = f->cursor_x; | |
4082 register int point_y = f->cursor_y; | |
389 | 4083 register int mouse_below_point; |
4084 register Lisp_Object obj; | |
4085 register int x_contour_x, x_contour_y; | |
4086 | |
4087 x_contour_x = x_mouse_x; | |
4088 x_contour_y = x_mouse_y; | |
4089 if (x_contour_y > point_y || (x_contour_y == point_y | |
4090 && x_contour_x > point_x)) | |
4091 { | |
4092 mouse_below_point = 1; | |
771 | 4093 outline_region (f, f->display.x->cursor_gc, point_x, point_y, |
389 | 4094 x_contour_x, x_contour_y); |
4095 } | |
4096 else | |
4097 { | |
4098 mouse_below_point = 0; | |
771 | 4099 outline_region (f, f->display.x->cursor_gc, x_contour_x, x_contour_y, |
389 | 4100 point_x, point_y); |
4101 } | |
4102 | |
4103 while (1) | |
4104 { | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
4105 obj = read_char (-1, 0, 0, Qnil, 0); |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
4106 if (!CONSP (obj)) |
389 | 4107 break; |
4108 | |
4109 if (mouse_below_point) | |
4110 { | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4111 if (x_mouse_y <= point_y) /* Flipped. */ |
389 | 4112 { |
4113 mouse_below_point = 0; | |
4114 | |
771 | 4115 outline_region (f, f->display.x->reverse_gc, point_x, point_y, |
389 | 4116 x_contour_x, x_contour_y); |
771 | 4117 outline_region (f, f->display.x->cursor_gc, x_mouse_x, x_mouse_y, |
389 | 4118 point_x, point_y); |
4119 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4120 else if (x_mouse_y < x_contour_y) /* Bottom clipped. */ |
389 | 4121 { |
4122 clip_contour_bottom (x_mouse_y); | |
4123 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4124 else if (x_mouse_y > x_contour_y) /* Bottom extended. */ |
389 | 4125 { |
4126 extend_bottom_contour (x_mouse_y); | |
4127 } | |
4128 | |
4129 x_contour_x = x_mouse_x; | |
4130 x_contour_y = x_mouse_y; | |
4131 } | |
4132 else /* mouse above or same line as point */ | |
4133 { | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4134 if (x_mouse_y >= point_y) /* Flipped. */ |
389 | 4135 { |
4136 mouse_below_point = 1; | |
4137 | |
771 | 4138 outline_region (f, f->display.x->reverse_gc, |
389 | 4139 x_contour_x, x_contour_y, point_x, point_y); |
771 | 4140 outline_region (f, f->display.x->cursor_gc, point_x, point_y, |
389 | 4141 x_mouse_x, x_mouse_y); |
4142 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4143 else if (x_mouse_y > x_contour_y) /* Top clipped. */ |
389 | 4144 { |
4145 clip_contour_top (x_mouse_y); | |
4146 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4147 else if (x_mouse_y < x_contour_y) /* Top extended. */ |
389 | 4148 { |
4149 extend_contour_top (x_mouse_y); | |
4150 } | |
4151 } | |
4152 } | |
4153 | |
1601
a371ec79bc31
* xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents:
1528
diff
changeset
|
4154 unread_command_event = obj; |
389 | 4155 if (mouse_below_point) |
4156 { | |
4157 contour_begin_x = point_x; | |
4158 contour_begin_y = point_y; | |
4159 contour_end_x = x_contour_x; | |
4160 contour_end_y = x_contour_y; | |
4161 } | |
4162 else | |
4163 { | |
4164 contour_begin_x = x_contour_x; | |
4165 contour_begin_y = x_contour_y; | |
4166 contour_end_x = point_x; | |
4167 contour_end_y = point_y; | |
4168 } | |
4169 } | |
4170 #endif | |
4171 | |
4172 DEFUN ("x-horizontal-line", Fx_horizontal_line, Sx_horizontal_line, 1, 1, "e", | |
4173 "") | |
4174 (event) | |
4175 Lisp_Object event; | |
4176 { | |
4177 register Lisp_Object obj; | |
771 | 4178 struct frame *f = selected_frame; |
389 | 4179 register struct window *w = XWINDOW (selected_window); |
771 | 4180 register GC line_gc = f->display.x->cursor_gc; |
4181 register GC erase_gc = f->display.x->reverse_gc; | |
389 | 4182 #if 0 |
4183 char dash_list[] = {6, 4, 6, 4}; | |
4184 int dashes = 4; | |
4185 XGCValues gc_values; | |
4186 #endif | |
4187 register int previous_y; | |
6770
a41377a11bf0
(x_char_height): Use line_height field.
Richard M. Stallman <rms@gnu.org>
parents:
6759
diff
changeset
|
4188 register int line = (x_mouse_y + 1) * f->display.x->line_height |
771 | 4189 + f->display.x->internal_border_width; |
4190 register int left = f->display.x->internal_border_width | |
389 | 4191 + (w->left |
771 | 4192 * FONT_WIDTH (f->display.x->font)); |
389 | 4193 register int right = left + (w->width |
771 | 4194 * FONT_WIDTH (f->display.x->font)) |
4195 - f->display.x->internal_border_width; | |
389 | 4196 |
4197 #if 0 | |
4198 BLOCK_INPUT; | |
771 | 4199 gc_values.foreground = f->display.x->cursor_pixel; |
4200 gc_values.background = f->display.x->background_pixel; | |
389 | 4201 gc_values.line_width = 1; |
4202 gc_values.line_style = LineOnOffDash; | |
4203 gc_values.cap_style = CapRound; | |
4204 gc_values.join_style = JoinRound; | |
4205 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4206 line_gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4207 GCLineStyle | GCJoinStyle | GCCapStyle |
4208 | GCLineWidth | GCForeground | GCBackground, | |
4209 &gc_values); | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4210 XSetDashes (FRAME_X_DISPLAY (f), line_gc, 0, dash_list, dashes); |
771 | 4211 gc_values.foreground = f->display.x->background_pixel; |
4212 gc_values.background = f->display.x->foreground_pixel; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4213 erase_gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4214 GCLineStyle | GCJoinStyle | GCCapStyle |
4215 | GCLineWidth | GCForeground | GCBackground, | |
4216 &gc_values); | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4217 XSetDashes (FRAME_X_DISPLAY (f), erase_gc, 0, dash_list, dashes); |
12051
f193ce9efe24
(x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents:
12046
diff
changeset
|
4218 UNBLOCK_INPUT; |
389 | 4219 #endif |
4220 | |
4221 while (1) | |
4222 { | |
4223 BLOCK_INPUT; | |
4224 if (x_mouse_y >= XINT (w->top) | |
4225 && x_mouse_y < XINT (w->top) + XINT (w->height) - 1) | |
4226 { | |
4227 previous_y = x_mouse_y; | |
6770
a41377a11bf0
(x_char_height): Use line_height field.
Richard M. Stallman <rms@gnu.org>
parents:
6759
diff
changeset
|
4228 line = (x_mouse_y + 1) * f->display.x->line_height |
771 | 4229 + f->display.x->internal_border_width; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4230 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4231 line_gc, left, line, right, line); |
4232 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4233 XFlush (FRAME_X_DISPLAY (f)); |
389 | 4234 UNBLOCK_INPUT; |
4235 | |
4236 do | |
4237 { | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
4238 obj = read_char (-1, 0, 0, Qnil, 0); |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
4239 if (!CONSP (obj) |
389 | 4240 || (! EQ (Fcar (Fcdr (Fcdr (obj))), |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
4241 Qvertical_scroll_bar)) |
389 | 4242 || x_mouse_grabbed) |
4243 { | |
4244 BLOCK_INPUT; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4245 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4246 erase_gc, left, line, right, line); |
1601
a371ec79bc31
* xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents:
1528
diff
changeset
|
4247 unread_command_event = obj; |
389 | 4248 #if 0 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4249 XFreeGC (FRAME_X_DISPLAY (f), line_gc); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4250 XFreeGC (FRAME_X_DISPLAY (f), erase_gc); |
389 | 4251 #endif |
12051
f193ce9efe24
(x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents:
12046
diff
changeset
|
4252 UNBLOCK_INPUT; |
389 | 4253 return Qnil; |
4254 } | |
4255 } | |
4256 while (x_mouse_y == previous_y); | |
4257 | |
4258 BLOCK_INPUT; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4259 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4260 erase_gc, left, line, right, line); |
4261 UNBLOCK_INPUT; | |
4262 } | |
4263 } | |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
4264 #endif |
389 | 4265 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4266 #if 0 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4267 /* These keep track of the rectangle following the pointer. */ |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4268 int mouse_track_top, mouse_track_left, mouse_track_width; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4269 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4270 /* Offset in buffer of character under the pointer, or 0. */ |
389 | 4271 int mouse_buffer_offset; |
4272 | |
4273 DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 0, 0, 0, | |
4274 "Track the pointer.") | |
4275 () | |
4276 { | |
4277 static Cursor current_pointer_shape; | |
771 | 4278 FRAME_PTR f = x_mouse_frame; |
389 | 4279 |
4280 BLOCK_INPUT; | |
771 | 4281 if (EQ (Vmouse_frame_part, Qtext_part) |
4282 && (current_pointer_shape != f->display.x->nontext_cursor)) | |
389 | 4283 { |
4284 unsigned char c; | |
4285 struct buffer *buf; | |
4286 | |
771 | 4287 current_pointer_shape = f->display.x->nontext_cursor; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4288 XDefineCursor (FRAME_X_DISPLAY (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
|
4289 FRAME_X_WINDOW (f), |
389 | 4290 current_pointer_shape); |
4291 | |
4292 buf = XBUFFER (XWINDOW (Vmouse_window)->buffer); | |
4293 c = *(BUF_CHAR_ADDRESS (buf, mouse_buffer_offset)); | |
4294 } | |
771 | 4295 else if (EQ (Vmouse_frame_part, Qmodeline_part) |
4296 && (current_pointer_shape != f->display.x->modeline_cursor)) | |
389 | 4297 { |
771 | 4298 current_pointer_shape = f->display.x->modeline_cursor; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4299 XDefineCursor (FRAME_X_DISPLAY (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
|
4300 FRAME_X_WINDOW (f), |
389 | 4301 current_pointer_shape); |
4302 } | |
4303 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4304 XFlush (FRAME_X_DISPLAY (f)); |
389 | 4305 UNBLOCK_INPUT; |
4306 } | |
4307 #endif | |
4308 | |
4309 #if 0 | |
4310 DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 1, 1, "e", | |
4311 "Draw rectangle around character under mouse pointer, if there is one.") | |
4312 (event) | |
4313 Lisp_Object event; | |
4314 { | |
4315 struct window *w = XWINDOW (Vmouse_window); | |
771 | 4316 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
389 | 4317 struct buffer *b = XBUFFER (w->buffer); |
4318 Lisp_Object obj; | |
4319 | |
4320 if (! EQ (Vmouse_window, selected_window)) | |
4321 return Qnil; | |
4322 | |
4323 if (EQ (event, Qnil)) | |
4324 { | |
4325 int x, y; | |
4326 | |
771 | 4327 x_read_mouse_position (selected_frame, &x, &y); |
389 | 4328 } |
4329 | |
4330 BLOCK_INPUT; | |
4331 mouse_track_width = 0; | |
4332 mouse_track_left = mouse_track_top = -1; | |
4333 | |
4334 do | |
4335 { | |
4336 if ((x_mouse_x != mouse_track_left | |
4337 && (x_mouse_x < mouse_track_left | |
4338 || x_mouse_x > (mouse_track_left + mouse_track_width))) | |
4339 || x_mouse_y != mouse_track_top) | |
4340 { | |
4341 int hp = 0; /* Horizontal position */ | |
771 | 4342 int len = FRAME_CURRENT_GLYPHS (f)->used[x_mouse_y]; |
4343 int p = FRAME_CURRENT_GLYPHS (f)->bufp[x_mouse_y]; | |
389 | 4344 int tab_width = XINT (b->tab_width); |
485 | 4345 int ctl_arrow_p = !NILP (b->ctl_arrow); |
389 | 4346 unsigned char c; |
4347 int mode_line_vpos = XFASTINT (w->height) + XFASTINT (w->top) - 1; | |
4348 int in_mode_line = 0; | |
4349 | |
771 | 4350 if (! FRAME_CURRENT_GLYPHS (f)->enable[x_mouse_y]) |
389 | 4351 break; |
4352 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4353 /* Erase previous rectangle. */ |
389 | 4354 if (mouse_track_width) |
4355 { | |
771 | 4356 x_rectangle (f, f->display.x->reverse_gc, |
389 | 4357 mouse_track_left, mouse_track_top, |
4358 mouse_track_width, 1); | |
4359 | |
771 | 4360 if ((mouse_track_left == f->phys_cursor_x |
4361 || mouse_track_left == f->phys_cursor_x - 1) | |
4362 && mouse_track_top == f->phys_cursor_y) | |
389 | 4363 { |
771 | 4364 x_display_cursor (f, 1); |
389 | 4365 } |
4366 } | |
4367 | |
4368 mouse_track_left = x_mouse_x; | |
4369 mouse_track_top = x_mouse_y; | |
4370 mouse_track_width = 0; | |
4371 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4372 if (mouse_track_left > len) /* Past the end of line. */ |
389 | 4373 goto draw_or_not; |
4374 | |
4375 if (mouse_track_top == mode_line_vpos) | |
4376 { | |
4377 in_mode_line = 1; | |
4378 goto draw_or_not; | |
4379 } | |
4380 | |
4381 if (tab_width <= 0 || tab_width > 20) tab_width = 8; | |
4382 do | |
4383 { | |
4384 c = FETCH_CHAR (p); | |
771 | 4385 if (len == f->width && hp == len - 1 && c != '\n') |
389 | 4386 goto draw_or_not; |
4387 | |
4388 switch (c) | |
4389 { | |
4390 case '\t': | |
4391 mouse_track_width = tab_width - (hp % tab_width); | |
4392 p++; | |
4393 hp += mouse_track_width; | |
4394 if (hp > x_mouse_x) | |
4395 { | |
4396 mouse_track_left = hp - mouse_track_width; | |
4397 goto draw_or_not; | |
4398 } | |
4399 continue; | |
4400 | |
4401 case '\n': | |
4402 mouse_track_width = -1; | |
4403 goto draw_or_not; | |
4404 | |
4405 default: | |
4406 if (ctl_arrow_p && (c < 040 || c == 0177)) | |
4407 { | |
4408 if (p > ZV) | |
4409 goto draw_or_not; | |
4410 | |
4411 mouse_track_width = 2; | |
4412 p++; | |
4413 hp +=2; | |
4414 if (hp > x_mouse_x) | |
4415 { | |
4416 mouse_track_left = hp - mouse_track_width; | |
4417 goto draw_or_not; | |
4418 } | |
4419 } | |
4420 else | |
4421 { | |
4422 mouse_track_width = 1; | |
4423 p++; | |
4424 hp++; | |
4425 } | |
4426 continue; | |
4427 } | |
4428 } | |
4429 while (hp <= x_mouse_x); | |
4430 | |
4431 draw_or_not: | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4432 if (mouse_track_width) /* Over text; use text pointer shape. */ |
389 | 4433 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4434 XDefineCursor (FRAME_X_DISPLAY (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
|
4435 FRAME_X_WINDOW (f), |
771 | 4436 f->display.x->text_cursor); |
4437 x_rectangle (f, f->display.x->cursor_gc, | |
389 | 4438 mouse_track_left, mouse_track_top, |
4439 mouse_track_width, 1); | |
4440 } | |
4441 else if (in_mode_line) | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4442 XDefineCursor (FRAME_X_DISPLAY (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
|
4443 FRAME_X_WINDOW (f), |
771 | 4444 f->display.x->modeline_cursor); |
389 | 4445 else |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4446 XDefineCursor (FRAME_X_DISPLAY (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
|
4447 FRAME_X_WINDOW (f), |
771 | 4448 f->display.x->nontext_cursor); |
389 | 4449 } |
4450 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4451 XFlush (FRAME_X_DISPLAY (f)); |
389 | 4452 UNBLOCK_INPUT; |
4453 | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
4454 obj = read_char (-1, 0, 0, Qnil, 0); |
389 | 4455 BLOCK_INPUT; |
4456 } | |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
4457 while (CONSP (obj) /* Mouse event */ |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
4458 && EQ (Fcar (Fcdr (Fcdr (obj))), Qnil) /* Not scroll bar */ |
389 | 4459 && EQ (Vmouse_depressed, Qnil) /* Only motion events */ |
4460 && EQ (Vmouse_window, selected_window) /* In this window */ | |
771 | 4461 && x_mouse_frame); |
389 | 4462 |
1601
a371ec79bc31
* xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents:
1528
diff
changeset
|
4463 unread_command_event = obj; |
389 | 4464 |
4465 if (mouse_track_width) | |
4466 { | |
771 | 4467 x_rectangle (f, f->display.x->reverse_gc, |
389 | 4468 mouse_track_left, mouse_track_top, |
4469 mouse_track_width, 1); | |
4470 mouse_track_width = 0; | |
771 | 4471 if ((mouse_track_left == f->phys_cursor_x |
4472 || mouse_track_left - 1 == f->phys_cursor_x) | |
4473 && mouse_track_top == f->phys_cursor_y) | |
389 | 4474 { |
771 | 4475 x_display_cursor (f, 1); |
389 | 4476 } |
4477 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4478 XDefineCursor (FRAME_X_DISPLAY (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
|
4479 FRAME_X_WINDOW (f), |
771 | 4480 f->display.x->nontext_cursor); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4481 XFlush (FRAME_X_DISPLAY (f)); |
389 | 4482 UNBLOCK_INPUT; |
4483 | |
4484 return Qnil; | |
4485 } | |
4486 #endif | |
4487 | |
4488 #if 0 | |
4489 #include "glyphs.h" | |
4490 | |
4491 /* Draw a pixmap specified by IMAGE_DATA of dimensions WIDTH and HEIGHT | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4492 on the frame F at position X, Y. */ |
771 | 4493 |
4494 x_draw_pixmap (f, x, y, image_data, width, height) | |
4495 struct frame *f; | |
389 | 4496 int x, y, width, height; |
4497 char *image_data; | |
4498 { | |
4499 Pixmap image; | |
4500 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4501 image = XCreateBitmapFromData (FRAME_X_DISPLAY (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
|
4502 FRAME_X_WINDOW (f), image_data, |
389 | 4503 width, height); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4504 XCopyPlane (FRAME_X_DISPLAY (f), image, FRAME_X_WINDOW (f), |
771 | 4505 f->display.x->normal_gc, 0, 0, width, height, x, y); |
389 | 4506 } |
4507 #endif | |
4508 | |
4309
c79a44360ed9
(Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
4279
diff
changeset
|
4509 #if 0 /* I'm told these functions are superfluous |
c79a44360ed9
(Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
4279
diff
changeset
|
4510 given the ability to bind function keys. */ |
c79a44360ed9
(Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
4279
diff
changeset
|
4511 |
389 | 4512 #ifdef HAVE_X11 |
4513 DEFUN ("x-rebind-key", Fx_rebind_key, Sx_rebind_key, 3, 3, 0, | |
4514 "Rebind X keysym KEYSYM, with MODIFIERS, to generate NEWSTRING.\n\ | |
4515 KEYSYM is a string which conforms to the X keysym definitions found\n\ | |
4516 in X11/keysymdef.h, sans the initial XK_. MODIFIERS is nil or a\n\ | |
4517 list of strings specifying modifier keys such as Control_L, which must\n\ | |
4518 also be depressed for NEWSTRING to appear.") | |
4519 (x_keysym, modifiers, newstring) | |
4520 register Lisp_Object x_keysym; | |
4521 register Lisp_Object modifiers; | |
4522 register Lisp_Object newstring; | |
4523 { | |
4524 char *rawstring; | |
642 | 4525 register KeySym keysym; |
4526 KeySym modifier_list[16]; | |
389 | 4527 |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
4528 check_x (); |
389 | 4529 CHECK_STRING (x_keysym, 1); |
4530 CHECK_STRING (newstring, 3); | |
4531 | |
4532 keysym = XStringToKeysym ((char *) XSTRING (x_keysym)->data); | |
4533 if (keysym == NoSymbol) | |
4534 error ("Keysym does not exist"); | |
4535 | |
485 | 4536 if (NILP (modifiers)) |
389 | 4537 XRebindKeysym (x_current_display, keysym, modifier_list, 0, |
4538 XSTRING (newstring)->data, XSTRING (newstring)->size); | |
4539 else | |
4540 { | |
4541 register Lisp_Object rest, mod; | |
4542 register int i = 0; | |
4543 | |
485 | 4544 for (rest = modifiers; !NILP (rest); rest = Fcdr (rest)) |
389 | 4545 { |
4546 if (i == 16) | |
4547 error ("Can't have more than 16 modifiers"); | |
4548 | |
4549 mod = Fcar (rest); | |
4550 CHECK_STRING (mod, 3); | |
4551 modifier_list[i] = XStringToKeysym ((char *) XSTRING (mod)->data); | |
3692
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4552 #ifndef HAVE_X11R5 |
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4553 if (modifier_list[i] == NoSymbol |
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4554 || !(IsModifierKey (modifier_list[i]) |
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4555 || ((unsigned)(modifier_list[i]) == XK_Mode_switch) |
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4556 || ((unsigned)(modifier_list[i]) == XK_Num_Lock))) |
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4557 #else |
389 | 4558 if (modifier_list[i] == NoSymbol |
4559 || !IsModifierKey (modifier_list[i])) | |
3692
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4560 #endif |
389 | 4561 error ("Element is not a modifier keysym"); |
4562 i++; | |
4563 } | |
4564 | |
4565 XRebindKeysym (x_current_display, keysym, modifier_list, i, | |
4566 XSTRING (newstring)->data, XSTRING (newstring)->size); | |
4567 } | |
4568 | |
4569 return Qnil; | |
4570 } | |
4571 | |
4572 DEFUN ("x-rebind-keys", Fx_rebind_keys, Sx_rebind_keys, 2, 2, 0, | |
4573 "Rebind KEYCODE to list of strings STRINGS.\n\ | |
4574 STRINGS should be a list of 16 elements, one for each shift combination.\n\ | |
4575 nil as element means don't change.\n\ | |
4576 See the documentation of `x-rebind-key' for more information.") | |
4577 (keycode, strings) | |
4578 register Lisp_Object keycode; | |
4579 register Lisp_Object strings; | |
4580 { | |
4581 register Lisp_Object item; | |
4582 register unsigned char *rawstring; | |
4583 KeySym rawkey, modifier[1]; | |
4584 int strsize; | |
4585 register unsigned i; | |
4586 | |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
4587 check_x (); |
389 | 4588 CHECK_NUMBER (keycode, 1); |
4589 CHECK_CONS (strings, 2); | |
4590 rawkey = (KeySym) ((unsigned) (XINT (keycode))) & 255; | |
4591 for (i = 0; i <= 15; strings = Fcdr (strings), i++) | |
4592 { | |
4593 item = Fcar (strings); | |
485 | 4594 if (!NILP (item)) |
389 | 4595 { |
4596 CHECK_STRING (item, 2); | |
4597 strsize = XSTRING (item)->size; | |
4598 rawstring = (unsigned char *) xmalloc (strsize); | |
4599 bcopy (XSTRING (item)->data, rawstring, strsize); | |
4600 modifier[1] = 1 << i; | |
4601 XRebindKeysym (x_current_display, rawkey, modifier, 1, | |
4602 rawstring, strsize); | |
4603 } | |
4604 } | |
4605 return Qnil; | |
4606 } | |
3141
ffe66ae9bfb3
(Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
3134
diff
changeset
|
4607 #endif /* HAVE_X11 */ |
4309
c79a44360ed9
(Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
4279
diff
changeset
|
4608 #endif /* 0 */ |
389 | 4609 |
4606
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4610 #ifndef HAVE_XSCREENNUMBEROFSCREEN |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4611 int |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4612 XScreenNumberOfScreen (scr) |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4613 register Screen *scr; |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4614 { |
4771
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4615 register Display *dpy; |
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4616 register Screen *dpyscr; |
4606
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4617 register int i; |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4618 |
4771
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4619 dpy = scr->display; |
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4620 dpyscr = dpy->screens; |
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4621 |
4606
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4622 for (i = 0; i < dpy->nscreens; i++, dpyscr++) |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4623 if (scr == dpyscr) |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4624 return i; |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4625 |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4626 return -1; |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4627 } |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4628 #endif /* not HAVE_XSCREENNUMBEROFSCREEN */ |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4629 |
389 | 4630 Visual * |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4631 select_visual (dpy, screen, depth) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4632 Display *dpy; |
389 | 4633 Screen *screen; |
4634 unsigned int *depth; | |
4635 { | |
4636 Visual *v; | |
4637 XVisualInfo *vinfo, vinfo_template; | |
4638 int n_visuals; | |
4639 | |
4640 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
|
4641 |
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
|
4642 #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
|
4643 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
|
4644 #else |
2341
1982e2983822
* xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents:
2328
diff
changeset
|
4645 vinfo_template.visualid = v->visualid; |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
4646 #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
|
4647 |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
4648 vinfo_template.screen = XScreenNumberOfScreen (screen); |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
4649 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4650 vinfo = XGetVisualInfo (dpy, |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
4651 VisualIDMask | VisualScreenMask, &vinfo_template, |
389 | 4652 &n_visuals); |
4653 if (n_visuals != 1) | |
4654 fatal ("Can't get proper X visual info"); | |
4655 | |
4656 if ((1 << vinfo->depth) == vinfo->colormap_size) | |
4657 *depth = vinfo->depth; | |
4658 else | |
4659 { | |
4660 int i = 0; | |
4661 int n = vinfo->colormap_size - 1; | |
4662 while (n) | |
4663 { | |
4664 n = n >> 1; | |
4665 i++; | |
4666 } | |
4667 *depth = i; | |
4668 } | |
4669 | |
4670 XFree ((char *) vinfo); | |
4671 return v; | |
4672 } | |
4673 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4674 /* Return the X display structure for the display named NAME. |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4675 Open a new connection if necessary. */ |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4676 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4677 struct x_display_info * |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4678 x_display_info_for_name (name) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4679 Lisp_Object name; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4680 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4681 Lisp_Object names; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4682 struct x_display_info *dpyinfo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4683 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4684 CHECK_STRING (name, 0); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4685 |
12381
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4686 if (! EQ (Vwindow_system, intern ("x"))) |
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4687 error ("Not using X Windows"); |
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4688 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4689 for (dpyinfo = x_display_list, names = x_display_name_list; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4690 dpyinfo; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4691 dpyinfo = dpyinfo->next, names = XCONS (names)->cdr) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4692 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4693 Lisp_Object tem; |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4694 tem = Fstring_equal (XCONS (XCONS (names)->car)->car, name); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4695 if (!NILP (tem)) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4696 return dpyinfo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4697 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4698 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4699 /* Use this general default value to start with. */ |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4700 Vx_resource_name = Vinvocation_name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4701 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4702 validate_x_resource_name (); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4703 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4704 dpyinfo = x_term_init (name, (unsigned char *)0, |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4705 (char *) XSTRING (Vx_resource_name)->data); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4706 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4707 if (dpyinfo == 0) |
12046
d23f2c9990b2
(x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents:
12036
diff
changeset
|
4708 error ("Cannot connect to X server %s", XSTRING (name)->data); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4709 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4710 x_in_use = 1; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4711 XSETFASTINT (Vwindow_system_version, 11); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4712 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4713 return dpyinfo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4714 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4715 |
389 | 4716 DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4717 1, 3, 0, "Open a connection to an X server.\n\ |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4718 DISPLAY is the name of the display to connect to.\n\ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4719 Optional second arg XRM-STRING is a string of resources in xrdb format.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4720 If the optional third arg MUST-SUCCEED is non-nil,\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4721 terminate Emacs if we can't open the connection.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4722 (display, xrm_string, must_succeed) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4723 Lisp_Object display, xrm_string, must_succeed; |
389 | 4724 { |
4725 unsigned int n_planes; | |
4726 unsigned char *xrm_option; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4727 struct x_display_info *dpyinfo; |
389 | 4728 |
4729 CHECK_STRING (display, 0); | |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4730 if (! NILP (xrm_string)) |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4731 CHECK_STRING (xrm_string, 1); |
389 | 4732 |
12381
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4733 if (! EQ (Vwindow_system, intern ("x"))) |
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4734 error ("Not using X Windows"); |
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4735 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4736 if (! NILP (xrm_string)) |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4737 xrm_option = (unsigned char *) XSTRING (xrm_string)->data; |
389 | 4738 else |
4739 xrm_option = (unsigned char *) 0; | |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4740 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4741 /* Use this general default value to start with. */ |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4742 Vx_resource_name = Vinvocation_name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4743 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4744 validate_x_resource_name (); |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4745 |
7802
d687e885fa6a
(Fx_open_connection): Set up Vx_resource_name and xrm_option
Richard M. Stallman <rms@gnu.org>
parents:
7797
diff
changeset
|
4746 /* This is what opens the connection and sets x_current_display. |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4747 This also initializes many symbols, such as those used for input. */ |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4748 dpyinfo = x_term_init (display, xrm_option, |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4749 (char *) XSTRING (Vx_resource_name)->data); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4750 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4751 if (dpyinfo == 0) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4752 { |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4753 if (!NILP (must_succeed)) |
12046
d23f2c9990b2
(x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents:
12036
diff
changeset
|
4754 fatal ("Cannot connect to X server %s.\n\ |
d23f2c9990b2
(x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents:
12036
diff
changeset
|
4755 Check the DISPLAY environment variable or use `-d'.\n\ |
d23f2c9990b2
(x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents:
12036
diff
changeset
|
4756 Also use the `xhost' program to verify that it is set to permit\n\ |
d23f2c9990b2
(x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents:
12036
diff
changeset
|
4757 connections from your machine.\n", |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4758 XSTRING (display)->data); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4759 else |
12046
d23f2c9990b2
(x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents:
12036
diff
changeset
|
4760 error ("Cannot connect to X server %s", XSTRING (display)->data); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4761 } |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4762 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4763 x_in_use = 1; |
7802
d687e885fa6a
(Fx_open_connection): Set up Vx_resource_name and xrm_option
Richard M. Stallman <rms@gnu.org>
parents:
7797
diff
changeset
|
4764 |
9327
b3398cf56fba
(Fx_open_connection): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents:
9285
diff
changeset
|
4765 XSETFASTINT (Vwindow_system_version, 11); |
389 | 4766 return Qnil; |
4767 } | |
4768 | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4769 DEFUN ("x-close-connection", Fx_close_connection, |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4770 Sx_close_connection, 1, 1, 0, |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4771 "Close the connection to DISPLAY's X server.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4772 For DISPLAY, specify either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4773 If DISPLAY is nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4774 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4775 Lisp_Object display; |
389 | 4776 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4777 struct x_display_info *dpyinfo = check_x_display_info (display); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4778 struct x_display_info *tail; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4779 int i; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4780 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4781 if (dpyinfo->reference_count > 0) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4782 error ("Display still has frames on it"); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4783 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4784 BLOCK_INPUT; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4785 /* Free the fonts in the font table. */ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4786 for (i = 0; i < dpyinfo->n_fonts; i++) |
389 | 4787 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4788 if (dpyinfo->font_table[i].name) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4789 free (dpyinfo->font_table[i].name); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4790 /* Don't free the full_name string; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4791 it is always shared with something else. */ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4792 XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font); |
389 | 4793 } |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4794 x_destroy_all_bitmaps (dpyinfo); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4795 XSetCloseDownMode (dpyinfo->display, DestroyAll); |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4796 |
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4797 #ifdef USE_X_TOOLKIT |
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4798 XtCloseDisplay (dpyinfo->display); |
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4799 #else |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4800 XCloseDisplay (dpyinfo->display); |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4801 #endif |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4802 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4803 x_delete_display (dpyinfo); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4804 UNBLOCK_INPUT; |
8782
51241477cfc5
Delete X11 conditionals.
Richard M. Stallman <rms@gnu.org>
parents:
8780
diff
changeset
|
4805 |
389 | 4806 return Qnil; |
4807 } | |
4808 | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4809 DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4810 "Return the list of display names that Emacs has connections to.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4811 () |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4812 { |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4813 Lisp_Object tail, result; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4814 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4815 result = Qnil; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4816 for (tail = x_display_name_list; ! NILP (tail); tail = XCONS (tail)->cdr) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4817 result = Fcons (XCONS (XCONS (tail)->car)->car, result); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4818 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4819 return result; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4820 } |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4821 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4822 DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0, |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4823 "If ON is non-nil, report X errors as soon as the erring request is made.\n\ |
389 | 4824 If ON is nil, allow buffering of requests.\n\ |
4825 Turning on synchronization prohibits the Xlib routines from buffering\n\ | |
4826 requests and seriously degrades performance, but makes debugging much\n\ | |
10080
2e1987a4de30
(Fx_synchronize): Fix doc string syntax.
Richard M. Stallman <rms@gnu.org>
parents:
9956
diff
changeset
|
4827 easier.\n\ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4828 The optional second argument DISPLAY specifies which display to act on.\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4829 DISPLAY should be either a frame or a display name (a string).\n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4830 If DISPLAY is omitted or nil, that stands for the selected frame's display.") |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4831 (on, display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4832 Lisp_Object display, on; |
389 | 4833 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4834 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4835 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4836 XSynchronize (dpyinfo->display, !EQ (on, Qnil)); |
389 | 4837 |
4838 return Qnil; | |
4839 } | |
4840 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4841 /* Wait for responses to all X commands issued so far for frame F. */ |
5536 | 4842 |
4843 void | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4844 x_sync (f) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4845 FRAME_PTR f; |
5536 | 4846 { |
5558 | 4847 BLOCK_INPUT; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4848 XSync (FRAME_X_DISPLAY (f), False); |
5558 | 4849 UNBLOCK_INPUT; |
5536 | 4850 } |
389 | 4851 |
4852 syms_of_xfns () | |
4853 { | |
4854 /* This is zero if not using X windows. */ | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4855 x_in_use = 0; |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
4856 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4857 /* 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
|
4858 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
|
4859 /*&&& init symbols here &&&*/ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4860 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
|
4861 staticpro (&Qauto_raise); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4862 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
|
4863 staticpro (&Qauto_lower); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4864 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
|
4865 staticpro (&Qbackground_color); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
4866 Qbar = intern ("bar"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
4867 staticpro (&Qbar); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4868 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
|
4869 staticpro (&Qborder_color); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4870 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
|
4871 staticpro (&Qborder_width); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
4872 Qbox = intern ("box"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
4873 staticpro (&Qbox); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4874 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
|
4875 staticpro (&Qcursor_color); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
4876 Qcursor_type = intern ("cursor-type"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
4877 staticpro (&Qcursor_type); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4878 Qfont = intern ("font"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4879 staticpro (&Qfont); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4880 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
|
4881 staticpro (&Qforeground_color); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4882 Qgeometry = intern ("geometry"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4883 staticpro (&Qgeometry); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4884 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
|
4885 staticpro (&Qicon_left); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4886 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
|
4887 staticpro (&Qicon_top); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4888 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
|
4889 staticpro (&Qicon_type); |
12073 | 4890 Qicon_name = intern ("icon-name"); |
4891 staticpro (&Qicon_name); | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4892 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
|
4893 staticpro (&Qinternal_border_width); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4894 Qleft = intern ("left"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4895 staticpro (&Qleft); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4896 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
|
4897 staticpro (&Qmouse_color); |
1874
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
4898 Qnone = intern ("none"); |
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
4899 staticpro (&Qnone); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4900 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
|
4901 staticpro (&Qparent_id); |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
4902 Qscroll_bar_width = intern ("scroll-bar-width"); |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
4903 staticpro (&Qscroll_bar_width); |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
4904 Qsuppress_icon = intern ("suppress-icon"); |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
4905 staticpro (&Qsuppress_icon); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4906 Qtop = intern ("top"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4907 staticpro (&Qtop); |
389 | 4908 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
|
4909 staticpro (&Qundefined_color); |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
4910 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
|
4911 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
|
4912 Qvisibility = intern ("visibility"); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
4913 staticpro (&Qvisibility); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4914 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
|
4915 staticpro (&Qwindow_id); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4916 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
|
4917 staticpro (&Qx_frame_parameter); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
4918 Qx_resource_name = intern ("x-resource-name"); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
4919 staticpro (&Qx_resource_name); |
7251
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
4920 Quser_position = intern ("user-position"); |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
4921 staticpro (&Quser_position); |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
4922 Quser_size = intern ("user-size"); |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
4923 staticpro (&Quser_size); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4924 Qdisplay = intern ("display"); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4925 staticpro (&Qdisplay); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4926 /* 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
|
4927 |
389 | 4928 Fput (Qundefined_color, Qerror_conditions, |
4929 Fcons (Qundefined_color, Fcons (Qerror, Qnil))); | |
4930 Fput (Qundefined_color, Qerror_message, | |
4931 build_string ("Undefined color")); | |
4932 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4933 init_x_parm_symbols (); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4934 |
9563 | 4935 DEFVAR_LISP ("x-bitmap-file-path", &Vx_bitmap_file_path, |
4936 "List of directories to search for bitmap files for X."); | |
12036
035d4ee6cc80
(syms_of_xfns): Allow PATH_BITMAPS to be a colon-separated list.
Karl Heuer <kwzh@gnu.org>
parents:
12019
diff
changeset
|
4937 Vx_bitmap_file_path = decode_env_path ((char *) 0, PATH_BITMAPS); |
9563 | 4938 |
4328
3d43e65a593d
(syms_of_xfns): Use DEFVAR_LISP, not DEFVAR_INT, for Vx_pointer_shape.
Roland McGrath <roland@gnu.org>
parents:
4309
diff
changeset
|
4939 DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape, |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4940 "The shape of the pointer when over text.\n\ |
2936
f9956cdb0d1d
(syms_of_xfns): Don't make Lisp vars
Richard M. Stallman <rms@gnu.org>
parents:
2885
diff
changeset
|
4941 Changing the value does not affect existing frames\n\ |
f9956cdb0d1d
(syms_of_xfns): Don't make Lisp vars
Richard M. Stallman <rms@gnu.org>
parents:
2885
diff
changeset
|
4942 unless you set the mouse color."); |
389 | 4943 Vx_pointer_shape = Qnil; |
4944 | |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4945 DEFVAR_LISP ("x-resource-name", &Vx_resource_name, |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4946 "The name Emacs uses to look up X resources; for internal use only.\n\ |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4947 `x-get-resource' uses this as the first component of the instance name\n\ |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4948 when requesting resource values.\n\ |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4949 Emacs initially sets `x-resource-name' to the name under which Emacs\n\ |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4950 was invoked, or to the value specified with the `-name' or `-rn'\n\ |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4951 switches, if present."); |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4952 Vx_resource_name = Qnil; |
3170
647229114f47
* xfns.c: Make resource manager work correctly even when
Jim Blandy <jimb@redhat.com>
parents:
3141
diff
changeset
|
4953 |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
4954 #if 0 /* This doesn't really do anything. */ |
389 | 4955 DEFVAR_INT ("x-nontext-pointer-shape", &Vx_nontext_pointer_shape, |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
4956 "The shape of the pointer when not over text.\n\ |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
4957 This variable takes effect when you create a new frame\n\ |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
4958 or when you set the mouse color."); |
2936
f9956cdb0d1d
(syms_of_xfns): Don't make Lisp vars
Richard M. Stallman <rms@gnu.org>
parents:
2885
diff
changeset
|
4959 #endif |
389 | 4960 Vx_nontext_pointer_shape = Qnil; |
4961 | |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
4962 #if 0 /* This doesn't really do anything. */ |
389 | 4963 DEFVAR_INT ("x-mode-pointer-shape", &Vx_mode_pointer_shape, |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
4964 "The shape of the pointer when over the mode line.\n\ |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
4965 This variable takes effect when you create a new frame\n\ |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
4966 or when you set the mouse color."); |
2936
f9956cdb0d1d
(syms_of_xfns): Don't make Lisp vars
Richard M. Stallman <rms@gnu.org>
parents:
2885
diff
changeset
|
4967 #endif |
389 | 4968 Vx_mode_pointer_shape = Qnil; |
4969 | |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
4970 DEFVAR_INT ("x-sensitive-text-pointer-shape", |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
4971 &Vx_sensitive_text_pointer_shape, |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
4972 "The shape of the pointer when over mouse-sensitive text.\n\ |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
4973 This variable takes effect when you create a new frame\n\ |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
4974 or when you set the mouse color."); |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
4975 Vx_sensitive_text_pointer_shape = Qnil; |
6759
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
4976 |
389 | 4977 DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel, |
4978 "A string indicating the foreground color of the cursor box."); | |
4979 Vx_cursor_fore_pixel = Qnil; | |
4980 | |
4981 DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, | |
12209
5537ed125771
(syms_of_xfns): Initialize Vx_no_window_manager. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
12190
diff
changeset
|
4982 "Non-nil if no X window manager is in use.\n\ |
5537ed125771
(syms_of_xfns): Initialize Vx_no_window_manager. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
12190
diff
changeset
|
4983 Emacs doesn't try to figure this out; this is always nil\n\ |
5537ed125771
(syms_of_xfns): Initialize Vx_no_window_manager. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
12190
diff
changeset
|
4984 unless you set it to something else."); |
5537ed125771
(syms_of_xfns): Initialize Vx_no_window_manager. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
12190
diff
changeset
|
4985 /* We don't have any way to find this out, so set it to nil |
5537ed125771
(syms_of_xfns): Initialize Vx_no_window_manager. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
12190
diff
changeset
|
4986 and maybe the user would like to set it to t. */ |
5537ed125771
(syms_of_xfns): Initialize Vx_no_window_manager. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
12190
diff
changeset
|
4987 Vx_no_window_manager = Qnil; |
8170
d92a24366b22
(x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
8103
diff
changeset
|
4988 |
d92a24366b22
(x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
8103
diff
changeset
|
4989 #ifdef USE_X_TOOLKIT |
8192
091cd6243cae
(syms_of_xfns): Provide x-toolkit in toolkit version.
Richard M. Stallman <rms@gnu.org>
parents:
8170
diff
changeset
|
4990 Fprovide (intern ("x-toolkit")); |
8170
d92a24366b22
(x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
8103
diff
changeset
|
4991 #endif |
12094
a9fda5417acf
(syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents:
12080
diff
changeset
|
4992 #ifdef USE_MOTIF |
a9fda5417acf
(syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents:
12080
diff
changeset
|
4993 Fprovide (intern ("motif")); |
a9fda5417acf
(syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents:
12080
diff
changeset
|
4994 #endif |
389 | 4995 |
4996 defsubr (&Sx_get_resource); | |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
4997 #if 0 |
389 | 4998 defsubr (&Sx_draw_rectangle); |
4999 defsubr (&Sx_erase_rectangle); | |
5000 defsubr (&Sx_contour_region); | |
5001 defsubr (&Sx_uncontour_region); | |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
5002 #endif |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
5003 defsubr (&Sx_list_fonts); |
2277
773e47f29c5a
(Fx_display_color_p): Renamed from Fx_color_display_p.
Richard M. Stallman <rms@gnu.org>
parents:
2276
diff
changeset
|
5004 defsubr (&Sx_display_color_p); |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
5005 defsubr (&Sx_display_grayscale_p); |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
5006 defsubr (&Sx_color_defined_p); |
8675
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
5007 defsubr (&Sx_color_values); |
4279 | 5008 defsubr (&Sx_server_max_request_size); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5009 defsubr (&Sx_server_vendor); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5010 defsubr (&Sx_server_version); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5011 defsubr (&Sx_display_pixel_width); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5012 defsubr (&Sx_display_pixel_height); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5013 defsubr (&Sx_display_mm_width); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5014 defsubr (&Sx_display_mm_height); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5015 defsubr (&Sx_display_screens); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5016 defsubr (&Sx_display_planes); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5017 defsubr (&Sx_display_color_cells); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5018 defsubr (&Sx_display_visual_class); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5019 defsubr (&Sx_display_backing_store); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5020 defsubr (&Sx_display_save_under); |
4309
c79a44360ed9
(Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
4279
diff
changeset
|
5021 #if 0 |
3141
ffe66ae9bfb3
(Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
3134
diff
changeset
|
5022 defsubr (&Sx_rebind_key); |
ffe66ae9bfb3
(Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
3134
diff
changeset
|
5023 defsubr (&Sx_rebind_keys); |
389 | 5024 defsubr (&Sx_track_pointer); |
5025 defsubr (&Sx_grab_pointer); | |
5026 defsubr (&Sx_ungrab_pointer); | |
436
6e0a136fca4f
*** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents:
398
diff
changeset
|
5027 #endif |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
5028 defsubr (&Sx_parse_geometry); |
771 | 5029 defsubr (&Sx_create_frame); |
5030 defsubr (&Sfocus_frame); | |
5031 defsubr (&Sunfocus_frame); | |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
5032 #if 0 |
389 | 5033 defsubr (&Sx_horizontal_line); |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
5034 #endif |
389 | 5035 defsubr (&Sx_open_connection); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
5036 defsubr (&Sx_close_connection); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
5037 defsubr (&Sx_display_list); |
389 | 5038 defsubr (&Sx_synchronize); |
5039 } | |
5040 | |
5041 #endif /* HAVE_X_WINDOWS */ |