Mercurial > emacs
annotate src/xfns.c @ 14984:e8a969370f33
(BLACK_PIX_DEFAULT, WHITE_PIX_DEFAULT): Use PALETTERGB instead of RGB.
author | Geoff Voelker <voelker@cs.washington.edu> |
---|---|
date | Thu, 11 Apr 1996 04:13:07 +0000 |
parents | fc1c21bc2e05 |
children | 3f5642bda41c |
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 | |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
13867
diff
changeset
|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
13867
diff
changeset
|
19 Boston, MA 02111-1307, USA. */ |
389 | 20 |
21 /* Completely rewritten by Richard Stallman. */ | |
22 | |
23 /* Rewritten for X11 by Joseph Arceneaux */ | |
24 | |
7899 | 25 #include <signal.h> |
26 #include <config.h> | |
27 | |
8091
f40cbe50c74f
(XLIB_ILLEGAL_ACCESS): Defined.
Richard M. Stallman <rms@gnu.org>
parents:
8090
diff
changeset
|
28 /* 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
|
29 #define XLIB_ILLEGAL_ACCESS |
f40cbe50c74f
(XLIB_ILLEGAL_ACCESS): Defined.
Richard M. Stallman <rms@gnu.org>
parents:
8090
diff
changeset
|
30 |
389 | 31 #include "lisp.h" |
32 #include "xterm.h" | |
771 | 33 #include "frame.h" |
389 | 34 #include "window.h" |
35 #include "buffer.h" | |
36 #include "dispextern.h" | |
515 | 37 #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
|
38 #include "blockinput.h" |
13751 | 39 #include <paths.h> |
389 | 40 |
41 #ifdef HAVE_X_WINDOWS | |
42 extern void abort (); | |
43 | |
13781
fc1cf507c51b
[X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents:
13751
diff
changeset
|
44 /* On some systems, the character-composition stuff is broken in X11R5. */ |
fc1cf507c51b
[X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents:
13751
diff
changeset
|
45 #if defined (HAVE_X11R5) && ! defined (HAVE_X11R6) |
fc1cf507c51b
[X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents:
13751
diff
changeset
|
46 #ifdef X11R5_INHIBIT_I18N |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
47 #define X_I18N_INHIBITED |
13781
fc1cf507c51b
[X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents:
13751
diff
changeset
|
48 #endif |
fc1cf507c51b
[X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents:
13751
diff
changeset
|
49 #endif |
fc1cf507c51b
[X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents:
13751
diff
changeset
|
50 |
2355
cec8c9490d8a
* xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents:
2341
diff
changeset
|
51 #ifndef VMS |
3821
8f353c2491d0
* xfns.c: Always #include "bitmaps/gray.xbm"; the bitmaps seem to
Jim Blandy <jimb@redhat.com>
parents:
3692
diff
changeset
|
52 #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
|
53 #include "bitmaps/gray.xbm" |
2657b04dd324
[EMACS_BIT_MAPS]: Include gray.xbm from ./bitmaps.
Richard M. Stallman <rms@gnu.org>
parents:
3507
diff
changeset
|
54 #else |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
55 #include <X11/bitmaps/gray> |
3512
2657b04dd324
[EMACS_BIT_MAPS]: Include gray.xbm from ./bitmaps.
Richard M. Stallman <rms@gnu.org>
parents:
3507
diff
changeset
|
56 #endif |
2355
cec8c9490d8a
* xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents:
2341
diff
changeset
|
57 #else |
cec8c9490d8a
* xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents:
2341
diff
changeset
|
58 #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
|
59 #endif |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
60 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
61 #ifdef USE_X_TOOLKIT |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
62 #include <X11/Shell.h> |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
63 |
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
|
64 #ifndef USE_MOTIF |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
65 #include <X11/Xaw/Paned.h> |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
66 #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
|
67 #endif /* USE_MOTIF */ |
5671
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 #ifdef USG |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
70 #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
|
71 #include <X11/Xos.h> |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
72 #define USG |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
73 #else |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
74 #include <X11/Xos.h> |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
75 #endif |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
76 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
77 #include "widget.h" |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
78 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
79 #include "../lwlib/lwlib.h" |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
80 |
13508
b64345cf1ee9
(HACK_EDITRES): Don't define if NO_EDITRES is defined.
Richard M. Stallman <rms@gnu.org>
parents:
13227
diff
changeset
|
81 /* Do the EDITRES protocol if running X11R5 |
b64345cf1ee9
(HACK_EDITRES): Don't define if NO_EDITRES is defined.
Richard M. Stallman <rms@gnu.org>
parents:
13227
diff
changeset
|
82 Exception: HP-UX (at least version A.09.05) has X11R5 without EditRes */ |
b64345cf1ee9
(HACK_EDITRES): Don't define if NO_EDITRES is defined.
Richard M. Stallman <rms@gnu.org>
parents:
13227
diff
changeset
|
83 #if (XtSpecificationRelease >= 5) && !defined(NO_EDITRES) |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
84 #define HACK_EDITRES |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
85 extern void _XEditResCheckMessages (); |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
86 #endif /* R5 + Athena */ |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
87 |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
88 /* 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
|
89 Library. */ |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
90 extern LWLIB_ID widget_id_tick; |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
91 |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
92 /* 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
|
93 XFontStruct *xlwmenu_default_font; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
94 |
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
|
95 extern void free_frame_menubar (); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
96 #endif /* USE_X_TOOLKIT */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
97 |
389 | 98 #define min(a,b) ((a) < (b) ? (a) : (b)) |
99 #define max(a,b) ((a) > (b) ? (a) : (b)) | |
100 | |
4279 | 101 #ifdef HAVE_X11R4 |
102 #define MAXREQUEST(dpy) (XMaxRequestSize (dpy)) | |
103 #else | |
104 #define MAXREQUEST(dpy) ((dpy)->max_request_size) | |
105 #endif | |
106 | |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
107 /* 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
|
108 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
|
109 |
389 | 110 /* 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
|
111 over text or in the modeline. */ |
389 | 112 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
|
113 /* The shape when over mouse-sensitive text. */ |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
114 Lisp_Object Vx_sensitive_text_pointer_shape; |
389 | 115 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
116 /* Color of chars displayed in cursor box. */ |
389 | 117 Lisp_Object Vx_cursor_fore_pixel; |
118 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
119 /* Nonzero if using X. */ |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
120 static int x_in_use; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
121 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
122 /* Non nil if no window manager is in use. */ |
389 | 123 Lisp_Object Vx_no_window_manager; |
124 | |
9563 | 125 /* Search path for bitmap files. */ |
126 Lisp_Object Vx_bitmap_file_path; | |
127 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
128 /* 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
|
129 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
|
130 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
|
131 evaluate this expression. |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
132 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
133 (progn |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
134 ;; 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
|
135 ;; 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
|
136 (goto-char (point-min)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
137 (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
|
138 (let (symbol-list) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
139 (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
|
140 (setq symbol-list |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
141 (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
|
142 symbol-list)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
143 (forward-line 1)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
144 (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
|
145 ;; 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
|
146 (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
|
147 (let ((start (point))) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
148 (while (looking-at "^ Q") |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
149 (forward-line 2)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
150 (kill-region start (point))) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
151 ;; 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
|
152 (while symbol-list |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
153 (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
|
154 (let ((start (point))) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
155 (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
|
156 (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
|
157 (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
|
158 (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
|
159 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
160 */ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
161 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
162 /*&&& symbols declared here &&&*/ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
163 Lisp_Object Qauto_raise; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
164 Lisp_Object Qauto_lower; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
165 Lisp_Object Qbackground_color; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
166 Lisp_Object Qbar; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
167 Lisp_Object Qborder_color; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
168 Lisp_Object Qborder_width; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
169 Lisp_Object Qbox; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
170 Lisp_Object Qcursor_color; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
171 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
|
172 Lisp_Object Qfont; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
173 Lisp_Object Qforeground_color; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
174 Lisp_Object Qgeometry; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
175 Lisp_Object Qicon_left; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
176 Lisp_Object Qicon_top; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
177 Lisp_Object Qicon_type; |
12073 | 178 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
|
179 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
|
180 Lisp_Object Qleft; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
181 Lisp_Object Qmouse_color; |
1874
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
182 Lisp_Object Qnone; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
183 Lisp_Object Qparent_id; |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
184 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
|
185 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
|
186 Lisp_Object Qtop; |
389 | 187 Lisp_Object Qundefined_color; |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
188 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
|
189 Lisp_Object Qvisibility; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
190 Lisp_Object Qwindow_id; |
771 | 191 Lisp_Object Qx_frame_parameter; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
192 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
|
193 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
|
194 Lisp_Object Quser_size; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
195 Lisp_Object Qdisplay; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
196 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
197 /* 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
|
198 extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth; |
14381 | 199 extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate, Qtitle; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
200 |
389 | 201 extern Lisp_Object Vwindow_system_version; |
202 | |
203 | |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
204 /* Error if we are not connected to X. */ |
5948 | 205 void |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
206 check_x () |
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
207 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
208 if (! x_in_use) |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
209 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
|
210 } |
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
211 |
13867
19a05b5a597d
(check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents:
13781
diff
changeset
|
212 /* Nonzero if we can use mouse menus. |
19a05b5a597d
(check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents:
13781
diff
changeset
|
213 You should not call this unless HAVE_MENUS is defined. */ |
7791
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
214 |
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
215 int |
13867
19a05b5a597d
(check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents:
13781
diff
changeset
|
216 have_menus_p () |
7791
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
217 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
218 return x_in_use; |
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 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
221 /* 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
|
222 and checking validity for X. */ |
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 FRAME_PTR |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
225 check_x_frame (frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
226 Lisp_Object frame; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
227 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
228 FRAME_PTR f; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
229 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
230 if (NILP (frame)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
231 f = selected_frame; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
232 else |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
233 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
234 CHECK_LIVE_FRAME (frame, 0); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
235 f = XFRAME (frame); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
236 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
237 if (! FRAME_X_P (f)) |
13867
19a05b5a597d
(check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents:
13781
diff
changeset
|
238 error ("Non-X frame used"); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
239 return f; |
7791
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
240 } |
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
241 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
242 /* 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
|
243 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
|
244 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
|
245 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
246 static struct x_display_info * |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
247 check_x_display_info (frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
248 Lisp_Object frame; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
249 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
250 if (NILP (frame)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
251 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
252 if (FRAME_X_P (selected_frame)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
253 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
|
254 else if (x_display_list != 0) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
255 return x_display_list; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
256 else |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
257 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
|
258 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
259 else if (STRINGP (frame)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
260 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
|
261 else |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
262 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
263 FRAME_PTR f; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
264 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
265 CHECK_LIVE_FRAME (frame, 0); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
266 f = XFRAME (frame); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
267 if (! FRAME_X_P (f)) |
13867
19a05b5a597d
(check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents:
13781
diff
changeset
|
268 error ("Non-X frame used"); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
269 return FRAME_X_DISPLAY_INFO (f); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
270 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
271 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
272 |
771 | 273 /* Return the Emacs frame-object corresponding to an X window. |
274 It could be the frame's main window or an icon window. */ | |
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 /* 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
|
277 |
771 | 278 struct frame * |
11197
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
279 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
|
280 struct x_display_info *dpyinfo; |
389 | 281 int wdesc; |
282 { | |
771 | 283 Lisp_Object tail, frame; |
284 struct frame *f; | |
285 | |
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
|
286 for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr) |
389 | 287 { |
771 | 288 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
|
289 if (!GC_FRAMEP (frame)) |
389 | 290 continue; |
771 | 291 f = XFRAME (frame); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
292 if (f->output_data.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
|
293 continue; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
294 #ifdef USE_X_TOOLKIT |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
295 if ((f->output_data.x->edit_widget |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
296 && XtWindow (f->output_data.x->edit_widget) == wdesc) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
297 || f->output_data.x->icon_desc == wdesc) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
298 return f; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
299 #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
|
300 if (FRAME_X_WINDOW (f) == wdesc |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
301 || f->output_data.x->icon_desc == wdesc) |
771 | 302 return f; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
303 #endif /* not USE_X_TOOLKIT */ |
389 | 304 } |
305 return 0; | |
306 } | |
307 | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
308 #ifdef USE_X_TOOLKIT |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
309 /* 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
|
310 windows. */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
311 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
312 struct frame * |
11197
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
313 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
|
314 struct x_display_info *dpyinfo; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
315 int wdesc; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
316 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
317 Lisp_Object tail, frame; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
318 struct frame *f; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
319 struct x_output *x; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
320 |
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
|
321 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
|
322 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
323 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
|
324 if (!GC_FRAMEP (frame)) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
325 continue; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
326 f = XFRAME (frame); |
12672 | 327 if (f->output_data.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
|
328 continue; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
329 x = f->output_data.x; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
330 /* 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
|
331 if (wdesc == XtWindow (x->widget) |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
332 || wdesc == XtWindow (x->column_widget) |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
333 || wdesc == XtWindow (x->edit_widget)) |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
334 return f; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
335 /* 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
|
336 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
|
337 return f; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
338 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
339 return 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
340 } |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
341 |
11611
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
342 /* 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
|
343 |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
344 struct frame * |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
345 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
|
346 struct x_display_info *dpyinfo; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
347 int wdesc; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
348 { |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
349 Lisp_Object tail, frame; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
350 struct frame *f; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
351 struct x_output *x; |
11611
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
352 |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
353 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
|
354 { |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
355 frame = XCONS (tail)->car; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
356 if (!GC_FRAMEP (frame)) |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
357 continue; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
358 f = XFRAME (frame); |
12672 | 359 if (f->output_data.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo) |
11611
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
360 continue; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
361 x = f->output_data.x; |
11611
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
362 /* 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
|
363 if (wdesc == XtWindow (x->widget) |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
364 || wdesc == XtWindow (x->column_widget) |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
365 || wdesc == XtWindow (x->edit_widget)) |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
366 return f; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
367 } |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
368 return 0; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
369 } |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
370 |
12656
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
371 /* 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
|
372 |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
373 struct frame * |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
374 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
|
375 struct x_display_info *dpyinfo; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
376 int wdesc; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
377 { |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
378 Lisp_Object tail, frame; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
379 struct frame *f; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
380 struct x_output *x; |
12656
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
381 |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
382 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
|
383 { |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
384 frame = XCONS (tail)->car; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
385 if (!GC_FRAMEP (frame)) |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
386 continue; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
387 f = XFRAME (frame); |
12672 | 388 if (f->output_data.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo) |
12656
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
389 continue; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
390 x = f->output_data.x; |
12656
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
391 /* 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
|
392 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
|
393 return f; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
394 } |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
395 return 0; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
396 } |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
397 |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
398 /* 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
|
399 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
|
400 |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
401 struct frame * |
11197
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
402 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
|
403 struct x_display_info *dpyinfo; |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
404 int wdesc; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
405 { |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
406 Lisp_Object tail, frame; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
407 struct frame *f; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
408 struct x_output *x; |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
409 |
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
|
410 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
|
411 { |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
412 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
|
413 if (!GC_FRAMEP (frame)) |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
414 continue; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
415 f = XFRAME (frame); |
12672 | 416 if (f->output_data.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
|
417 continue; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
418 x = f->output_data.x; |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
419 /* 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
|
420 if (wdesc == XtWindow (x->widget)) |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
421 return f; |
12019
63ee64941021
(x_top_window_to_frame): Don't match menu-bar widget.
Karl Heuer <kwzh@gnu.org>
parents:
12011
diff
changeset
|
422 #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
|
423 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
|
424 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
|
425 /* 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
|
426 if (x->menubar_widget |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
427 && wdesc == XtWindow (x->menubar_widget)) |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
428 return f; |
12019
63ee64941021
(x_top_window_to_frame): Don't match menu-bar widget.
Karl Heuer <kwzh@gnu.org>
parents:
12011
diff
changeset
|
429 #endif |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
430 } |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
431 return 0; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
432 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
433 #endif /* USE_X_TOOLKIT */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
434 |
389 | 435 |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
436 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
437 /* 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
|
438 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
|
439 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
|
440 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
441 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
|
442 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
|
443 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
444 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
|
445 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
|
446 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
|
447 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
448 |
9563 | 449 /* Functions to access the contents of a bitmap, given an id. */ |
450 | |
451 int | |
452 x_bitmap_height (f, id) | |
453 FRAME_PTR f; | |
454 int id; | |
455 { | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
456 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].height; |
9563 | 457 } |
458 | |
459 int | |
460 x_bitmap_width (f, id) | |
461 FRAME_PTR f; | |
462 int id; | |
463 { | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
464 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].width; |
9563 | 465 } |
466 | |
467 int | |
468 x_bitmap_pixmap (f, id) | |
469 FRAME_PTR f; | |
470 int id; | |
471 { | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
472 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap; |
9563 | 473 } |
474 | |
475 | |
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 /* 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
|
477 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
478 static int |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
479 x_allocate_bitmap_record (f) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
480 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
|
481 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
482 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
|
483 int i; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
484 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
485 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
|
486 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
487 dpyinfo->bitmaps_size = 10; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
488 dpyinfo->bitmaps |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
489 = (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
|
490 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
|
491 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
|
492 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
493 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
494 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
|
495 return ++dpyinfo->bitmaps_last; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
496 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
497 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
|
498 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
|
499 return i + 1; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
500 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
501 dpyinfo->bitmaps_size *= 2; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
502 dpyinfo->bitmaps |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
503 = (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
|
504 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
|
505 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
|
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 /* 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
|
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 void |
9563 | 511 x_reference_bitmap (f, id) |
512 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
|
513 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
|
514 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
515 ++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
|
516 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
517 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
518 /* 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
|
519 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
520 int |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
521 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
|
522 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
|
523 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
|
524 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
|
525 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
526 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
|
527 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
|
528 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
|
529 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
530 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
|
531 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
|
532 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
533 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
|
534 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
|
535 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
536 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
|
537 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
|
538 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
|
539 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
|
540 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
|
541 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
|
542 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
|
543 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
544 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
|
545 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
546 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
547 /* 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
|
548 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
549 int |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
550 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
|
551 struct frame *f; |
9563 | 552 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
|
553 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
554 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
|
555 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
|
556 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
|
557 int xhot, yhot, result, id; |
9563 | 558 Lisp_Object found; |
559 int fd; | |
560 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
|
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 /* 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
|
563 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
|
564 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
565 if (dpyinfo->bitmaps[id].refcount |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
566 && dpyinfo->bitmaps[id].file |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
567 && !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
|
568 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
569 ++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
|
570 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
|
571 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
572 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
573 |
9563 | 574 /* Search bitmap-file-path for the file, if appropriate. */ |
575 fd = openp (Vx_bitmap_file_path, file, "", &found, 0); | |
576 if (fd < 0) | |
577 return -1; | |
578 close (fd); | |
579 | |
580 filename = (char *) XSTRING (found)->data; | |
581 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
582 result = XReadBitmapFile (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
9563 | 583 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
|
584 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
|
585 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
|
586 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
587 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
|
588 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
|
589 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
|
590 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
|
591 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
|
592 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
|
593 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
|
594 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
|
595 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
596 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
|
597 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
598 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
599 /* 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
|
600 |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
601 int |
9563 | 602 x_destroy_bitmap (f, id) |
603 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
|
604 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
|
605 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
606 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
|
607 |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
608 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
|
609 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
610 --dpyinfo->bitmaps[id - 1].refcount; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
611 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
|
612 { |
12051
f193ce9efe24
(x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents:
12046
diff
changeset
|
613 BLOCK_INPUT; |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
614 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
|
615 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
|
616 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
617 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
|
618 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
|
619 } |
12051
f193ce9efe24
(x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents:
12046
diff
changeset
|
620 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
|
621 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
622 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
623 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
624 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
625 /* 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
|
626 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
627 static void |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
628 x_destroy_all_bitmaps (dpyinfo) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
629 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
|
630 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
631 int i; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
632 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
|
633 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
|
634 { |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
635 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
|
636 if (dpyinfo->bitmaps[i].file) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
637 free (dpyinfo->bitmaps[i].file); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
638 } |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
639 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
|
640 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
641 |
771 | 642 /* Connect the frame-parameter names for X frames |
389 | 643 to the ways of passing the parameter values to the window system. |
644 | |
645 The name of a parameter, as a Lisp symbol, | |
771 | 646 has an `x-frame-parameter' property which is an integer in Lisp |
14439
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
647 that is an index in this table. */ |
389 | 648 |
771 | 649 struct x_frame_parm_table |
389 | 650 { |
651 char *name; | |
771 | 652 void (*setter)( /* struct frame *frame, Lisp_Object val, oldval */ ); |
389 | 653 }; |
654 | |
655 void x_set_foreground_color (); | |
656 void x_set_background_color (); | |
657 void x_set_mouse_color (); | |
658 void x_set_cursor_color (); | |
659 void x_set_border_color (); | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
660 void x_set_cursor_type (); |
389 | 661 void x_set_icon_type (); |
12073 | 662 void x_set_icon_name (); |
389 | 663 void x_set_font (); |
664 void x_set_border_width (); | |
665 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
|
666 void x_explicitly_set_name (); |
389 | 667 void x_set_autoraise (); |
668 void x_set_autolower (); | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
669 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
|
670 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
|
671 void x_set_menu_bar_lines (); |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
672 void x_set_scroll_bar_width (); |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
673 void x_set_title (); |
9580
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
674 void x_set_unsplittable (); |
389 | 675 |
771 | 676 static struct x_frame_parm_table x_frame_parms[] = |
389 | 677 { |
1874
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
678 "auto-raise", x_set_autoraise, |
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
679 "auto-lower", x_set_autolower, |
14439
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
680 "background-color", x_set_background_color, |
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
681 "border-color", x_set_border_color, |
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
682 "border-width", x_set_border_width, |
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
683 "cursor-color", x_set_cursor_color, |
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
684 "cursor-type", x_set_cursor_type, |
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
685 "font", x_set_font, |
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
686 "foreground-color", x_set_foreground_color, |
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
687 "icon-name", x_set_icon_name, |
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
688 "icon-type", x_set_icon_type, |
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
689 "internal-border-width", x_set_internal_border_width, |
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
690 "menu-bar-lines", x_set_menu_bar_lines, |
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
691 "mouse-color", x_set_mouse_color, |
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
692 "name", x_explicitly_set_name, |
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
693 "scroll-bar-width", x_set_scroll_bar_width, |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
694 "title", x_set_title, |
14439
201ccc109ce7
(x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents:
14381
diff
changeset
|
695 "unsplittable", x_set_unsplittable, |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
696 "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
|
697 "visibility", x_set_visibility, |
389 | 698 }; |
699 | |
771 | 700 /* Attach the `x-frame-parameter' properties to |
389 | 701 the Lisp symbol names of parameters relevant to X. */ |
702 | |
703 init_x_parm_symbols () | |
704 { | |
705 int i; | |
706 | |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
707 for (i = 0; i < sizeof (x_frame_parms) / sizeof (x_frame_parms[0]); i++) |
771 | 708 Fput (intern (x_frame_parms[i].name), Qx_frame_parameter, |
389 | 709 make_number (i)); |
710 } | |
711 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
712 /* 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
|
713 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
|
714 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
|
715 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
716 void |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
717 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
|
718 FRAME_PTR f; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
719 Lisp_Object alist; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
720 { |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
721 Lisp_Object tail; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
722 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
723 /* 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
|
724 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
|
725 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
|
726 Lisp_Object width, height; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
727 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
728 /* Same here. */ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
729 Lisp_Object left, top; |
3203
1055aa1b7547
* xfns.c (x_set_frame_parameters): Use the first
Jim Blandy <jimb@redhat.com>
parents:
3173
diff
changeset
|
730 |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
731 /* Same with these. */ |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
732 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
|
733 |
3447
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
734 /* 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
|
735 Lisp_Object *parms; |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
736 Lisp_Object *values; |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
737 int i; |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
738 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
|
739 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
|
740 |
3447
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
741 i = 0; |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
742 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
|
743 i++; |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
744 |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
745 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
|
746 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
|
747 |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
748 /* 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
|
749 |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
750 i = 0; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
751 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
|
752 { |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
753 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
|
754 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
755 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
|
756 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
|
757 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
|
758 i++; |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
759 } |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
760 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
761 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
|
762 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
|
763 |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
764 /* 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
|
765 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
|
766 { |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
767 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
|
768 |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
769 prop = parms[i]; |
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
770 val = values[i]; |
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 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
|
773 width = val; |
3447
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
774 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
|
775 height = val; |
3447
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
776 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
|
777 top = val; |
3447
ed2a17aac4cd
(x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
3446
diff
changeset
|
778 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
|
779 left = val; |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
780 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
|
781 icon_top = val; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
782 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
|
783 icon_left = val; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
784 else |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
785 { |
6519
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
786 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
|
787 |
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
788 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
|
789 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
|
790 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
|
791 if (NATNUMP (param_index) |
cc76b76a1ed1
(CHECK_NATNUM): Use NATNUMP instead of its expansion.
Karl Heuer <kwzh@gnu.org>
parents:
9948
diff
changeset
|
792 && (XFASTINT (param_index) |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
793 < 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
|
794 (*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
|
795 } |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
796 } |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
797 |
4617
807ba8bcc309
(x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents:
4606
diff
changeset
|
798 /* 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
|
799 if (EQ (left, Qunbound)) |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
800 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
801 left_no_change = 1; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
802 if (f->output_data.x->left_pos < 0) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
803 left = Fcons (Qplus, Fcons (make_number (f->output_data.x->left_pos), Qnil)); |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
804 else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
805 XSETINT (left, f->output_data.x->left_pos); |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
806 } |
4617
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 (top, 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 top_no_change = 1; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
810 if (f->output_data.x->top_pos < 0) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
811 top = Fcons (Qplus, Fcons (make_number (f->output_data.x->top_pos), Qnil)); |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
812 else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
813 XSETINT (top, f->output_data.x->top_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 |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
816 /* 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
|
817 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
|
818 { |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
819 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
|
820 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
|
821 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
|
822 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
|
823 } |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
824 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
|
825 { |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
826 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
|
827 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
|
828 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
|
829 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
|
830 } |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
831 |
4617
807ba8bcc309
(x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents:
4606
diff
changeset
|
832 /* 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
|
833 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
|
834 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
|
835 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
|
836 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
|
837 |
11932
f3fb1e5dfde1
(x_set_frame_parameters) Fix typo.
Karl Heuer <kwzh@gnu.org>
parents:
11917
diff
changeset
|
838 /* 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
|
839 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
|
840 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
|
841 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
|
842 |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
843 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
|
844 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
|
845 yet. */ |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
846 { |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
847 Lisp_Object frame; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
848 |
5107
2a019dd8ed51
(x_set_frame_parameters): Call check_frame_size
Richard M. Stallman <rms@gnu.org>
parents:
4771
diff
changeset
|
849 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
|
850 |
9285
75f1c0d90b3d
(x_set_frame_parameters, x_set_visibility, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9240
diff
changeset
|
851 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
|
852 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
853 if ((NUMBERP (width) && XINT (width) != FRAME_WIDTH (f)) |
14965
685888f786d3
(x_set_frame_parameters): Do call Fset_frame_size
Richard M. Stallman <rms@gnu.org>
parents:
14831
diff
changeset
|
854 || (NUMBERP (height) && XINT (height) != FRAME_HEIGHT (f)) |
685888f786d3
(x_set_frame_parameters): Do call Fset_frame_size
Richard M. Stallman <rms@gnu.org>
parents:
14831
diff
changeset
|
855 || FRAME_NEW_HEIGHT (f) || FRAME_NEW_WIDTH (f)) |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
856 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
|
857 |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
858 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
|
859 && ! (left_no_change && top_no_change) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
860 && ! (NUMBERP (left) && XINT (left) == f->output_data.x->left_pos |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
861 && NUMBERP (top) && XINT (top) == f->output_data.x->top_pos)) |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
862 { |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
863 int leftpos = 0; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
864 int toppos = 0; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
865 |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
866 /* Record the signs. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
867 f->output_data.x->size_hint_flags &= ~ (XNegative | YNegative); |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
868 if (EQ (left, Qminus)) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
869 f->output_data.x->size_hint_flags |= XNegative; |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
870 else if (INTEGERP (left)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
871 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
872 leftpos = XINT (left); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
873 if (leftpos < 0) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
874 f->output_data.x->size_hint_flags |= XNegative; |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
875 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
876 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
|
877 && CONSP (XCONS (left)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
878 && 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
|
879 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
880 leftpos = - XINT (XCONS (XCONS (left)->cdr)->car); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
881 f->output_data.x->size_hint_flags |= XNegative; |
9022
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, Qplus) |
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 } |
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 if (EQ (top, Qminus)) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
891 f->output_data.x->size_hint_flags |= YNegative; |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
892 else if (INTEGERP (top)) |
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 toppos = XINT (top); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
895 if (toppos < 0) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
896 f->output_data.x->size_hint_flags |= YNegative; |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
897 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
898 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
|
899 && CONSP (XCONS (top)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
900 && 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
|
901 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
902 toppos = - XINT (XCONS (XCONS (top)->cdr)->car); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
903 f->output_data.x->size_hint_flags |= YNegative; |
9022
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, Qplus) |
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 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
911 |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
912 |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
913 /* Store the numeric value of the position. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
914 f->output_data.x->top_pos = toppos; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
915 f->output_data.x->left_pos = leftpos; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
916 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
917 f->output_data.x->win_gravity = NorthWestGravity; |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
918 |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
919 /* 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
|
920 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
|
921 } |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
922 |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
923 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
|
924 && ! (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
|
925 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
|
926 } |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
927 } |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
928 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
929 /* 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
|
930 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
|
931 not Emacs's own window. */ |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
932 |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
933 void |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
934 x_real_positions (f, xptr, yptr) |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
935 FRAME_PTR f; |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
936 int *xptr, *yptr; |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
937 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
938 int win_x, win_y; |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
939 Window child; |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
940 |
7946
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
941 /* 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
|
942 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
|
943 |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
944 #ifdef USE_X_TOOLKIT |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
945 Window outer = XtWindow (f->output_data.x->widget); |
7946
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
946 #else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
947 Window outer = f->output_data.x->window_desc; |
7946
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
948 #endif |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
949 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
|
950 Window *tmp_children; |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
951 int tmp_nchildren; |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
952 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
953 while (1) |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
954 { |
12111
832023e90d4d
(x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents:
12094
diff
changeset
|
955 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
|
956 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
957 XQueryTree (FRAME_X_DISPLAY (f), outer, &tmp_root_window, |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
958 &f->output_data.x->parent_desc, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
959 &tmp_children, &tmp_nchildren); |
14563
6aa8b322b4d7
(x_real_positions): Cast arg of XFree.
Karl Heuer <kwzh@gnu.org>
parents:
14530
diff
changeset
|
960 XFree ((char *) tmp_children); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
961 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
962 win_x = win_y = 0; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
963 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
964 /* 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
|
965 the inner window, with respect to the outer window. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
966 if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
967 { |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
968 XTranslateCoordinates (FRAME_X_DISPLAY (f), |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
969 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
970 /* From-window, to-window. */ |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
971 #ifdef USE_X_TOOLKIT |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
972 XtWindow (f->output_data.x->widget), |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
973 #else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
974 f->output_data.x->window_desc, |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
975 #endif |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
976 f->output_data.x->parent_desc, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
977 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
978 /* From-position, to-position. */ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
979 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
|
980 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
981 /* Child of win. */ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
982 &child); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
983 |
11900
54186a96c5b2
(x_set_frame_parameters): Pass 1 as change_gravity
Karl Heuer <kwzh@gnu.org>
parents:
11897
diff
changeset
|
984 #if 0 /* The values seem to be right without this and wrong with. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
985 win_x += f->output_data.x->border_width; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
986 win_y += f->output_data.x->border_width; |
11900
54186a96c5b2
(x_set_frame_parameters): Pass 1 as change_gravity
Karl Heuer <kwzh@gnu.org>
parents:
11897
diff
changeset
|
987 #endif |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
988 } |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
989 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
990 /* 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
|
991 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
|
992 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
|
993 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
|
994 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
|
995 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
|
996 break; |
12111
832023e90d4d
(x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents:
12094
diff
changeset
|
997 |
832023e90d4d
(x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents:
12094
diff
changeset
|
998 x_uncatch_errors (FRAME_X_DISPLAY (f)); |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
999 } |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
1000 |
9703
85ac0e4030d4
(x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents:
9690
diff
changeset
|
1001 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
|
1002 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1003 *xptr = f->output_data.x->left_pos - win_x; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1004 *yptr = f->output_data.x->top_pos - win_y; |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
1005 } |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
1006 |
771 | 1007 /* Insert a description of internally-recorded parameters of frame X |
389 | 1008 into the parameter alist *ALISTPTR that is to be given to the user. |
1009 Only parameters that are specific to the X window system | |
771 | 1010 and whose values are not correctly recorded in the frame's |
389 | 1011 param_alist need to be considered here. */ |
1012 | |
771 | 1013 x_report_frame_params (f, alistptr) |
1014 struct frame *f; | |
389 | 1015 Lisp_Object *alistptr; |
1016 { | |
1017 char buf[16]; | |
11986
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1018 Lisp_Object tem; |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1019 |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1020 /* 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
|
1021 in a way that Fmodify_frame_parameters will understand correctly. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1022 XSETINT (tem, f->output_data.x->left_pos); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1023 if (f->output_data.x->left_pos >= 0) |
11986
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1024 store_in_alist (alistptr, Qleft, tem); |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1025 else |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1026 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
|
1027 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1028 XSETINT (tem, f->output_data.x->top_pos); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1029 if (f->output_data.x->top_pos >= 0) |
11986
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1030 store_in_alist (alistptr, Qtop, tem); |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1031 else |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1032 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
|
1033 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1034 store_in_alist (alistptr, Qborder_width, |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1035 make_number (f->output_data.x->border_width)); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1036 store_in_alist (alistptr, Qinternal_border_width, |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1037 make_number (f->output_data.x->internal_border_width)); |
9182
516fdeee89d6
(x_report_frame_params): Fix format/arg mismatch.
Karl Heuer <kwzh@gnu.org>
parents:
9166
diff
changeset
|
1038 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
|
1039 store_in_alist (alistptr, Qwindow_id, |
389 | 1040 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
|
1041 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
|
1042 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
|
1043 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
|
1044 (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
|
1045 : 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
|
1046 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
|
1047 XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->car); |
389 | 1048 } |
1049 | |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1050 |
8675
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
1051 /* 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
|
1052 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
|
1053 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
|
1054 |
389 | 1055 int |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1056 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
|
1057 FRAME_PTR f; |
389 | 1058 char *color; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1059 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
|
1060 int alloc; |
389 | 1061 { |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1062 register int status; |
389 | 1063 Colormap screen_colormap; |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1064 Display *display = FRAME_X_DISPLAY (f); |
389 | 1065 |
1066 BLOCK_INPUT; | |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1067 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
|
1068 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1069 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
|
1070 if (status && alloc) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1071 { |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1072 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
|
1073 if (!status) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1074 { |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1075 /* 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
|
1076 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
|
1077 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
|
1078 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
|
1079 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1080 XColor *cells; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1081 int no_cells; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1082 int nearest; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1083 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
|
1084 int x; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1085 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1086 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
|
1087 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
|
1088 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1089 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
|
1090 cells[x].pixel = x; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1091 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1092 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
|
1093 nearest = 0; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1094 /* 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
|
1095 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
|
1096 * ((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
|
1097 + |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1098 (((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
|
1099 * ((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
|
1100 + |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1101 (((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
|
1102 * ((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
|
1103 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
|
1104 { |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1105 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
|
1106 * ((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
|
1107 + |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1108 (((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
|
1109 * ((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
|
1110 + |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1111 (((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
|
1112 * ((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
|
1113 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
|
1114 { |
14615
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1115 XColor temp; |
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1116 temp.red = cells[x].red; |
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1117 temp.green = cells[x].green; |
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1118 temp.blue = cells[x].blue; |
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1119 status = XAllocColor (display, screen_colormap, &temp); |
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1120 if (status) |
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1121 { |
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1122 nearest = x; |
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1123 nearest_delta = trial_delta; |
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1124 } |
10920
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 } |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1127 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
|
1128 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
|
1129 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
|
1130 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
|
1131 } |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1132 } |
389 | 1133 UNBLOCK_INPUT; |
1134 | |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1135 if (status) |
389 | 1136 return 1; |
1137 else | |
1138 return 0; | |
1139 } | |
1140 | |
1141 /* Given a string ARG naming a color, compute a pixel value from it | |
771 | 1142 suitable for screen F. |
1143 If F is not a color screen, return DEF (default) regardless of what | |
389 | 1144 ARG says. */ |
1145 | |
1146 int | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1147 x_decode_color (f, arg, def) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1148 FRAME_PTR f; |
389 | 1149 Lisp_Object arg; |
1150 int def; | |
1151 { | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1152 XColor cdef; |
389 | 1153 |
1154 CHECK_STRING (arg, 0); | |
1155 | |
1156 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
|
1157 return BLACK_PIX_DEFAULT (f); |
389 | 1158 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
|
1159 return WHITE_PIX_DEFAULT (f); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1160 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1161 if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1) |
389 | 1162 return def; |
1163 | |
11060
0a7048d331e6
(x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents:
11014
diff
changeset
|
1164 /* 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
|
1165 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
|
1166 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
|
1167 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
|
1168 |
13083
16638ebb209f
(Fx_create_frame): Set up buffer-predicate slot.
Richard M. Stallman <rms@gnu.org>
parents:
12832
diff
changeset
|
1169 Fsignal (Qerror, Fcons (build_string ("undefined color"), |
16638ebb209f
(Fx_create_frame): Set up buffer-predicate slot.
Richard M. Stallman <rms@gnu.org>
parents:
12832
diff
changeset
|
1170 Fcons (arg, Qnil))); |
389 | 1171 } |
1172 | |
771 | 1173 /* Functions called only from `x_set_frame_param' |
389 | 1174 to set individual parameters. |
1175 | |
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
|
1176 If FRAME_X_WINDOW (f) is 0, |
771 | 1177 the frame is being created and its X-window does not exist yet. |
389 | 1178 In that case, just record the parameter's new value |
1179 in the standard place; do not attempt to change the window. */ | |
1180 | |
1181 void | |
771 | 1182 x_set_foreground_color (f, arg, oldval) |
1183 struct frame *f; | |
389 | 1184 Lisp_Object arg, oldval; |
1185 { | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1186 f->output_data.x->foreground_pixel |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1187 = 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
|
1188 if (FRAME_X_WINDOW (f) != 0) |
389 | 1189 { |
1190 BLOCK_INPUT; | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1191 XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc, |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1192 f->output_data.x->foreground_pixel); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1193 XSetBackground (FRAME_X_DISPLAY (f), f->output_data.x->reverse_gc, |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1194 f->output_data.x->foreground_pixel); |
389 | 1195 UNBLOCK_INPUT; |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1196 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
|
1197 if (FRAME_VISIBLE_P (f)) |
771 | 1198 redraw_frame (f); |
389 | 1199 } |
1200 } | |
1201 | |
1202 void | |
771 | 1203 x_set_background_color (f, arg, oldval) |
1204 struct frame *f; | |
389 | 1205 Lisp_Object arg, oldval; |
1206 { | |
1207 Pixmap temp; | |
1208 int mask; | |
1209 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1210 f->output_data.x->background_pixel |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1211 = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); |
771 | 1212 |
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
|
1213 if (FRAME_X_WINDOW (f) != 0) |
389 | 1214 { |
1215 BLOCK_INPUT; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1216 /* The main frame area. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1217 XSetBackground (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc, |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1218 f->output_data.x->background_pixel); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1219 XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->reverse_gc, |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1220 f->output_data.x->background_pixel); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1221 XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->cursor_gc, |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1222 f->output_data.x->background_pixel); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1223 XSetWindowBackground (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1224 f->output_data.x->background_pixel); |
7599
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1225 { |
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1226 Lisp_Object bar; |
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1227 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
|
1228 bar = XSCROLL_BAR (bar)->next) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1229 XSetWindowBackground (FRAME_X_DISPLAY (f), |
7599
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1230 SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1231 f->output_data.x->background_pixel); |
7599
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1232 } |
389 | 1233 UNBLOCK_INPUT; |
1234 | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1235 recompute_basic_faces (f); |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1236 |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1237 if (FRAME_VISIBLE_P (f)) |
771 | 1238 redraw_frame (f); |
389 | 1239 } |
1240 } | |
1241 | |
1242 void | |
771 | 1243 x_set_mouse_color (f, arg, oldval) |
1244 struct frame *f; | |
389 | 1245 Lisp_Object arg, oldval; |
1246 { | |
6759
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
1247 Cursor cursor, nontext_cursor, mode_cursor, cross_cursor; |
389 | 1248 int mask_color; |
1249 | |
1250 if (!EQ (Qnil, arg)) | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1251 f->output_data.x->mouse_pixel |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1252 = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1253 mask_color = f->output_data.x->background_pixel; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1254 /* No invisible pointers. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1255 if (mask_color == f->output_data.x->mouse_pixel |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1256 && mask_color == f->output_data.x->background_pixel) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1257 f->output_data.x->mouse_pixel = f->output_data.x->foreground_pixel; |
389 | 1258 |
1259 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
|
1260 |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3512
diff
changeset
|
1261 /* 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
|
1262 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
|
1263 |
389 | 1264 if (!EQ (Qnil, Vx_pointer_shape)) |
1265 { | |
1266 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
|
1267 cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XINT (Vx_pointer_shape)); |
389 | 1268 } |
1269 else | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1270 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
|
1271 x_check_errors (FRAME_X_DISPLAY (f), "bad text pointer cursor: %s"); |
389 | 1272 |
1273 if (!EQ (Qnil, Vx_nontext_pointer_shape)) | |
1274 { | |
1275 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
|
1276 nontext_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), |
389 | 1277 XINT (Vx_nontext_pointer_shape)); |
1278 } | |
1279 else | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1280 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
|
1281 x_check_errors (FRAME_X_DISPLAY (f), "bad nontext pointer cursor: %s"); |
389 | 1282 |
1283 if (!EQ (Qnil, Vx_mode_pointer_shape)) | |
1284 { | |
1285 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
|
1286 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
|
1287 XINT (Vx_mode_pointer_shape)); |
389 | 1288 } |
1289 else | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1290 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
|
1291 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
|
1292 |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
1293 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
|
1294 { |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
1295 CHECK_NUMBER (Vx_sensitive_text_pointer_shape, 0); |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
1296 cross_cursor |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1297 = XCreateFontCursor (FRAME_X_DISPLAY (f), |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
1298 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
|
1299 } |
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
1300 else |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1301 cross_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_crosshair); |
389 | 1302 |
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
|
1303 /* 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
|
1304 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
|
1305 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
|
1306 |
389 | 1307 { |
1308 XColor fore_color, back_color; | |
1309 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1310 fore_color.pixel = f->output_data.x->mouse_pixel; |
389 | 1311 back_color.pixel = mask_color; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1312 XQueryColor (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1313 DefaultColormap (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1314 DefaultScreen (FRAME_X_DISPLAY (f))), |
389 | 1315 &fore_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1316 XQueryColor (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1317 DefaultColormap (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1318 DefaultScreen (FRAME_X_DISPLAY (f))), |
389 | 1319 &back_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1320 XRecolorCursor (FRAME_X_DISPLAY (f), cursor, |
389 | 1321 &fore_color, &back_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1322 XRecolorCursor (FRAME_X_DISPLAY (f), nontext_cursor, |
389 | 1323 &fore_color, &back_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1324 XRecolorCursor (FRAME_X_DISPLAY (f), mode_cursor, |
389 | 1325 &fore_color, &back_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1326 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
|
1327 &fore_color, &back_color); |
389 | 1328 } |
1329 | |
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
|
1330 if (FRAME_X_WINDOW (f) != 0) |
389 | 1331 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1332 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor); |
389 | 1333 } |
1334 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1335 if (cursor != f->output_data.x->text_cursor && f->output_data.x->text_cursor != 0) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1336 XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->text_cursor); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1337 f->output_data.x->text_cursor = cursor; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1338 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1339 if (nontext_cursor != f->output_data.x->nontext_cursor |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1340 && f->output_data.x->nontext_cursor != 0) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1341 XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->nontext_cursor); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1342 f->output_data.x->nontext_cursor = nontext_cursor; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1343 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1344 if (mode_cursor != f->output_data.x->modeline_cursor |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1345 && f->output_data.x->modeline_cursor != 0) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1346 XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->modeline_cursor); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1347 f->output_data.x->modeline_cursor = mode_cursor; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1348 if (cross_cursor != f->output_data.x->cross_cursor |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1349 && f->output_data.x->cross_cursor != 0) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1350 XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->cross_cursor); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1351 f->output_data.x->cross_cursor = cross_cursor; |
389 | 1352 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1353 XFlush (FRAME_X_DISPLAY (f)); |
389 | 1354 UNBLOCK_INPUT; |
1355 } | |
1356 | |
1357 void | |
771 | 1358 x_set_cursor_color (f, arg, oldval) |
1359 struct frame *f; | |
389 | 1360 Lisp_Object arg, oldval; |
1361 { | |
1362 unsigned long fore_pixel; | |
1363 | |
1364 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
|
1365 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
|
1366 WHITE_PIX_DEFAULT (f)); |
389 | 1367 else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1368 fore_pixel = f->output_data.x->background_pixel; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1369 f->output_data.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
|
1370 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1371 /* Make sure that the cursor color differs from the background color. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1372 if (f->output_data.x->cursor_pixel == f->output_data.x->background_pixel) |
389 | 1373 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1374 f->output_data.x->cursor_pixel = f->output_data.x->mouse_pixel; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1375 if (f->output_data.x->cursor_pixel == fore_pixel) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1376 fore_pixel = f->output_data.x->background_pixel; |
389 | 1377 } |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1378 f->output_data.x->cursor_foreground_pixel = fore_pixel; |
389 | 1379 |
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
|
1380 if (FRAME_X_WINDOW (f) != 0) |
389 | 1381 { |
1382 BLOCK_INPUT; | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1383 XSetBackground (FRAME_X_DISPLAY (f), f->output_data.x->cursor_gc, |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1384 f->output_data.x->cursor_pixel); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1385 XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->cursor_gc, |
389 | 1386 fore_pixel); |
1387 UNBLOCK_INPUT; | |
1388 | |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1389 if (FRAME_VISIBLE_P (f)) |
389 | 1390 { |
771 | 1391 x_display_cursor (f, 0); |
1392 x_display_cursor (f, 1); | |
389 | 1393 } |
1394 } | |
1395 } | |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1396 |
771 | 1397 /* Set the border-color of frame F to value described by ARG. |
389 | 1398 ARG can be a string naming a color. |
1399 The border-color is used for the border that is drawn by the X server. | |
1400 Note that this does not fully take effect if done before | |
771 | 1401 F has an x-window; it must be redone when the window is created. |
389 | 1402 |
1403 Note: this is done in two routines because of the way X10 works. | |
1404 | |
1405 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
|
1406 and so emacs' border colors may be overridden. */ |
389 | 1407 |
1408 void | |
771 | 1409 x_set_border_color (f, arg, oldval) |
1410 struct frame *f; | |
389 | 1411 Lisp_Object arg, oldval; |
1412 { | |
1413 unsigned char *str; | |
1414 int pix; | |
1415 | |
1416 CHECK_STRING (arg, 0); | |
1417 str = XSTRING (arg)->data; | |
1418 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1419 pix = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
389 | 1420 |
771 | 1421 x_set_border_pixel (f, pix); |
389 | 1422 } |
1423 | |
771 | 1424 /* Set the border-color of frame F to pixel value PIX. |
389 | 1425 Note that this does not fully take effect if done before |
771 | 1426 F has an x-window. */ |
1427 | |
1428 x_set_border_pixel (f, pix) | |
1429 struct frame *f; | |
389 | 1430 int pix; |
1431 { | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1432 f->output_data.x->border_pixel = pix; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1433 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1434 if (FRAME_X_WINDOW (f) != 0 && f->output_data.x->border_width > 0) |
389 | 1435 { |
1436 Pixmap temp; | |
1437 int mask; | |
1438 | |
1439 BLOCK_INPUT; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1440 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
|
1441 (unsigned long)pix); |
389 | 1442 UNBLOCK_INPUT; |
1443 | |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1444 if (FRAME_VISIBLE_P (f)) |
771 | 1445 redraw_frame (f); |
389 | 1446 } |
1447 } | |
1448 | |
1449 void | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1450 x_set_cursor_type (f, arg, oldval) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1451 FRAME_PTR f; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1452 Lisp_Object arg, oldval; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1453 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1454 if (EQ (arg, Qbar)) |
10742
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1455 { |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1456 FRAME_DESIRED_CURSOR (f) = bar_cursor; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1457 f->output_data.x->cursor_width = 2; |
10742
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1458 } |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1459 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
|
1460 && INTEGERP (XCONS (arg)->cdr)) |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1461 { |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1462 FRAME_DESIRED_CURSOR (f) = bar_cursor; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1463 f->output_data.x->cursor_width = XINT (XCONS (arg)->cdr); |
10742
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1464 } |
3134
efdaaa695ad4
(x_set_cursor_type): If arg not recognized, use box cursor.
Richard M. Stallman <rms@gnu.org>
parents:
3108
diff
changeset
|
1465 else |
10742
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1466 /* 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
|
1467 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
|
1468 .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
|
1469 FRAME_DESIRED_CURSOR (f) = filled_box_cursor; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1470 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1471 /* 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
|
1472 often do people change cursor types? */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1473 update_mode_lines++; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1474 } |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1475 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1476 void |
771 | 1477 x_set_icon_type (f, arg, oldval) |
1478 struct frame *f; | |
389 | 1479 Lisp_Object arg, oldval; |
1480 { | |
1481 Lisp_Object tem; | |
1482 int result; | |
1483 | |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1484 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
|
1485 { |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1486 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
|
1487 return; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1488 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1489 else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil)) |
389 | 1490 return; |
1491 | |
1492 BLOCK_INPUT; | |
485 | 1493 if (NILP (arg)) |
12073 | 1494 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
|
1495 (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
|
1496 ? f->icon_name |
12073 | 1497 : f->name))->data); |
9563 | 1498 else |
1499 result = x_bitmap_icon (f, arg); | |
389 | 1500 |
1501 if (result) | |
1502 { | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1503 UNBLOCK_INPUT; |
9353
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1504 error ("No icon window available"); |
389 | 1505 } |
1506 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1507 XFlush (FRAME_X_DISPLAY (f)); |
389 | 1508 UNBLOCK_INPUT; |
1509 } | |
1510 | |
9563 | 1511 /* Return non-nil if frame F wants a bitmap icon. */ |
1512 | |
1513 Lisp_Object | |
9353
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1514 x_icon_type (f) |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1515 FRAME_PTR f; |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1516 { |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1517 Lisp_Object tem; |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1518 |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1519 tem = assq_no_quit (Qicon_type, f->param_alist); |
9563 | 1520 if (CONSP (tem)) |
1521 return XCONS (tem)->cdr; | |
1522 else | |
1523 return Qnil; | |
9353
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1524 } |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1525 |
12073 | 1526 void |
1527 x_set_icon_name (f, arg, oldval) | |
1528 struct frame *f; | |
1529 Lisp_Object arg, oldval; | |
1530 { | |
1531 Lisp_Object tem; | |
1532 int result; | |
1533 | |
1534 if (STRINGP (arg)) | |
1535 { | |
1536 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) | |
1537 return; | |
1538 } | |
1539 else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil)) | |
1540 return; | |
1541 | |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
1542 f->icon_name = arg; |
12073 | 1543 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1544 if (f->output_data.x->icon_bitmap != 0) |
12073 | 1545 return; |
1546 | |
1547 BLOCK_INPUT; | |
1548 | |
1549 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
|
1550 (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
|
1551 ? f->icon_name |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1552 : !NILP (f->title) |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1553 ? f->title |
12073 | 1554 : f->name))->data); |
1555 | |
1556 if (result) | |
1557 { | |
1558 UNBLOCK_INPUT; | |
1559 error ("No icon window available"); | |
1560 } | |
1561 | |
1562 XFlush (FRAME_X_DISPLAY (f)); | |
1563 UNBLOCK_INPUT; | |
1564 } | |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1565 |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1566 extern Lisp_Object x_new_font (); |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1567 |
389 | 1568 void |
771 | 1569 x_set_font (f, arg, oldval) |
1570 struct frame *f; | |
389 | 1571 Lisp_Object arg, oldval; |
1572 { | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1573 Lisp_Object result; |
389 | 1574 |
1575 CHECK_STRING (arg, 1); | |
1576 | |
1577 BLOCK_INPUT; | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1578 result = x_new_font (f, XSTRING (arg)->data); |
389 | 1579 UNBLOCK_INPUT; |
1580 | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1581 if (EQ (result, Qnil)) |
13867
19a05b5a597d
(check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents:
13781
diff
changeset
|
1582 error ("Font `%s' is not defined", XSTRING (arg)->data); |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1583 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
|
1584 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
|
1585 else if (STRINGP (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 recompute_basic_faces (f); |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1588 store_frame_param (f, Qfont, result); |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1589 } |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1590 else |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1591 abort (); |
389 | 1592 } |
1593 | |
1594 void | |
771 | 1595 x_set_border_width (f, arg, oldval) |
1596 struct frame *f; | |
389 | 1597 Lisp_Object arg, oldval; |
1598 { | |
1599 CHECK_NUMBER (arg, 0); | |
1600 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1601 if (XINT (arg) == f->output_data.x->border_width) |
389 | 1602 return; |
1603 | |
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
|
1604 if (FRAME_X_WINDOW (f) != 0) |
389 | 1605 error ("Cannot change the border width of a window"); |
1606 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1607 f->output_data.x->border_width = XINT (arg); |
389 | 1608 } |
1609 | |
1610 void | |
771 | 1611 x_set_internal_border_width (f, arg, oldval) |
1612 struct frame *f; | |
389 | 1613 Lisp_Object arg, oldval; |
1614 { | |
1615 int mask; | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1616 int old = f->output_data.x->internal_border_width; |
389 | 1617 |
1618 CHECK_NUMBER (arg, 0); | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1619 f->output_data.x->internal_border_width = XINT (arg); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1620 if (f->output_data.x->internal_border_width < 0) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1621 f->output_data.x->internal_border_width = 0; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1622 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1623 if (f->output_data.x->internal_border_width == old) |
389 | 1624 return; |
1625 | |
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
|
1626 if (FRAME_X_WINDOW (f) != 0) |
389 | 1627 { |
1628 BLOCK_INPUT; | |
5899
4e8f26a0f2b7
*** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5721
diff
changeset
|
1629 x_set_window_size (f, 0, f->width, f->height); |
389 | 1630 #if 0 |
771 | 1631 x_set_resize_hint (f); |
389 | 1632 #endif |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1633 XFlush (FRAME_X_DISPLAY (f)); |
389 | 1634 UNBLOCK_INPUT; |
771 | 1635 SET_FRAME_GARBAGED (f); |
389 | 1636 } |
1637 } | |
1638 | |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1639 void |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1640 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
|
1641 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
|
1642 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
|
1643 { |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1644 Lisp_Object frame; |
9285
75f1c0d90b3d
(x_set_frame_parameters, x_set_visibility, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9240
diff
changeset
|
1645 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
|
1646 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1647 if (NILP (value)) |
5899
4e8f26a0f2b7
*** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5721
diff
changeset
|
1648 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
|
1649 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
|
1650 Ficonify_frame (frame); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1651 else |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1652 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
|
1653 } |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1654 |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1655 static void |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1656 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
|
1657 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
|
1658 int n; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1659 { |
3477
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1660 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
|
1661 |
9329
4e1048594e7f
(x_set_menu_bar_lines_1): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents:
9327
diff
changeset
|
1662 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
|
1663 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
|
1664 |
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1665 /* 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
|
1666 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
|
1667 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
|
1668 |
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1669 /* 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
|
1670 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
|
1671 { |
3477
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1672 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
|
1673 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
|
1674 } |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1675 } |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1676 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1677 void |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1678 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
|
1679 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
|
1680 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
|
1681 { |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1682 int nlines; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1683 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
|
1684 |
2880
9a78169e44df
* xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents:
2842
diff
changeset
|
1685 /* 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
|
1686 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
|
1687 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
|
1688 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
|
1689 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
|
1690 return; |
9a78169e44df
* xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents:
2842
diff
changeset
|
1691 |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
1692 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
|
1693 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
|
1694 else |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1695 nlines = 0; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1696 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1697 #ifdef USE_X_TOOLKIT |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1698 FRAME_MENU_BAR_LINES (f) = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1699 if (nlines) |
12832
0d750e41c4f2
(x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents:
12773
diff
changeset
|
1700 { |
0d750e41c4f2
(x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents:
12773
diff
changeset
|
1701 FRAME_EXTERNAL_MENU_BAR (f) = 1; |
13734
714433bead7f
(x_set_menu_bar_lines) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
13508
diff
changeset
|
1702 if (FRAME_X_P (f) && f->output_data.x->menubar_widget == 0) |
12832
0d750e41c4f2
(x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents:
12773
diff
changeset
|
1703 /* Make sure next redisplay shows the menu bar. */ |
0d750e41c4f2
(x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents:
12773
diff
changeset
|
1704 XWINDOW (FRAME_SELECTED_WINDOW (f))->update_mode_line = Qt; |
0d750e41c4f2
(x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents:
12773
diff
changeset
|
1705 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1706 else |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1707 { |
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
|
1708 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
|
1709 free_frame_menubar (f); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1710 FRAME_EXTERNAL_MENU_BAR (f) = 0; |
13734
714433bead7f
(x_set_menu_bar_lines) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
13508
diff
changeset
|
1711 if (FRAME_X_P (f)) |
714433bead7f
(x_set_menu_bar_lines) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
13508
diff
changeset
|
1712 f->output_data.x->menubar_widget = 0; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1713 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1714 #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
|
1715 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
|
1716 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
|
1717 #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
|
1718 } |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1719 |
4650 | 1720 /* 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
|
1721 x_id_name. |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1722 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1723 If EXPLICIT is non-zero, that indicates that lisp code is setting the |
4650 | 1724 name; if NAME is a string, set F's name to NAME and set |
1725 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
|
1726 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1727 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
|
1728 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
|
1729 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
|
1730 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1731 void |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1732 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
|
1733 struct frame *f; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1734 Lisp_Object name; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1735 int explicit; |
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 /* 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
|
1738 Emacs redisplay code. */ |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1739 if (explicit) |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1740 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1741 /* 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
|
1742 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
|
1743 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
|
1744 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
|
1745 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1746 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
|
1747 } |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1748 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
|
1749 return; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1750 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1751 /* 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
|
1752 if (NILP (name)) |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
1753 { |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
1754 /* 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
|
1755 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
|
1756 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
|
1757 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
|
1758 return; |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
1759 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
|
1760 } |
833 | 1761 else |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1762 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
|
1763 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1764 /* 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
|
1765 if (! NILP (Fstring_equal (name, f->name))) |
727 | 1766 return; |
1767 | |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1768 f->name = name; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1769 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1770 /* For setting the frame title, the title parameter should override |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1771 the name parameter. */ |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1772 if (! NILP (f->title)) |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1773 name = f->title; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1774 |
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
|
1775 if (FRAME_X_WINDOW (f)) |
389 | 1776 { |
708 | 1777 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
|
1778 #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
|
1779 { |
12073 | 1780 XTextProperty text, icon; |
1781 Lisp_Object icon_name; | |
1782 | |
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
|
1783 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
|
1784 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
|
1785 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
|
1786 text.nitems = XSTRING (name)->size; |
12073 | 1787 |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
1788 icon_name = (!NILP (f->icon_name) ? f->icon_name : name); |
12073 | 1789 |
1790 icon.value = XSTRING (icon_name)->data; | |
1791 icon.encoding = XA_STRING; | |
1792 icon.format = 8; | |
1793 icon.nitems = XSTRING (icon_name)->size; | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1794 #ifdef USE_X_TOOLKIT |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1795 XSetWMName (FRAME_X_DISPLAY (f), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1796 XtWindow (f->output_data.x->widget), &text); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1797 XSetWMIconName (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget), |
12073 | 1798 &icon); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1799 #else /* not USE_X_TOOLKIT */ |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1800 XSetWMName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text); |
12073 | 1801 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
|
1802 #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
|
1803 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1804 #else /* not HAVE_X11R4 */ |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1805 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
|
1806 XSTRING (name)->data); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1807 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
|
1808 XSTRING (name)->data); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1809 #endif /* not HAVE_X11R4 */ |
708 | 1810 UNBLOCK_INPUT; |
389 | 1811 } |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1812 } |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1813 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1814 /* 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
|
1815 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
|
1816 redisplay code. */ |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1817 void |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1818 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
|
1819 FRAME_PTR f; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1820 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
|
1821 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1822 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
|
1823 } |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1824 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1825 /* 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
|
1826 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
|
1827 lisp code. */ |
1125
059624bf9bf0
Declare x_implicitly_set_name to be void.
Jim Blandy <jimb@redhat.com>
parents:
1096
diff
changeset
|
1828 void |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1829 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
|
1830 FRAME_PTR f; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1831 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
|
1832 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1833 x_set_name (f, arg, 0); |
389 | 1834 } |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1835 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1836 /* Change the title of frame F to NAME. |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1837 If NAME is nil, use the frame name as the title. |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1838 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1839 If EXPLICIT is non-zero, that indicates that lisp code is setting the |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1840 name; if NAME is a string, set F's name to NAME and set |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1841 F->explicit_name; if NAME is Qnil, then clear F->explicit_name. |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1842 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1843 If EXPLICIT is zero, that indicates that Emacs redisplay code is |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1844 suggesting a new name, which lisp code should override; if |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1845 F->explicit_name is set, ignore the new name; otherwise, set it. */ |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1846 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1847 void |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1848 x_set_title (f, name) |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1849 struct frame *f; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1850 Lisp_Object name; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1851 { |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1852 /* Don't change the title if it's already NAME. */ |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1853 if (EQ (name, f->title)) |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1854 return; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1855 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1856 update_mode_lines = 1; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1857 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1858 f->title = name; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1859 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1860 if (NILP (name)) |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1861 name = f->name; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1862 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1863 if (FRAME_X_WINDOW (f)) |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1864 { |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1865 BLOCK_INPUT; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1866 #ifdef HAVE_X11R4 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1867 { |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1868 XTextProperty text, icon; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1869 Lisp_Object icon_name; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1870 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1871 text.value = XSTRING (name)->data; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1872 text.encoding = XA_STRING; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1873 text.format = 8; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1874 text.nitems = XSTRING (name)->size; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1875 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1876 icon_name = (!NILP (f->icon_name) ? f->icon_name : name); |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1877 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1878 icon.value = XSTRING (icon_name)->data; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1879 icon.encoding = XA_STRING; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1880 icon.format = 8; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1881 icon.nitems = XSTRING (icon_name)->size; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1882 #ifdef USE_X_TOOLKIT |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1883 XSetWMName (FRAME_X_DISPLAY (f), |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1884 XtWindow (f->output_data.x->widget), &text); |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1885 XSetWMIconName (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget), |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1886 &icon); |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1887 #else /* not USE_X_TOOLKIT */ |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1888 XSetWMName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text); |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1889 XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon); |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1890 #endif /* not USE_X_TOOLKIT */ |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1891 } |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1892 #else /* not HAVE_X11R4 */ |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1893 XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1894 XSTRING (name)->data); |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1895 XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1896 XSTRING (name)->data); |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1897 #endif /* not HAVE_X11R4 */ |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1898 UNBLOCK_INPUT; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1899 } |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1900 } |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1901 |
389 | 1902 void |
771 | 1903 x_set_autoraise (f, arg, oldval) |
1904 struct frame *f; | |
389 | 1905 Lisp_Object arg, oldval; |
1906 { | |
771 | 1907 f->auto_raise = !EQ (Qnil, arg); |
389 | 1908 } |
1909 | |
1910 void | |
771 | 1911 x_set_autolower (f, arg, oldval) |
1912 struct frame *f; | |
389 | 1913 Lisp_Object arg, oldval; |
1914 { | |
771 | 1915 f->auto_lower = !EQ (Qnil, arg); |
389 | 1916 } |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1917 |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1918 void |
9580
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1919 x_set_unsplittable (f, arg, oldval) |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1920 struct frame *f; |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1921 Lisp_Object arg, oldval; |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1922 { |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1923 f->no_split = !NILP (arg); |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1924 } |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1925 |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1926 void |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1927 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
|
1928 struct frame *f; |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1929 Lisp_Object arg, oldval; |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1930 { |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1931 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
|
1932 { |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1933 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
|
1934 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1935 /* 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
|
1936 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
|
1937 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
|
1938 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
|
1939 if (FRAME_X_WINDOW (f)) |
5899
4e8f26a0f2b7
*** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5721
diff
changeset
|
1940 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
|
1941 } |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1942 } |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1943 |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1944 void |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1945 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
|
1946 struct frame *f; |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1947 Lisp_Object arg, oldval; |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1948 { |
9166
44b44e900cf1
(x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents:
9103
diff
changeset
|
1949 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
|
1950 { |
44b44e900cf1
(x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents:
9103
diff
changeset
|
1951 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
|
1952 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
|
1953 } |
44b44e900cf1
(x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents:
9103
diff
changeset
|
1954 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
|
1955 && 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
|
1956 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1957 int wid = FONT_WIDTH (f->output_data.x->font); |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1958 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
|
1959 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
|
1960 if (FRAME_X_WINDOW (f)) |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1961 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
|
1962 } |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1963 } |
389 | 1964 |
771 | 1965 /* Subroutines of creating an X frame. */ |
389 | 1966 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1967 /* 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
|
1968 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
|
1969 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1970 static void |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1971 validate_x_resource_name () |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1972 { |
11353
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1973 int len; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1974 /* 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
|
1975 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
|
1976 /* 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
|
1977 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
|
1978 Lisp_Object new; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1979 int i; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1980 |
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
|
1981 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
|
1982 { |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1983 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
|
1984 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
|
1985 |
11353
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1986 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
|
1987 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1988 /* 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
|
1989 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
|
1990 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
|
1991 { |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
1992 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
|
1993 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
|
1994 || (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
|
1995 || (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
|
1996 || c == '-' || c == '_')) |
11353
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1997 bad_count++; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1998 else |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1999 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
|
2000 } |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
2001 } |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
2002 else |
11353
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2003 /* 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
|
2004 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
|
2005 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2006 /* 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
|
2007 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
|
2008 return; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2009 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2010 /* 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
|
2011 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
|
2012 || (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
|
2013 { |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2014 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
|
2015 return; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2016 } |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2017 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2018 /* 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
|
2019 with underscores. */ |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2020 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2021 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
|
2022 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2023 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
|
2024 { |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2025 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
|
2026 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
|
2027 || (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
|
2028 || (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
|
2029 || c == '-' || c == '_')) |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2030 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
|
2031 } |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2032 } |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2033 |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2034 |
389 | 2035 extern char *x_get_string_resource (); |
2036 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2037 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
|
2038 "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
|
2039 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
|
2040 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
|
2041 the name specified by the `-name' or `-rn' command-line arguments.\n\ |
389 | 2042 \n\ |
1733
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
2043 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
|
2044 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
|
2045 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
|
2046 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
|
2047 (attribute, class, component, subclass) |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2048 Lisp_Object attribute, class, component, subclass; |
389 | 2049 { |
2050 register char *value; | |
2051 char *name_key; | |
2052 char *class_key; | |
2053 | |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
2054 check_x (); |
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
2055 |
389 | 2056 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
|
2057 CHECK_STRING (class, 0); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2058 |
1733
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
2059 if (!NILP (component)) |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
2060 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
|
2061 if (!NILP (subclass)) |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
2062 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
|
2063 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
|
2064 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
|
2065 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2066 validate_x_resource_name (); |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2067 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2068 /* 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
|
2069 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
|
2070 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
|
2071 + (STRINGP (component) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2072 ? XSTRING (component)->size : 0) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2073 + XSTRING (attribute)->size |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2074 + 3); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2075 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2076 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
|
2077 + XSTRING (class)->size |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2078 + (STRINGP (subclass) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2079 ? XSTRING (subclass)->size : 0) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2080 + 3); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2081 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2082 /* 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
|
2083 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
|
2084 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
|
2085 strcpy (class_key, EMACS_CLASS); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2086 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2087 strcat (class_key, "."); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2088 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
|
2089 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2090 if (!NILP (component)) |
389 | 2091 { |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2092 strcat (class_key, "."); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2093 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
|
2094 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2095 strcat (name_key, "."); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2096 strcat (name_key, XSTRING (component)->data); |
389 | 2097 } |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2098 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2099 strcat (name_key, "."); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2100 strcat (name_key, XSTRING (attribute)->data); |
389 | 2101 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2102 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
|
2103 name_key, class_key); |
389 | 2104 |
2105 if (value != (char *) 0) | |
2106 return build_string (value); | |
2107 else | |
2108 return Qnil; | |
2109 } | |
2110 | |
3173
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2111 /* 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
|
2112 |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2113 char * |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2114 x_get_resource_string (attribute, class) |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2115 char *attribute, *class; |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2116 { |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2117 register char *value; |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2118 char *name_key; |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2119 char *class_key; |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2120 |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2121 /* 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
|
2122 and the final '\0'. */ |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2123 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
|
2124 + strlen (attribute) + 2); |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2125 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
|
2126 + strlen (class) + 2); |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2127 |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2128 sprintf (name_key, "%s.%s", |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2129 XSTRING (Vinvocation_name)->data, |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2130 attribute); |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2131 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
|
2132 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2133 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
|
2134 name_key, class_key); |
3173
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2135 } |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2136 |
398 | 2137 /* Types we might convert a resource string into. */ |
2138 enum resource_types | |
2139 { | |
4571
25bee4fe64aa
(enum resource_types): Delete final comma.
Richard M. Stallman <rms@gnu.org>
parents:
4367
diff
changeset
|
2140 number, boolean, string, symbol |
398 | 2141 }; |
2142 | |
389 | 2143 /* Return the value of parameter PARAM. |
398 | 2144 |
771 | 2145 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
|
2146 database, using ATTRIBUTE as the attribute name and CLASS as its class. |
398 | 2147 |
2148 Convert the resource to the type specified by desired_type. | |
2149 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2150 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
|
2151 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
|
2152 and don't let it get stored in any Lisp-visible variables! */ |
389 | 2153 |
2154 static Lisp_Object | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2155 x_get_arg (alist, param, attribute, class, type) |
641 | 2156 Lisp_Object alist, param; |
398 | 2157 char *attribute; |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2158 char *class; |
398 | 2159 enum resource_types type; |
389 | 2160 { |
2161 register Lisp_Object tem; | |
2162 | |
2163 tem = Fassq (param, alist); | |
2164 if (EQ (tem, Qnil)) | |
771 | 2165 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
|
2166 if (EQ (tem, Qnil)) |
389 | 2167 { |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2168 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2169 if (attribute) |
398 | 2170 { |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2171 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
|
2172 build_string (class), |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2173 Qnil, Qnil); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2174 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2175 if (NILP (tem)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2176 return Qunbound; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2177 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2178 switch (type) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2179 { |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2180 case number: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2181 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
|
2182 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2183 case boolean: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2184 tem = Fdowncase (tem); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2185 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
|
2186 || !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
|
2187 return Qt; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2188 else |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2189 return Qnil; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2190 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2191 case string: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2192 return tem; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2193 |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2194 case symbol: |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2195 /* 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
|
2196 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
|
2197 { |
6519
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
2198 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
|
2199 lower = Fdowncase (tem); |
6523
d9d9ab5951dd
(x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents:
6522
diff
changeset
|
2200 if (!strcmp (XSTRING (lower)->data, "on") |
d9d9ab5951dd
(x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents:
6522
diff
changeset
|
2201 || !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
|
2202 return Qt; |
6523
d9d9ab5951dd
(x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents:
6522
diff
changeset
|
2203 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
|
2204 || !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
|
2205 return Qnil; |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2206 else |
2686
a84b9a78ab08
(x_get_arg): Call Fintern, not intern.
Richard M. Stallman <rms@gnu.org>
parents:
2439
diff
changeset
|
2207 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
|
2208 } |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2209 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2210 default: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2211 abort (); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2212 } |
398 | 2213 } |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2214 else |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2215 return Qunbound; |
389 | 2216 } |
2217 return Fcdr (tem); | |
2218 } | |
2219 | |
771 | 2220 /* Record in frame F the specified or default value according to ALIST |
389 | 2221 of the parameter named PARAM (a Lisp symbol). |
2222 If no value is specified for PARAM, look for an X default for XPROP | |
771 | 2223 on the frame named NAME. |
389 | 2224 If that is not found either, use the value DEFLT. */ |
2225 | |
2226 static Lisp_Object | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2227 x_default_parameter (f, alist, prop, deflt, xprop, xclass, type) |
771 | 2228 struct frame *f; |
389 | 2229 Lisp_Object alist; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2230 Lisp_Object prop; |
389 | 2231 Lisp_Object deflt; |
2232 char *xprop; | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2233 char *xclass; |
398 | 2234 enum resource_types type; |
389 | 2235 { |
2236 Lisp_Object tem; | |
2237 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2238 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
|
2239 if (EQ (tem, Qunbound)) |
389 | 2240 tem = deflt; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2241 x_set_frame_parameters (f, Fcons (Fcons (prop, tem), Qnil)); |
389 | 2242 return tem; |
2243 } | |
2244 | |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2245 DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0, |
389 | 2246 "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
|
2247 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
|
2248 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
|
2249 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
|
2250 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
|
2251 or a list (- N) meaning -N pixels relative to bottom/right corner.") |
389 | 2252 (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
|
2253 Lisp_Object string; |
389 | 2254 { |
2255 int geometry, x, y; | |
2256 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
|
2257 Lisp_Object result; |
389 | 2258 |
2259 CHECK_STRING (string, 0); | |
2260 | |
2261 geometry = XParseGeometry ((char *) XSTRING (string)->data, | |
2262 &x, &y, &width, &height); | |
2263 | |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2264 #if 0 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2265 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
|
2266 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
|
2267 #endif |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2268 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2269 result = Qnil; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2270 if (geometry & XValue) |
389 | 2271 { |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2272 Lisp_Object element; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2273 |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2274 if (x >= 0 && (geometry & XNegative)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2275 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
|
2276 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
|
2277 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
|
2278 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2279 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
|
2280 result = Fcons (element, result); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2281 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2282 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2283 if (geometry & YValue) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2284 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2285 Lisp_Object element; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2286 |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2287 if (y >= 0 && (geometry & YNegative)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2288 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
|
2289 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
|
2290 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
|
2291 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2292 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
|
2293 result = Fcons (element, result); |
389 | 2294 } |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2295 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2296 if (geometry & WidthValue) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2297 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
|
2298 if (geometry & HeightValue) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2299 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
|
2300 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2301 return result; |
389 | 2302 } |
2303 | |
2304 /* 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
|
2305 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
|
2306 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2307 This function does not make the coordinates positive. */ |
389 | 2308 |
2309 #define DEFAULT_ROWS 40 | |
2310 #define DEFAULT_COLS 80 | |
2311 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2312 static int |
771 | 2313 x_figure_window_size (f, parms) |
2314 struct frame *f; | |
389 | 2315 Lisp_Object parms; |
2316 { | |
7251
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2317 register Lisp_Object tem0, tem1, tem2; |
389 | 2318 int height, width, left, top; |
2319 register int geometry; | |
2320 long window_prompting = 0; | |
2321 | |
2322 /* Default values if we fall through. | |
2323 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
|
2324 window manager prompting. */ |
771 | 2325 f->width = DEFAULT_COLS; |
2326 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
|
2327 /* 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
|
2328 positions are not (0,0), they're intentional, not defaults. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2329 f->output_data.x->top_pos = 0; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2330 f->output_data.x->left_pos = 0; |
389 | 2331 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2332 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
|
2333 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
|
2334 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
|
2335 if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) |
389 | 2336 { |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2337 if (!EQ (tem0, Qunbound)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2338 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2339 CHECK_NUMBER (tem0, 0); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2340 f->height = XINT (tem0); |
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 if (!EQ (tem1, Qunbound)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2343 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2344 CHECK_NUMBER (tem1, 0); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2345 f->width = XINT (tem1); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2346 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2347 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
|
2348 window_prompting |= USSize; |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2349 else |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2350 window_prompting |= PSize; |
389 | 2351 } |
2352 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2353 f->output_data.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
|
2354 = (!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
|
2355 ? 0 |
60497ceed71a
(x_figure_window_size): Use new formula for scroll bar width.
Karl Heuer <kwzh@gnu.org>
parents:
9231
diff
changeset
|
2356 : 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
|
2357 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2358 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.x->font))); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2359 f->output_data.x->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2360 f->output_data.x->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height); |
389 | 2361 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2362 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
|
2363 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
|
2364 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
|
2365 if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) |
389 | 2366 { |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2367 if (EQ (tem0, Qminus)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2368 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2369 f->output_data.x->top_pos = 0; |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2370 window_prompting |= YNegative; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2371 } |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2372 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
|
2373 && CONSP (XCONS (tem0)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2374 && 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
|
2375 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2376 f->output_data.x->top_pos = - XINT (XCONS (XCONS (tem0)->cdr)->car); |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2377 window_prompting |= YNegative; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2378 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2379 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
|
2380 && CONSP (XCONS (tem0)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2381 && 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
|
2382 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2383 f->output_data.x->top_pos = XINT (XCONS (XCONS (tem0)->cdr)->car); |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2384 } |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2385 else if (EQ (tem0, Qunbound)) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2386 f->output_data.x->top_pos = 0; |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2387 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2388 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2389 CHECK_NUMBER (tem0, 0); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2390 f->output_data.x->top_pos = XINT (tem0); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2391 if (f->output_data.x->top_pos < 0) |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2392 window_prompting |= YNegative; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2393 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2394 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2395 if (EQ (tem1, Qminus)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2396 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2397 f->output_data.x->left_pos = 0; |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2398 window_prompting |= XNegative; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2399 } |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2400 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
|
2401 && CONSP (XCONS (tem1)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2402 && 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
|
2403 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2404 f->output_data.x->left_pos = - XINT (XCONS (XCONS (tem1)->cdr)->car); |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2405 window_prompting |= XNegative; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2406 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2407 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
|
2408 && CONSP (XCONS (tem1)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2409 && 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
|
2410 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2411 f->output_data.x->left_pos = XINT (XCONS (XCONS (tem1)->cdr)->car); |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2412 } |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2413 else if (EQ (tem1, Qunbound)) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2414 f->output_data.x->left_pos = 0; |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2415 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2416 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2417 CHECK_NUMBER (tem1, 0); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2418 f->output_data.x->left_pos = XINT (tem1); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2419 if (f->output_data.x->left_pos < 0) |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2420 window_prompting |= XNegative; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2421 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2422 |
10264
92dcc001aa20
(x_figure_window_size): Treat missing user-position parm as nil.
Richard M. Stallman <rms@gnu.org>
parents:
10222
diff
changeset
|
2423 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
|
2424 window_prompting |= USPosition; |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2425 else |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2426 window_prompting |= PPosition; |
389 | 2427 } |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2428 |
3293
03e4cad68481
(Fx_close_current_connection): Clear x_current_display.
Richard M. Stallman <rms@gnu.org>
parents:
3203
diff
changeset
|
2429 return window_prompting; |
389 | 2430 } |
2431 | |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2432 #if !defined (HAVE_X11R4) && !defined (HAVE_XSETWMPROTOCOLS) |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2433 |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2434 Status |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2435 XSetWMProtocols (dpy, w, protocols, count) |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2436 Display *dpy; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2437 Window w; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2438 Atom *protocols; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2439 int count; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2440 { |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2441 Atom prop; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2442 prop = XInternAtom (dpy, "WM_PROTOCOLS", False); |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2443 if (prop == None) return False; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2444 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
|
2445 (unsigned char *) protocols, count); |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2446 return True; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2447 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2448 #endif /* not HAVE_X11R4 && not HAVE_XSETWMPROTOCOLS */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2449 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2450 #ifdef USE_X_TOOLKIT |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2451 |
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
|
2452 /* 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
|
2453 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
|
2454 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
|
2455 for example, but Xt doesn't). */ |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2456 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2457 static void |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2458 hack_wm_protocols (f, widget) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2459 FRAME_PTR f; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2460 Widget widget; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2461 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2462 Display *dpy = XtDisplay (widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2463 Window w = XtWindow (widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2464 int need_delete = 1; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2465 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
|
2466 int need_save = 1; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2467 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2468 BLOCK_INPUT; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2469 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2470 Atom type, *atoms = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2471 int format = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2472 unsigned long nitems = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2473 unsigned long bytes_after; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2474 |
11882
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
2475 if ((XGetWindowProperty (dpy, w, |
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
2476 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
|
2477 (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
|
2478 &type, &format, &nitems, &bytes_after, |
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
2479 (unsigned char **) &atoms) |
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
2480 == Success) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2481 && format == 32 && type == XA_ATOM) |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2482 while (nitems > 0) |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2483 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2484 nitems--; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2485 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
|
2486 need_delete = 0; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2487 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
|
2488 need_focus = 0; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2489 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
|
2490 need_save = 0; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2491 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2492 if (atoms) XFree ((char *) atoms); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2493 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2494 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2495 Atom props [10]; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2496 int count = 0; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2497 if (need_delete) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2498 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
|
2499 if (need_focus) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2500 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
|
2501 if (need_save) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2502 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
|
2503 if (count) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2504 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
|
2505 XA_ATOM, 32, PropModeAppend, |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2506 (unsigned char *) props, count); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2507 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2508 UNBLOCK_INPUT; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2509 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2510 #endif |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2511 |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2512 #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
|
2513 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2514 /* 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
|
2515 |
389 | 2516 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
|
2517 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
|
2518 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
|
2519 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
|
2520 int minibuffer_only; |
389 | 2521 { |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2522 XClassHint class_hints; |
6059
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2523 XSetWindowAttributes attributes; |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2524 unsigned long attribute_mask; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2525 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2526 Widget shell_widget; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2527 Widget pane_widget; |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2528 Widget frame_widget; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2529 Arg al [25]; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2530 int ac; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2531 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2532 BLOCK_INPUT; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2533 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2534 /* 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
|
2535 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
|
2536 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
|
2537 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2538 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
|
2539 |
11496
db02849ee365
(x_window): Use (or reuse) frame's namebuf instead of a
Karl Heuer <kwzh@gnu.org>
parents:
11483
diff
changeset
|
2540 { |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2541 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
|
2542 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
|
2543 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
|
2544 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2545 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2546 ac = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2547 XtSetArg (al[ac], XtNallowShellResize, 1); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2548 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
|
2549 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2550 XtSetArg (al[ac], XtNborderWidth, f->output_data.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
|
2551 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
|
2552 applicationShellWidgetClass, |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
2553 FRAME_X_DISPLAY (f), al, ac); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2554 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2555 f->output_data.x->widget = shell_widget; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2556 /* maybe_set_screen_title_format (shell_widget); */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2557 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2558 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
|
2559 (widget_value *) NULL, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2560 shell_widget, False, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2561 (lw_callback) NULL, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2562 (lw_callback) NULL, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2563 (lw_callback) NULL); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2564 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2565 f->output_data.x->column_widget = pane_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
|
2566 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2567 /* 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
|
2568 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
|
2569 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2570 ac = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2571 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2572 XtSetArg (al[ac], XtNshowGrip, 0); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2573 XtSetArg (al[ac], XtNallowResize, 1); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2574 XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2575 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
|
2576 frame_widget = XtCreateWidget (f->namebuf, |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2577 emacsFrameClass, |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2578 pane_widget, al, ac); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2579 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2580 f->output_data.x->edit_widget = frame_widget; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2581 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2582 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
|
2583 |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2584 /* 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
|
2585 { |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2586 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
|
2587 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
|
2588 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
|
2589 int ac = 0; |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2590 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
|
2591 int menubar_size |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2592 = (f->output_data.x->menubar_widget |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2593 ? (f->output_data.x->menubar_widget->core.height |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2594 + f->output_data.x->menubar_widget->core.border_width) |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2595 : 0); |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2596 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
|
2597 |
7969
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2598 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
|
2599 { |
9808
4c43c9dbe130
(x_window): Make ibw 0 by default.
Richard M. Stallman <rms@gnu.org>
parents:
9742
diff
changeset
|
2600 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
|
2601 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
|
2602 menubar_size += ibw; |
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2603 } |
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2604 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2605 f->output_data.x->menubar_height = menubar_size; |
11897
cbd3724a9696
(x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents:
11894
diff
changeset
|
2606 |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2607 /* 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
|
2608 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
|
2609 Both conclusions reached experimentally. -- rms. */ |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2610 if (!strcmp (lwlib_toolkit_type, "motif")) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2611 XtVaGetValues (f->output_data.x->edit_widget, XtNinternalBorderWidth, |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2612 &extra_borders, NULL); |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2613 |
11707
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2614 /* 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
|
2615 and specify it. |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2616 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
|
2617 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
|
2618 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
|
2619 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2620 int left = f->output_data.x->left_pos; |
11707
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2621 int xneg = window_prompting & XNegative; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2622 int top = f->output_data.x->top_pos; |
11707
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2623 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
|
2624 if (xneg) |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2625 left = -left; |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2626 if (yneg) |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2627 top = -top; |
11893
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2628 |
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2629 if (window_prompting & USPosition) |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2630 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
|
2631 PIXEL_WIDTH (f) + extra_borders, |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2632 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
|
2633 (xneg ? '-' : '+'), left, |
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2634 (yneg ? '-' : '+'), top); |
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2635 else |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2636 sprintf (shell_position, "=%dx%d", |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2637 PIXEL_WIDTH (f) + extra_borders, |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2638 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
|
2639 } |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2640 |
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
|
2641 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
|
2642 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
|
2643 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
|
2644 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
|
2645 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
|
2646 } |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2647 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2648 XtManageChild (pane_widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2649 XtRealizeWidget (shell_widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2650 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2651 FRAME_X_WINDOW (f) = XtWindow (frame_widget); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2652 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2653 validate_x_resource_name (); |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2654 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2655 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
|
2656 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
|
2657 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
|
2658 |
13227
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2659 #ifdef HAVE_X_I18N |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2660 #ifndef X_I18N_INHIBITED |
13227
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2661 { |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2662 XIM xim; |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2663 XIC xic = NULL; |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2664 |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2665 xim = XOpenIM (FRAME_X_DISPLAY (f), NULL, NULL, NULL); |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2666 |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2667 if (xim) |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2668 { |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2669 xic = XCreateIC (xim, |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2670 XNInputStyle, XIMPreeditNothing | XIMStatusNothing, |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2671 XNClientWindow, FRAME_X_WINDOW(f), |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2672 XNFocusWindow, FRAME_X_WINDOW(f), |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2673 NULL); |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2674 |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2675 if (xic == 0) |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2676 { |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2677 XCloseIM (xim); |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2678 xim = NULL; |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2679 } |
13227
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2680 } |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2681 FRAME_XIM (f) = xim; |
13227
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2682 FRAME_XIC (f) = xic; |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2683 } |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2684 #else /* X_I18N_INHIBITED */ |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2685 FRAME_XIM (f) = 0; |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2686 FRAME_XIC (f) = 0; |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2687 #endif /* X_I18N_INHIBITED */ |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2688 #endif /* HAVE_X_I18N */ |
13227
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2689 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2690 f->output_data.x->wm_hints.input = True; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2691 f->output_data.x->wm_hints.flags |= InputHint; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2692 XSetWMHints (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2693 &f->output_data.x->wm_hints); |
7172
f9eeb75c2b76
(x_window) [USE_X_TOOLKIT]: Call XSetWMHints.
Richard M. Stallman <rms@gnu.org>
parents:
7040
diff
changeset
|
2694 |
9703
85ac0e4030d4
(x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents:
9690
diff
changeset
|
2695 hack_wm_protocols (f, shell_widget); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2696 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2697 #ifdef HACK_EDITRES |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2698 XtAddEventHandler (shell_widget, 0, True, _XEditResCheckMessages, 0); |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2699 #endif |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2700 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2701 /* 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
|
2702 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
|
2703 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
|
2704 */ |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2705 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
|
2706 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
|
2707 XA_ATOM, 32, PropModeAppend, |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2708 (unsigned char*) NULL, 0); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2709 |
6059
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2710 /* 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
|
2711 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
|
2712 attribute_mask = CWEventMask; |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2713 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
|
2714 attribute_mask, &attributes); |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2715 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2716 XtMapWidget (frame_widget); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2717 |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2718 /* 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
|
2719 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
|
2720 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
|
2721 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
|
2722 { |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2723 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
|
2724 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
|
2725 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2726 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
|
2727 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
|
2728 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
|
2729 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
|
2730 } |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2731 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2732 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2733 f->output_data.x->text_cursor); |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2734 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2735 UNBLOCK_INPUT; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2736 |
11962
f9b853c18bb5
(x_window): Call initialize_frame_menubar
Karl Heuer <kwzh@gnu.org>
parents:
11932
diff
changeset
|
2737 if (!minibuffer_only && FRAME_EXTERNAL_MENU_BAR (f)) |
f9b853c18bb5
(x_window): Call initialize_frame_menubar
Karl Heuer <kwzh@gnu.org>
parents:
11932
diff
changeset
|
2738 initialize_frame_menubar (f); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2739 lw_set_main_areas (pane_widget, f->output_data.x->menubar_widget, frame_widget); |
11962
f9b853c18bb5
(x_window): Call initialize_frame_menubar
Karl Heuer <kwzh@gnu.org>
parents:
11932
diff
changeset
|
2740 |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2741 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
|
2742 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
|
2743 } |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2744 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2745 #else /* not USE_X_TOOLKIT */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2746 |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2747 /* 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
|
2748 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2749 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
|
2750 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
|
2751 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2752 { |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2753 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
|
2754 XSetWindowAttributes attributes; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2755 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
|
2756 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2757 attributes.background_pixel = f->output_data.x->background_pixel; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2758 attributes.border_pixel = f->output_data.x->border_pixel; |
389 | 2759 attributes.bit_gravity = StaticGravity; |
2760 attributes.backing_store = NotUseful; | |
2761 attributes.save_under = True; | |
2762 attributes.event_mask = STANDARD_EVENT_SET; | |
2763 attribute_mask = (CWBackPixel | CWBorderPixel | CWBitGravity | |
2764 #if 0 | |
2765 | CWBackingStore | CWSaveUnder | |
2766 #endif | |
2767 | CWEventMask); | |
2768 | |
2769 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
|
2770 FRAME_X_WINDOW (f) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2771 = XCreateWindow (FRAME_X_DISPLAY (f), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2772 f->output_data.x->parent_desc, |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2773 f->output_data.x->left_pos, |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2774 f->output_data.x->top_pos, |
771 | 2775 PIXEL_WIDTH (f), PIXEL_HEIGHT (f), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2776 f->output_data.x->border_width, |
389 | 2777 CopyFromParent, /* depth */ |
2778 InputOutput, /* class */ | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2779 FRAME_X_DISPLAY_INFO (f)->visual, |
389 | 2780 attribute_mask, &attributes); |
13227
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2781 #ifdef HAVE_X_I18N |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2782 #ifndef X_I18N_INHIBITED |
13227
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2783 { |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2784 XIM xim; |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2785 XIC xic = NULL; |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2786 |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2787 xim = XOpenIM (FRAME_X_DISPLAY(f), NULL, NULL, NULL); |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2788 |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2789 if (xim) |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2790 { |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2791 xic = XCreateIC (xim, |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2792 XNInputStyle, XIMPreeditNothing | XIMStatusNothing, |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2793 XNClientWindow, FRAME_X_WINDOW(f), |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2794 XNFocusWindow, FRAME_X_WINDOW(f), |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2795 NULL); |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2796 |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2797 if (!xic) |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2798 { |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2799 XCloseIM (xim); |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2800 xim = NULL; |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2801 } |
13227
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2802 } |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2803 |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2804 FRAME_XIM (f) = xim; |
13227
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2805 FRAME_XIC (f) = xic; |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2806 } |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2807 #else /* X_I18N_INHIBITED */ |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2808 FRAME_XIM (f) = 0; |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2809 FRAME_XIC (f) = 0; |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2810 #endif /* X_I18N_INHIBITED */ |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2811 #endif /* HAVE_X_I18N */ |
389 | 2812 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2813 validate_x_resource_name (); |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2814 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2815 class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data; |
389 | 2816 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
|
2817 XSetClassHint (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &class_hints); |
771 | 2818 |
11897
cbd3724a9696
(x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents:
11894
diff
changeset
|
2819 /* 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
|
2820 it does not count in addition to the height of the window. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2821 f->output_data.x->menubar_height = 0; |
11897
cbd3724a9696
(x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents:
11894
diff
changeset
|
2822 |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
2823 /* 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
|
2824 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
|
2825 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
|
2826 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
|
2827 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2828 f->output_data.x->wm_hints.input = True; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2829 f->output_data.x->wm_hints.flags |= InputHint; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2830 XSetWMHints (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2831 &f->output_data.x->wm_hints); |
7860
26a1d7b2670b
(x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents:
7802
diff
changeset
|
2832 |
26a1d7b2670b
(x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents:
7802
diff
changeset
|
2833 /* 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
|
2834 { |
26a1d7b2670b
(x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents:
7802
diff
changeset
|
2835 Atom protocols[2]; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2836 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
|
2837 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
|
2838 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
|
2839 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2840 |
817 | 2841 /* x_set_name normally ignores requests to set the name if the |
2842 requested name is the same as the current name. This is the one | |
2843 place where that assumption isn't correct; f->name is set, but | |
2844 the X server hasn't been told. */ | |
2845 { | |
6519
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
2846 Lisp_Object name; |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2847 int explicit = f->explicit_name; |
817 | 2848 |
6519
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
2849 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
|
2850 name = f->name; |
817 | 2851 f->name = Qnil; |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2852 x_set_name (f, name, explicit); |
817 | 2853 } |
2854 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2855 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2856 f->output_data.x->text_cursor); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2857 |
389 | 2858 UNBLOCK_INPUT; |
2859 | |
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
|
2860 if (FRAME_X_WINDOW (f) == 0) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2861 error ("Unable to create window"); |
389 | 2862 } |
2863 | |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2864 #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
|
2865 |
389 | 2866 /* Handle the icon stuff for this window. Perhaps later we might |
2867 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
|
2868 well. */ |
389 | 2869 |
2870 static void | |
771 | 2871 x_icon (f, parms) |
2872 struct frame *f; | |
389 | 2873 Lisp_Object parms; |
2874 { | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2875 Lisp_Object icon_x, icon_y; |
389 | 2876 |
2877 /* 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
|
2878 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
|
2879 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
|
2880 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
|
2881 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) |
389 | 2882 { |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2883 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
|
2884 CHECK_NUMBER (icon_y, 0); |
389 | 2885 } |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2886 else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound)) |
389 | 2887 error ("Both left and top icon corners of icon must be specified"); |
2888 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2889 BLOCK_INPUT; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2890 |
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
|
2891 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
|
2892 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
|
2893 |
389 | 2894 /* 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
|
2895 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
|
2896 (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
|
2897 ? IconicState |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2898 : NormalState)); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2899 |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
2900 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
|
2901 ? 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
|
2902 : f->name))->data); |
12073 | 2903 |
389 | 2904 UNBLOCK_INPUT; |
2905 } | |
2906 | |
2907 /* Make the GC's needed for this window, setting the | |
2908 background, border and mouse colors; also create the | |
2909 mouse cursor and the gray border tile. */ | |
2910 | |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2911 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
|
2912 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2913 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
|
2914 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
|
2915 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
|
2916 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
|
2917 }; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2918 |
389 | 2919 static void |
771 | 2920 x_make_gc (f) |
2921 struct frame *f; | |
389 | 2922 { |
2923 XGCValues gc_values; | |
2924 GC temp_gc; | |
2925 XImage tileimage; | |
2926 | |
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
|
2927 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
|
2928 |
771 | 2929 /* Create the GC's of this frame. |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2930 Note that many default values are used. */ |
389 | 2931 |
2932 /* Normal video */ | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2933 gc_values.font = f->output_data.x->font->fid; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2934 gc_values.foreground = f->output_data.x->foreground_pixel; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2935 gc_values.background = f->output_data.x->background_pixel; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2936 gc_values.line_width = 0; /* Means 1 using fast algorithm. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2937 f->output_data.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
|
2938 FRAME_X_WINDOW (f), |
389 | 2939 GCLineWidth | GCFont |
2940 | GCForeground | GCBackground, | |
2941 &gc_values); | |
2942 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2943 /* Reverse video style. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2944 gc_values.foreground = f->output_data.x->background_pixel; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2945 gc_values.background = f->output_data.x->foreground_pixel; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2946 f->output_data.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
|
2947 FRAME_X_WINDOW (f), |
389 | 2948 GCFont | GCForeground | GCBackground |
2949 | GCLineWidth, | |
2950 &gc_values); | |
2951 | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2952 /* Cursor has cursor-color background, background-color foreground. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2953 gc_values.foreground = f->output_data.x->background_pixel; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2954 gc_values.background = f->output_data.x->cursor_pixel; |
389 | 2955 gc_values.fill_style = FillOpaqueStippled; |
2956 gc_values.stipple | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2957 = XCreateBitmapFromData (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2958 FRAME_X_DISPLAY_INFO (f)->root_window, |
389 | 2959 cursor_bits, 16, 16); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2960 f->output_data.x->cursor_gc |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2961 = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 2962 (GCFont | GCForeground | GCBackground |
2963 | GCFillStyle | GCStipple | GCLineWidth), | |
2964 &gc_values); | |
2965 | |
2966 /* Create the gray border tile used when the pointer is not in | |
771 | 2967 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
|
2968 this must be done on a per-frame basis. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2969 f->output_data.x->border_tile |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
2970 = (XCreatePixmapFromBitmapData |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2971 (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
|
2972 gray_bits, gray_width, gray_height, |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2973 f->output_data.x->foreground_pixel, |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2974 f->output_data.x->background_pixel, |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2975 DefaultDepth (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2976 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
|
2977 |
1982e2983822
* xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents:
2328
diff
changeset
|
2978 UNBLOCK_INPUT; |
389 | 2979 } |
2980 | |
771 | 2981 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, |
389 | 2982 1, 1, 0, |
771 | 2983 "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
|
2984 Returns an Emacs frame object.\n\ |
771 | 2985 ALIST is an alist of frame parameters.\n\ |
2986 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
|
2987 and do not specify a specific minibuffer window to use,\n\ |
771 | 2988 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
|
2989 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
|
2990 \n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
2991 This function is an internal primitive--use `make-frame' instead.") |
389 | 2992 (parms) |
2993 Lisp_Object parms; | |
2994 { | |
771 | 2995 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
|
2996 Lisp_Object frame, tem; |
389 | 2997 Lisp_Object name; |
2998 int minibuffer_only = 0; | |
2999 long window_prompting = 0; | |
3000 int width, height; | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3001 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
|
3002 struct gcpro gcpro1; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3003 Lisp_Object display; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3004 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
|
3005 Lisp_Object parent; |
11774
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3006 struct kboard *kb; |
389 | 3007 |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
3008 check_x (); |
389 | 3009 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3010 /* 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
|
3011 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
|
3012 Vx_resource_name = Vinvocation_name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3013 |
12316
459ad0d54bef
(Fx_create_frame): Fix last arg to x_get_arg for Qdisplay.
Richard M. Stallman <rms@gnu.org>
parents:
12276
diff
changeset
|
3014 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
|
3015 if (EQ (display, Qunbound)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3016 display = Qnil; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3017 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
|
3018 #ifdef MULTI_KBOARD |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3019 kb = dpyinfo->kboard; |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3020 #else |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3021 kb = &the_only_kboard; |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3022 #endif |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3023 |
14381 | 3024 name = x_get_arg (parms, Qname, "name", "Name", string); |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
3025 if (!STRINGP (name) |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3026 && ! EQ (name, Qunbound) |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3027 && ! NILP (name)) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3028 error ("Invalid frame name--not a string or nil"); |
398 | 3029 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3030 if (STRINGP (name)) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3031 Vx_resource_name = name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3032 |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3033 /* 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
|
3034 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
|
3035 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
|
3036 parent = Qnil; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3037 if (! NILP (parent)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3038 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
|
3039 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3040 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
|
3041 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
|
3042 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
|
3043 else if (EQ (tem, Qonly)) |
389 | 3044 { |
771 | 3045 f = make_minibuffer_frame (); |
389 | 3046 minibuffer_only = 1; |
3047 } | |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
3048 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
|
3049 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
|
3050 else |
771 | 3051 f = make_frame (1); |
3052 | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3053 /* 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
|
3054 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
|
3055 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3056 XSETFRAME (frame, f); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3057 GCPRO1 (frame); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3058 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3059 f->output_method = output_x_window; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3060 f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output)); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3061 bzero (f->output_data.x, sizeof (struct x_output)); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3062 f->output_data.x->icon_bitmap = -1; |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3063 |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
3064 f->icon_name |
12073 | 3065 = 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
|
3066 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
|
3067 f->icon_name = Qnil; |
12073 | 3068 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3069 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
|
3070 #ifdef MULTI_KBOARD |
11774
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3071 FRAME_KBOARD (f) = kb; |
11014
634a98104921
(Fx_create_frame): set the frame's kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10920
diff
changeset
|
3072 #endif |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3073 |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3074 /* 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
|
3075 |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3076 if (!NILP (parent)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3077 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3078 f->output_data.x->parent_desc = parent; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3079 f->output_data.x->explicit_parent = 1; |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3080 } |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3081 else |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3082 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3083 f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3084 f->output_data.x->explicit_parent = 0; |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3085 } |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3086 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3087 /* 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
|
3088 f->phys_cursor_x = -1; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3089 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3090 /* 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
|
3091 be set. */ |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3092 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
|
3093 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3094 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
|
3095 f->explicit_name = 0; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3096 } |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3097 else |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3098 { |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3099 f->name = name; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3100 f->explicit_name = 1; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3101 /* 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
|
3102 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
|
3103 } |
771 | 3104 |
389 | 3105 /* Extract the window parameters from the supplied values |
3106 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
|
3107 { |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
3108 Lisp_Object font; |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
3109 |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3110 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
|
3111 BLOCK_INPUT; |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3112 /* 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
|
3113 if (STRINGP (font)) |
4269
fcbdc9cca97a
(Fx_create_frame): Typo in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
4259
diff
changeset
|
3114 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
|
3115 /* 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
|
3116 if (!STRINGP (font)) |
8270
1a0af0f4fb1d
(Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents:
8192
diff
changeset
|
3117 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
|
3118 if (! STRINGP (font)) |
8270
1a0af0f4fb1d
(Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents:
8192
diff
changeset
|
3119 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
|
3120 if (! STRINGP (font)) |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3121 /* 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
|
3122 and takes too long. */ |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3123 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
|
3124 /* 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
|
3125 if (! STRINGP (font)) |
8270
1a0af0f4fb1d
(Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents:
8192
diff
changeset
|
3126 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
|
3127 UNBLOCK_INPUT; |
e2e92cd737bf
* xfns.c (Fx_create_frame): Block input around call to
Jim Blandy <jimb@redhat.com>
parents:
4146
diff
changeset
|
3128 if (! STRINGP (font)) |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3129 font = build_string ("fixed"); |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3130 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
3131 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
|
3132 "font", "Font", string); |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
3133 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3134 |
9808
4c43c9dbe130
(x_window): Make ibw 0 by default.
Richard M. Stallman <rms@gnu.org>
parents:
9742
diff
changeset
|
3135 #ifdef USE_X_TOOLKIT |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
3136 /* 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
|
3137 whereby it fails to get any font. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3138 xlwmenu_default_font = f->output_data.x->font; |
9808
4c43c9dbe130
(x_window): Make ibw 0 by default.
Richard M. Stallman <rms@gnu.org>
parents:
9742
diff
changeset
|
3139 #endif |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
3140 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3141 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
|
3142 "borderwidth", "BorderWidth", number); |
3923
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3143 /* 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
|
3144 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
|
3145 it). */ |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3146 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
|
3147 { |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3148 Lisp_Object value; |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3149 |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3150 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
|
3151 "internalBorder", "BorderWidth", number); |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3152 if (! EQ (value, Qunbound)) |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3153 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
|
3154 parms); |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3155 } |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3156 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
|
3157 "internalBorderWidth", "BorderWidth", number); |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3158 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
|
3159 "verticalScrollBars", "ScrollBars", boolean); |
389 | 3160 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3161 /* 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
|
3162 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
|
3163 "foreground", "Foreground", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3164 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
|
3165 "background", "Background", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3166 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
|
3167 "pointerColor", "Foreground", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3168 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
|
3169 "cursorColor", "Foreground", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3170 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
|
3171 "borderColor", "BorderColor", string); |
389 | 3172 |
8758
fac1c4722677
(Fx_create_frame): Make 1 the default for menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
8675
diff
changeset
|
3173 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
|
3174 "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
|
3175 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
|
3176 "scrollBarWidth", "ScrollBarWidth", number); |
13083
16638ebb209f
(Fx_create_frame): Set up buffer-predicate slot.
Richard M. Stallman <rms@gnu.org>
parents:
12832
diff
changeset
|
3177 x_default_parameter (f, parms, Qbuffer_predicate, Qnil, |
16638ebb209f
(Fx_create_frame): Set up buffer-predicate slot.
Richard M. Stallman <rms@gnu.org>
parents:
12832
diff
changeset
|
3178 "bufferPredicate", "BufferPredicate", symbol); |
14381 | 3179 x_default_parameter (f, parms, Qtitle, Qnil, |
14595
a63b3053a3a3
(Fx_create_frame): Title is a string, not a symbol.
Karl Heuer <kwzh@gnu.org>
parents:
14563
diff
changeset
|
3180 "title", "Title", string); |
6882
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3181 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3182 f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; |
771 | 3183 window_prompting = x_figure_window_size (f, parms); |
3184 | |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3185 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
|
3186 { |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3187 if (window_prompting & YNegative) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3188 f->output_data.x->win_gravity = SouthEastGravity; |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3189 else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3190 f->output_data.x->win_gravity = NorthEastGravity; |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3191 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3192 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3193 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3194 if (window_prompting & YNegative) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3195 f->output_data.x->win_gravity = SouthWestGravity; |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3196 else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3197 f->output_data.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
|
3198 } |
675e4ec5f14f
(Fx_create_frame): Delete excess args to x_wm_set_size_hint.
Richard M. Stallman <rms@gnu.org>
parents:
6882
diff
changeset
|
3199 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3200 f->output_data.x->size_hint_flags = window_prompting; |
7263
b7025b4bf659
(Fx_create_frame): Set the size_hint_flags field.
Richard M. Stallman <rms@gnu.org>
parents:
7261
diff
changeset
|
3201 |
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
|
3202 #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
|
3203 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
|
3204 #else |
771 | 3205 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
|
3206 #endif |
771 | 3207 x_icon (f, parms); |
3208 x_make_gc (f); | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
3209 init_frame_faces (f); |
771 | 3210 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3211 /* 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
|
3212 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
|
3213 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
|
3214 "bitmapIcon", "BitmapIcon", symbol); |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3215 |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3216 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
|
3217 "autoRaise", "AutoRaiseLower", boolean); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3218 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
|
3219 "autoLower", "AutoRaiseLower", boolean); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3220 x_default_parameter (f, parms, Qcursor_type, Qbox, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3221 "cursorType", "CursorType", symbol); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3222 |
771 | 3223 /* Dimensions, especially f->height, must be done via change_frame_size. |
389 | 3224 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
|
3225 f->height. */ |
771 | 3226 width = f->width; |
3227 height = f->height; | |
3228 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
|
3229 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
|
3230 |
11707
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
3231 /* 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
|
3232 and how badly we want them. */ |
389 | 3233 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
|
3234 x_wm_set_size_hint (f, window_prompting, 0); |
389 | 3235 UNBLOCK_INPUT; |
3236 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3237 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean); |
771 | 3238 f->no_split = minibuffer_only || EQ (tem, Qt); |
389 | 3239 |
8103
b0d56b9856c4
(Fx_create_frame): Add GC protection for local var `f'.
Paul Reilly <pmr@pajato.com>
parents:
8091
diff
changeset
|
3240 UNGCPRO; |
b0d56b9856c4
(Fx_create_frame): Add GC protection for local var `f'.
Paul Reilly <pmr@pajato.com>
parents:
8091
diff
changeset
|
3241 |
5429
87c67c389867
(Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents:
5229
diff
changeset
|
3242 /* 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
|
3243 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
|
3244 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
|
3245 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
|
3246 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
|
3247 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3248 /* 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
|
3249 its display. */ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3250 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
|
3251 |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
3252 /* 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
|
3253 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
|
3254 Emacs cannot control visibility, so don't try. */ |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3255 if (! f->output_data.x->explicit_parent) |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3256 { |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3257 Lisp_Object visibility; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3258 |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3259 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
|
3260 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
|
3261 visibility = Qt; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3262 |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3263 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
|
3264 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
|
3265 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
|
3266 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
|
3267 else |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3268 /* 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
|
3269 ; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3270 } |
771 | 3271 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3272 return unbind_to (count, frame); |
389 | 3273 } |
3274 | |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3275 /* 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
|
3276 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
|
3277 know about that structure. */ |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3278 Lisp_Object |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3279 x_get_focus_frame (frame) |
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3280 struct frame *frame; |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3281 { |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3282 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
|
3283 Lisp_Object xfocus; |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3284 if (! dpyinfo->x_focus_frame) |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3285 return Qnil; |
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3286 |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3287 XSETFRAME (xfocus, dpyinfo->x_focus_frame); |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3288 return xfocus; |
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3289 } |
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3290 |
771 | 3291 DEFUN ("focus-frame", Ffocus_frame, Sfocus_frame, 1, 1, 0, |
12773
3fb29deb1b1b
(Ffocus_frame, Funfocus_frame): Make them no-ops.
Richard M. Stallman <rms@gnu.org>
parents:
12672
diff
changeset
|
3292 "This function is obsolete, and does nothing.") |
771 | 3293 (frame) |
3294 Lisp_Object frame; | |
389 | 3295 { |
3296 return Qnil; | |
3297 } | |
3298 | |
771 | 3299 DEFUN ("unfocus-frame", Funfocus_frame, Sunfocus_frame, 0, 0, 0, |
12773
3fb29deb1b1b
(Ffocus_frame, Funfocus_frame): Make them no-ops.
Richard M. Stallman <rms@gnu.org>
parents:
12672
diff
changeset
|
3300 "This function is obsolete, and does nothing.") |
389 | 3301 () |
3302 { | |
3303 return Qnil; | |
3304 } | |
3305 | |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3306 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
|
3307 "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
|
3308 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
|
3309 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
|
3310 \n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3311 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
|
3312 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
|
3313 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
|
3314 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
|
3315 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
|
3316 \n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3317 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
|
3318 set-face-font.\n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3319 \n\ |
6783
3122395ded44
(Fx_list_fonts): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
6770
diff
changeset
|
3320 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
|
3321 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
|
3322 (pattern, face, frame) |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3323 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
|
3324 { |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3325 int num_fonts; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3326 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
|
3327 #ifndef BROKEN_XLISTFONTSWITHINFO |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3328 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
|
3329 #endif |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3330 XFontStruct *size_ref; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3331 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
|
3332 FRAME_PTR f; |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3333 |
5948 | 3334 check_x (); |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3335 CHECK_STRING (pattern, 0); |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3336 if (!NILP (face)) |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3337 CHECK_SYMBOL (face, 1); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3338 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3339 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
|
3340 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3341 /* 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
|
3342 |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3343 if (NILP (face)) |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3344 size_ref = 0; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3345 else |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3346 { |
6882
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3347 int face_id; |
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3348 |
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3349 /* 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
|
3350 if (! FRAME_X_P (f)) |
13867
19a05b5a597d
(check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents:
13781
diff
changeset
|
3351 error ("Non-X frame used in `x-list-fonts'"); |
6882
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3352 |
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3353 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
|
3354 |
3881
9d92b383b584
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3821
diff
changeset
|
3355 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
|
3356 || FRAME_PARAM_FACES (f) [face_id] == 0) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3357 size_ref = f->output_data.x->font; |
3347
53c89f73e85a
(Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents:
3339
diff
changeset
|
3358 else |
53c89f73e85a
(Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents:
3339
diff
changeset
|
3359 { |
3881
9d92b383b584
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3821
diff
changeset
|
3360 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
|
3361 if (size_ref == (XFontStruct *) (~0)) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3362 size_ref = f->output_data.x->font; |
3347
53c89f73e85a
(Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents:
3339
diff
changeset
|
3363 } |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3364 } |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3365 |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3366 /* 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
|
3367 list = Fassoc (pattern, |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3368 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
|
3369 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3370 /* 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
|
3371 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
|
3372 { |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3373 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
|
3374 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3375 /* 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
|
3376 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
|
3377 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3378 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
|
3379 return list; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3380 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3381 BLOCK_INPUT; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3382 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3383 /* 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
|
3384 newlist = Qnil; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3385 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
|
3386 { |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3387 XFontStruct *thisinfo; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3388 |
14979
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3389 x_catch_errors (FRAME_X_DISPLAY (f)); |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3390 |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3391 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
|
3392 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
|
3393 |
14979
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3394 x_check_errors (FRAME_X_DISPLAY (f), "XLoadQueryFont failure: %s"); |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3395 x_uncatch_errors (FRAME_X_DISPLAY (f)); |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3396 |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3397 if (thisinfo && same_size_fonts (thisinfo, size_ref)) |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3398 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
|
3399 |
12546
f4fb791df099
(Fx_list_fonts): Don't free thisinfo if it is 0.
Karl Heuer <kwzh@gnu.org>
parents:
12470
diff
changeset
|
3400 if (thisinfo != 0) |
f4fb791df099
(Fx_list_fonts): Don't free thisinfo if it is 0.
Karl Heuer <kwzh@gnu.org>
parents:
12470
diff
changeset
|
3401 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
|
3402 } |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3403 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3404 UNBLOCK_INPUT; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3405 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3406 return newlist; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3407 } |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3408 |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3409 BLOCK_INPUT; |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3410 |
14979
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3411 x_catch_errors (FRAME_X_DISPLAY (f)); |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3412 |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3413 /* 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
|
3414 #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
|
3415 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
|
3416 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
|
3417 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
|
3418 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
|
3419 &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
|
3420 &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
|
3421 else |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3422 #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
|
3423 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
|
3424 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
|
3425 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
|
3426 &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
|
3427 |
14979
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3428 x_check_errors (FRAME_X_DISPLAY (f), "XListFonts failure: %s"); |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3429 x_uncatch_errors (FRAME_X_DISPLAY (f)); |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3430 |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3431 UNBLOCK_INPUT; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3432 |
3640
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3433 list = Qnil; |
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3434 |
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3435 if (names) |
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3436 { |
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3437 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
|
3438 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
|
3439 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3440 /* 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
|
3441 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
|
3442 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
|
3443 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
|
3444 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
|
3445 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
|
3446 = 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
|
3447 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
|
3448 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3449 /* 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
|
3450 list = Qnil; |
3640
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3451 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
|
3452 { |
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
|
3453 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
|
3454 |
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
|
3455 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
|
3456 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
|
3457 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
|
3458 { |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3459 #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
|
3460 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
|
3461 |
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
|
3462 BLOCK_INPUT; |
14979
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3463 |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3464 x_catch_errors (FRAME_X_DISPLAY (f)); |
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
|
3465 thisinfo = XLoadQueryFont (FRAME_X_DISPLAY (f), names[i]); |
14979
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3466 x_check_errors (FRAME_X_DISPLAY (f), |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3467 "XLoadQueryFont failure: %s"); |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3468 x_uncatch_errors (FRAME_X_DISPLAY (f)); |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3469 |
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
|
3470 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
|
3471 |
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
|
3472 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
|
3473 #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
|
3474 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
|
3475 #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
|
3476 } |
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
|
3477 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
|
3478 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
|
3479 } |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3480 list = Fnreverse (list); |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3481 |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3482 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
|
3483 #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
|
3484 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
|
3485 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
|
3486 else |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3487 #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
|
3488 XFreeFontNames (names); |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3489 UNBLOCK_INPUT; |
3640
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3490 } |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3491 |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3492 return list; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3493 } |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3494 |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3495 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3496 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
|
3497 "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
|
3498 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
|
3499 (color, frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3500 Lisp_Object color, frame; |
389 | 3501 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3502 XColor foo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3503 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
|
3504 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3505 CHECK_STRING (color, 1); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3506 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3507 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
|
3508 return Qt; |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3509 else |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3510 return Qnil; |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3511 } |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3512 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3513 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
|
3514 "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
|
3515 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
|
3516 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
|
3517 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
|
3518 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
|
3519 (color, frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3520 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
|
3521 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3522 XColor foo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3523 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
|
3524 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3525 CHECK_STRING (color, 1); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3526 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3527 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
|
3528 { |
4c69fcaaa037
(Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents:
8405
diff
changeset
|
3529 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
|
3530 |
4c69fcaaa037
(Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents:
8405
diff
changeset
|
3531 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
|
3532 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
|
3533 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
|
3534 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
|
3535 } |
389 | 3536 else |
3537 return Qnil; | |
3538 } | |
3539 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3540 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
|
3541 "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
|
3542 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
|
3543 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
|
3544 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
|
3545 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3546 Lisp_Object display; |
389 | 3547 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3548 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
|
3549 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3550 if (dpyinfo->n_planes <= 2) |
389 | 3551 return Qnil; |
3552 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3553 switch (dpyinfo->visual->class) |
389 | 3554 { |
3555 case StaticColor: | |
3556 case PseudoColor: | |
3557 case TrueColor: | |
3558 case DirectColor: | |
3559 return Qt; | |
3560 | |
3561 default: | |
3562 return Qnil; | |
3563 } | |
3564 } | |
3565 | |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3566 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
|
3567 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3568 "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
|
3569 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
|
3570 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
|
3571 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
|
3572 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
|
3573 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3574 Lisp_Object display; |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3575 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3576 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
|
3577 |
12347
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3578 if (dpyinfo->n_planes <= 1) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3579 return Qnil; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3580 |
12347
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3581 switch (dpyinfo->visual->class) |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3582 { |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3583 case StaticColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3584 case PseudoColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3585 case TrueColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3586 case DirectColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3587 case StaticGray: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3588 case GrayScale: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3589 return Qt; |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3590 |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3591 default: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3592 return Qnil; |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3593 } |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3594 } |
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3595 |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3596 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
|
3597 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3598 "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
|
3599 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
|
3600 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
|
3601 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
|
3602 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3603 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3604 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3605 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
|
3606 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3607 return make_number (dpyinfo->width); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3608 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3609 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3610 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
|
3611 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
|
3612 "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
|
3613 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
|
3614 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
|
3615 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
|
3616 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3617 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3618 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3619 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
|
3620 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3621 return make_number (dpyinfo->height); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3622 } |
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 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
|
3625 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3626 "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
|
3627 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
|
3628 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
|
3629 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
|
3630 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3631 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3632 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3633 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
|
3634 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3635 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
|
3636 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3637 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3638 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
|
3639 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3640 "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
|
3641 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
|
3642 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
|
3643 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
|
3644 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3645 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3646 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3647 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
|
3648 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3649 return make_number (DisplayCells (dpyinfo->display, |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3650 XScreenNumberOfScreen (dpyinfo->screen))); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3651 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3652 |
4279 | 3653 DEFUN ("x-server-max-request-size", Fx_server_max_request_size, |
3654 Sx_server_max_request_size, | |
3655 0, 1, 0, | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3656 "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
|
3657 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
|
3658 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
|
3659 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
|
3660 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3661 Lisp_Object display; |
4279 | 3662 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3663 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
|
3664 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3665 return make_number (MAXREQUEST (dpyinfo->display)); |
4279 | 3666 } |
3667 | |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3668 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
|
3669 "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
|
3670 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
|
3671 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
|
3672 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
|
3673 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3674 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3675 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3676 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
|
3677 char *vendor = ServerVendor (dpyinfo->display); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3678 |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3679 if (! vendor) vendor = ""; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3680 return build_string (vendor); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3681 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3682 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3683 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
|
3684 "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
|
3685 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
|
3686 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
|
3687 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
|
3688 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
|
3689 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
|
3690 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
|
3691 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3692 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3693 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3694 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
|
3695 Display *dpy = dpyinfo->display; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3696 |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3697 return Fcons (make_number (ProtocolVersion (dpy)), |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3698 Fcons (make_number (ProtocolRevision (dpy)), |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3699 Fcons (make_number (VendorRelease (dpy)), Qnil))); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3700 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3701 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3702 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
|
3703 "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
|
3704 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
|
3705 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
|
3706 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
|
3707 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3708 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3709 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3710 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
|
3711 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3712 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
|
3713 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3714 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3715 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
|
3716 "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
|
3717 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
|
3718 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
|
3719 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
|
3720 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3721 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3722 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3723 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
|
3724 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3725 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
|
3726 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3727 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3728 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
|
3729 "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
|
3730 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
|
3731 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
|
3732 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
|
3733 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3734 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3735 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3736 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
|
3737 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3738 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
|
3739 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3740 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3741 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
|
3742 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
|
3743 "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
|
3744 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
|
3745 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
|
3746 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
|
3747 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
|
3748 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3749 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3750 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3751 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
|
3752 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3753 switch (DoesBackingStore (dpyinfo->screen)) |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3754 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3755 case Always: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3756 return intern ("always"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3757 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3758 case WhenMapped: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3759 return intern ("when-mapped"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3760 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3761 case NotUseful: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3762 return intern ("not-useful"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3763 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3764 default: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3765 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
|
3766 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3767 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3768 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3769 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
|
3770 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
|
3771 "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
|
3772 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
|
3773 `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
|
3774 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
|
3775 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
|
3776 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
|
3777 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3778 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3779 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3780 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
|
3781 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3782 switch (dpyinfo->visual->class) |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3783 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3784 case StaticGray: return (intern ("static-gray")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3785 case GrayScale: return (intern ("gray-scale")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3786 case StaticColor: return (intern ("static-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3787 case PseudoColor: return (intern ("pseudo-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3788 case TrueColor: return (intern ("true-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3789 case DirectColor: return (intern ("direct-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3790 default: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3791 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
|
3792 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3793 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3794 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3795 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
|
3796 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
|
3797 "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
|
3798 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
|
3799 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
|
3800 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
|
3801 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3802 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3803 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3804 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
|
3805 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3806 if (DoesSaveUnders (dpyinfo->screen) == True) |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3807 return Qt; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3808 else |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3809 return Qnil; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3810 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3811 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3812 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3813 x_pixel_width (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3814 register struct frame *f; |
389 | 3815 { |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3816 return PIXEL_WIDTH (f); |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3817 } |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3818 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3819 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3820 x_pixel_height (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3821 register struct frame *f; |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3822 { |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3823 return PIXEL_HEIGHT (f); |
389 | 3824 } |
3825 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3826 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3827 x_char_width (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3828 register struct frame *f; |
389 | 3829 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3830 return FONT_WIDTH (f->output_data.x->font); |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3831 } |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3832 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3833 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3834 x_char_height (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3835 register struct frame *f; |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3836 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3837 return f->output_data.x->line_height; |
389 | 3838 } |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3839 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3840 int |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3841 x_screen_planes (frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3842 Lisp_Object frame; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3843 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3844 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
|
3845 } |
389 | 3846 |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
3847 #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
|
3848 |
771 | 3849 /* Draw a rectangle on the frame with left top corner including |
389 | 3850 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
|
3851 CHARS by LINES wide and long and is the color of the cursor. */ |
389 | 3852 |
3853 void | |
771 | 3854 x_rectangle (f, gc, left_char, top_char, chars, lines) |
3855 register struct frame *f; | |
389 | 3856 GC gc; |
3857 register int top_char, left_char, chars, lines; | |
3858 { | |
3859 int width; | |
3860 int height; | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3861 int left = (left_char * FONT_WIDTH (f->output_data.x->font) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3862 + f->output_data.x->internal_border_width); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3863 int top = (top_char * f->output_data.x->line_height |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3864 + f->output_data.x->internal_border_width); |
389 | 3865 |
3866 if (chars < 0) | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3867 width = FONT_WIDTH (f->output_data.x->font) / 2; |
389 | 3868 else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3869 width = FONT_WIDTH (f->output_data.x->font) * chars; |
389 | 3870 if (lines < 0) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3871 height = f->output_data.x->line_height / 2; |
389 | 3872 else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3873 height = f->output_data.x->line_height * lines; |
771 | 3874 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3875 XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 3876 gc, left, top, width, height); |
3877 } | |
3878 | |
3879 DEFUN ("x-draw-rectangle", Fx_draw_rectangle, Sx_draw_rectangle, 5, 5, 0, | |
771 | 3880 "Draw a rectangle on FRAME between coordinates specified by\n\ |
389 | 3881 numbers X0, Y0, X1, Y1 in the cursor pixel.") |
771 | 3882 (frame, X0, Y0, X1, Y1) |
3883 register Lisp_Object frame, X0, X1, Y0, Y1; | |
389 | 3884 { |
3885 register int x0, y0, x1, y1, top, left, n_chars, n_lines; | |
3886 | |
771 | 3887 CHECK_LIVE_FRAME (frame, 0); |
389 | 3888 CHECK_NUMBER (X0, 0); |
3889 CHECK_NUMBER (Y0, 1); | |
3890 CHECK_NUMBER (X1, 2); | |
3891 CHECK_NUMBER (Y1, 3); | |
3892 | |
3893 x0 = XINT (X0); | |
3894 x1 = XINT (X1); | |
3895 y0 = XINT (Y0); | |
3896 y1 = XINT (Y1); | |
3897 | |
3898 if (y1 > y0) | |
3899 { | |
3900 top = y0; | |
3901 n_lines = y1 - y0 + 1; | |
3902 } | |
3903 else | |
3904 { | |
3905 top = y1; | |
3906 n_lines = y0 - y1 + 1; | |
3907 } | |
3908 | |
3909 if (x1 > x0) | |
3910 { | |
3911 left = x0; | |
3912 n_chars = x1 - x0 + 1; | |
3913 } | |
3914 else | |
3915 { | |
3916 left = x1; | |
3917 n_chars = x0 - x1 + 1; | |
3918 } | |
3919 | |
3920 BLOCK_INPUT; | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3921 x_rectangle (XFRAME (frame), XFRAME (frame)->output_data.x->cursor_gc, |
389 | 3922 left, top, n_chars, n_lines); |
3923 UNBLOCK_INPUT; | |
3924 | |
3925 return Qt; | |
3926 } | |
3927 | |
3928 DEFUN ("x-erase-rectangle", Fx_erase_rectangle, Sx_erase_rectangle, 5, 5, 0, | |
771 | 3929 "Draw a rectangle drawn on FRAME between coordinates\n\ |
389 | 3930 X0, Y0, X1, Y1 in the regular background-pixel.") |
771 | 3931 (frame, X0, Y0, X1, Y1) |
3932 register Lisp_Object frame, X0, Y0, X1, Y1; | |
389 | 3933 { |
3934 register int x0, y0, x1, y1, top, left, n_chars, n_lines; | |
3935 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3936 CHECK_LIVE_FRAME (frame, 0); |
389 | 3937 CHECK_NUMBER (X0, 0); |
3938 CHECK_NUMBER (Y0, 1); | |
3939 CHECK_NUMBER (X1, 2); | |
3940 CHECK_NUMBER (Y1, 3); | |
3941 | |
3942 x0 = XINT (X0); | |
3943 x1 = XINT (X1); | |
3944 y0 = XINT (Y0); | |
3945 y1 = XINT (Y1); | |
3946 | |
3947 if (y1 > y0) | |
3948 { | |
3949 top = y0; | |
3950 n_lines = y1 - y0 + 1; | |
3951 } | |
3952 else | |
3953 { | |
3954 top = y1; | |
3955 n_lines = y0 - y1 + 1; | |
3956 } | |
3957 | |
3958 if (x1 > x0) | |
3959 { | |
3960 left = x0; | |
3961 n_chars = x1 - x0 + 1; | |
3962 } | |
3963 else | |
3964 { | |
3965 left = x1; | |
3966 n_chars = x0 - x1 + 1; | |
3967 } | |
3968 | |
3969 BLOCK_INPUT; | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3970 x_rectangle (XFRAME (frame), XFRAME (frame)->output_data.x->reverse_gc, |
389 | 3971 left, top, n_chars, n_lines); |
3972 UNBLOCK_INPUT; | |
3973 | |
3974 return Qt; | |
3975 } | |
3976 | |
3977 /* Draw lines around the text region beginning at the character position | |
3978 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
|
3979 pixel and line characteristics. */ |
389 | 3980 |
771 | 3981 #define line_len(line) (FRAME_CURRENT_GLYPHS (f)->used[(line)]) |
389 | 3982 |
3983 static void | |
771 | 3984 outline_region (f, gc, top_x, top_y, bottom_x, bottom_y) |
3985 register struct frame *f; | |
389 | 3986 GC gc; |
3987 int top_x, top_y, bottom_x, bottom_y; | |
3988 { | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3989 register int ibw = f->output_data.x->internal_border_width; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3990 register int font_w = FONT_WIDTH (f->output_data.x->font); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3991 register int font_h = f->output_data.x->line_height; |
389 | 3992 int y = top_y; |
3993 int x = line_len (y); | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3994 XPoint *pixel_points |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3995 = (XPoint *) alloca (((bottom_y - top_y + 2) * 4) * sizeof (XPoint)); |
389 | 3996 register XPoint *this_point = pixel_points; |
3997 | |
3998 /* Do the horizontal top line/lines */ | |
3999 if (top_x == 0) | |
4000 { | |
4001 this_point->x = ibw; | |
4002 this_point->y = ibw + (font_h * top_y); | |
4003 this_point++; | |
4004 if (x == 0) | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4005 this_point->x = ibw + (font_w / 2); /* Half-size for newline chars. */ |
389 | 4006 else |
4007 this_point->x = ibw + (font_w * x); | |
4008 this_point->y = (this_point - 1)->y; | |
4009 } | |
4010 else | |
4011 { | |
4012 this_point->x = ibw; | |
4013 this_point->y = ibw + (font_h * (top_y + 1)); | |
4014 this_point++; | |
4015 this_point->x = ibw + (font_w * top_x); | |
4016 this_point->y = (this_point - 1)->y; | |
4017 this_point++; | |
4018 this_point->x = (this_point - 1)->x; | |
4019 this_point->y = ibw + (font_h * top_y); | |
4020 this_point++; | |
4021 this_point->x = ibw + (font_w * x); | |
4022 this_point->y = (this_point - 1)->y; | |
4023 } | |
4024 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4025 /* Now do the right side. */ |
389 | 4026 while (y < bottom_y) |
4027 { /* Right vertical edge */ | |
4028 this_point++; | |
4029 this_point->x = (this_point - 1)->x; | |
4030 this_point->y = ibw + (font_h * (y + 1)); | |
4031 this_point++; | |
4032 | |
4033 y++; /* Horizontal connection to next line */ | |
4034 x = line_len (y); | |
4035 if (x == 0) | |
4036 this_point->x = ibw + (font_w / 2); | |
4037 else | |
4038 this_point->x = ibw + (font_w * x); | |
4039 | |
4040 this_point->y = (this_point - 1)->y; | |
4041 } | |
4042 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4043 /* Now do the bottom and connect to the top left point. */ |
389 | 4044 this_point->x = ibw + (font_w * (bottom_x + 1)); |
4045 | |
4046 this_point++; | |
4047 this_point->x = (this_point - 1)->x; | |
4048 this_point->y = ibw + (font_h * (bottom_y + 1)); | |
4049 this_point++; | |
4050 this_point->x = ibw; | |
4051 this_point->y = (this_point - 1)->y; | |
4052 this_point++; | |
4053 this_point->x = pixel_points->x; | |
4054 this_point->y = pixel_points->y; | |
4055 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4056 XDrawLines (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4057 gc, pixel_points, |
4058 (this_point - pixel_points + 1), CoordModeOrigin); | |
4059 } | |
4060 | |
4061 DEFUN ("x-contour-region", Fx_contour_region, Sx_contour_region, 1, 1, 0, | |
4062 "Highlight the region between point and the character under the mouse\n\ | |
771 | 4063 selected frame.") |
389 | 4064 (event) |
4065 register Lisp_Object event; | |
4066 { | |
4067 register int x0, y0, x1, y1; | |
771 | 4068 register struct frame *f = selected_frame; |
389 | 4069 register int p1, p2; |
4070 | |
4071 CHECK_CONS (event, 0); | |
4072 | |
4073 BLOCK_INPUT; | |
4074 x0 = XINT (Fcar (Fcar (event))); | |
4075 y0 = XINT (Fcar (Fcdr (Fcar (event)))); | |
4076 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4077 /* 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
|
4078 /* ReWrite this... */ |
389 | 4079 |
771 | 4080 x1 = f->cursor_x; |
4081 y1 = f->cursor_y; | |
389 | 4082 |
4083 if (y1 > y0) /* point below mouse */ | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4084 outline_region (f, f->output_data.x->cursor_gc, |
389 | 4085 x0, y0, x1, y1); |
4086 else if (y1 < y0) /* point above mouse */ | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4087 outline_region (f, f->output_data.x->cursor_gc, |
389 | 4088 x1, y1, x0, y0); |
4089 else /* same line: draw horizontal rectangle */ | |
4090 { | |
4091 if (x1 > x0) | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4092 x_rectangle (f, f->output_data.x->cursor_gc, |
389 | 4093 x0, y0, (x1 - x0 + 1), 1); |
4094 else if (x1 < x0) | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4095 x_rectangle (f, f->output_data.x->cursor_gc, |
389 | 4096 x1, y1, (x0 - x1 + 1), 1); |
4097 } | |
4098 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4099 XFlush (FRAME_X_DISPLAY (f)); |
389 | 4100 UNBLOCK_INPUT; |
4101 | |
4102 return Qnil; | |
4103 } | |
4104 | |
4105 DEFUN ("x-uncontour-region", Fx_uncontour_region, Sx_uncontour_region, 1, 1, 0, | |
4106 "Erase any highlighting of the region between point and the character\n\ | |
771 | 4107 at X, Y on the selected frame.") |
389 | 4108 (event) |
4109 register Lisp_Object event; | |
4110 { | |
4111 register int x0, y0, x1, y1; | |
771 | 4112 register struct frame *f = selected_frame; |
389 | 4113 |
4114 BLOCK_INPUT; | |
4115 x0 = XINT (Fcar (Fcar (event))); | |
4116 y0 = XINT (Fcar (Fcdr (Fcar (event)))); | |
771 | 4117 x1 = f->cursor_x; |
4118 y1 = f->cursor_y; | |
389 | 4119 |
4120 if (y1 > y0) /* point below mouse */ | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4121 outline_region (f, f->output_data.x->reverse_gc, |
389 | 4122 x0, y0, x1, y1); |
4123 else if (y1 < y0) /* point above mouse */ | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4124 outline_region (f, f->output_data.x->reverse_gc, |
389 | 4125 x1, y1, x0, y0); |
4126 else /* same line: draw horizontal rectangle */ | |
4127 { | |
4128 if (x1 > x0) | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4129 x_rectangle (f, f->output_data.x->reverse_gc, |
389 | 4130 x0, y0, (x1 - x0 + 1), 1); |
4131 else if (x1 < x0) | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4132 x_rectangle (f, f->output_data.x->reverse_gc, |
389 | 4133 x1, y1, (x0 - x1 + 1), 1); |
4134 } | |
4135 UNBLOCK_INPUT; | |
4136 | |
4137 return Qnil; | |
4138 } | |
4139 | |
4140 #if 0 | |
4141 int contour_begin_x, contour_begin_y; | |
4142 int contour_end_x, contour_end_y; | |
4143 int contour_npoints; | |
4144 | |
4145 /* Clip the top part of the contour lines down (and including) line Y_POS. | |
4146 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
|
4147 down a line at that character. */ |
389 | 4148 |
4149 static void | |
4150 clip_contour_top (y_pos, x_pos) | |
4151 { | |
4152 register XPoint *begin = contour_lines[y_pos].top_left; | |
4153 register XPoint *end; | |
4154 register int npoints; | |
771 | 4155 register struct display_line *line = selected_frame->phys_lines[y_pos + 1]; |
389 | 4156 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4157 if (x_pos >= line->len - 1) /* Draw one, straight horizontal line. */ |
389 | 4158 { |
4159 end = contour_lines[y_pos].top_right; | |
4160 npoints = (end - begin + 1); | |
4161 XDrawLines (x_current_display, contour_window, | |
4162 contour_erase_gc, begin_erase, npoints, CoordModeOrigin); | |
4163 | |
4164 bcopy (end, begin + 1, contour_last_point - end + 1); | |
4165 contour_last_point -= (npoints - 2); | |
4166 XDrawLines (x_current_display, contour_window, | |
4167 contour_erase_gc, begin, 2, CoordModeOrigin); | |
4168 XFlush (x_current_display); | |
4169 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4170 /* Now, update contour_lines structure. */ |
389 | 4171 } |
4172 /* ______. */ | |
4173 else /* |________*/ | |
4174 { | |
4175 register XPoint *p = begin + 1; | |
4176 end = contour_lines[y_pos].bottom_right; | |
4177 npoints = (end - begin + 1); | |
4178 XDrawLines (x_current_display, contour_window, | |
4179 contour_erase_gc, begin_erase, npoints, CoordModeOrigin); | |
4180 | |
4181 p->y = begin->y; | |
4182 p->x = ibw + (font_w * (x_pos + 1)); | |
4183 p++; | |
4184 p->y = begin->y + font_h; | |
4185 p->x = (p - 1)->x; | |
4186 bcopy (end, begin + 3, contour_last_point - end + 1); | |
4187 contour_last_point -= (npoints - 5); | |
4188 XDrawLines (x_current_display, contour_window, | |
4189 contour_erase_gc, begin, 4, CoordModeOrigin); | |
4190 XFlush (x_current_display); | |
4191 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4192 /* Now, update contour_lines structure. */ |
389 | 4193 } |
4194 } | |
4195 | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3512
diff
changeset
|
4196 /* 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
|
4197 the contour upwards. */ |
389 | 4198 |
4199 static void | |
4200 extend_contour_top (line) | |
4201 { | |
4202 } | |
4203 | |
4204 static void | |
4205 clip_contour_bottom (x_pos, y_pos) | |
4206 int x_pos, y_pos; | |
4207 { | |
4208 } | |
4209 | |
4210 static void | |
4211 extend_contour_bottom (x_pos, y_pos) | |
4212 { | |
4213 } | |
4214 | |
4215 DEFUN ("x-select-region", Fx_select_region, Sx_select_region, 1, 1, "e", | |
4216 "") | |
4217 (event) | |
4218 Lisp_Object event; | |
4219 { | |
771 | 4220 register struct frame *f = selected_frame; |
4221 register int point_x = f->cursor_x; | |
4222 register int point_y = f->cursor_y; | |
389 | 4223 register int mouse_below_point; |
4224 register Lisp_Object obj; | |
4225 register int x_contour_x, x_contour_y; | |
4226 | |
4227 x_contour_x = x_mouse_x; | |
4228 x_contour_y = x_mouse_y; | |
4229 if (x_contour_y > point_y || (x_contour_y == point_y | |
4230 && x_contour_x > point_x)) | |
4231 { | |
4232 mouse_below_point = 1; | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4233 outline_region (f, f->output_data.x->cursor_gc, point_x, point_y, |
389 | 4234 x_contour_x, x_contour_y); |
4235 } | |
4236 else | |
4237 { | |
4238 mouse_below_point = 0; | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4239 outline_region (f, f->output_data.x->cursor_gc, x_contour_x, x_contour_y, |
389 | 4240 point_x, point_y); |
4241 } | |
4242 | |
4243 while (1) | |
4244 { | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
4245 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
|
4246 if (!CONSP (obj)) |
389 | 4247 break; |
4248 | |
4249 if (mouse_below_point) | |
4250 { | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4251 if (x_mouse_y <= point_y) /* Flipped. */ |
389 | 4252 { |
4253 mouse_below_point = 0; | |
4254 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4255 outline_region (f, f->output_data.x->reverse_gc, point_x, point_y, |
389 | 4256 x_contour_x, x_contour_y); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4257 outline_region (f, f->output_data.x->cursor_gc, x_mouse_x, x_mouse_y, |
389 | 4258 point_x, point_y); |
4259 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4260 else if (x_mouse_y < x_contour_y) /* Bottom clipped. */ |
389 | 4261 { |
4262 clip_contour_bottom (x_mouse_y); | |
4263 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4264 else if (x_mouse_y > x_contour_y) /* Bottom extended. */ |
389 | 4265 { |
4266 extend_bottom_contour (x_mouse_y); | |
4267 } | |
4268 | |
4269 x_contour_x = x_mouse_x; | |
4270 x_contour_y = x_mouse_y; | |
4271 } | |
4272 else /* mouse above or same line as point */ | |
4273 { | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4274 if (x_mouse_y >= point_y) /* Flipped. */ |
389 | 4275 { |
4276 mouse_below_point = 1; | |
4277 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4278 outline_region (f, f->output_data.x->reverse_gc, |
389 | 4279 x_contour_x, x_contour_y, point_x, point_y); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4280 outline_region (f, f->output_data.x->cursor_gc, point_x, point_y, |
389 | 4281 x_mouse_x, x_mouse_y); |
4282 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4283 else if (x_mouse_y > x_contour_y) /* Top clipped. */ |
389 | 4284 { |
4285 clip_contour_top (x_mouse_y); | |
4286 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4287 else if (x_mouse_y < x_contour_y) /* Top extended. */ |
389 | 4288 { |
4289 extend_contour_top (x_mouse_y); | |
4290 } | |
4291 } | |
4292 } | |
4293 | |
1601
a371ec79bc31
* xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents:
1528
diff
changeset
|
4294 unread_command_event = obj; |
389 | 4295 if (mouse_below_point) |
4296 { | |
4297 contour_begin_x = point_x; | |
4298 contour_begin_y = point_y; | |
4299 contour_end_x = x_contour_x; | |
4300 contour_end_y = x_contour_y; | |
4301 } | |
4302 else | |
4303 { | |
4304 contour_begin_x = x_contour_x; | |
4305 contour_begin_y = x_contour_y; | |
4306 contour_end_x = point_x; | |
4307 contour_end_y = point_y; | |
4308 } | |
4309 } | |
4310 #endif | |
4311 | |
4312 DEFUN ("x-horizontal-line", Fx_horizontal_line, Sx_horizontal_line, 1, 1, "e", | |
4313 "") | |
4314 (event) | |
4315 Lisp_Object event; | |
4316 { | |
4317 register Lisp_Object obj; | |
771 | 4318 struct frame *f = selected_frame; |
389 | 4319 register struct window *w = XWINDOW (selected_window); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4320 register GC line_gc = f->output_data.x->cursor_gc; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4321 register GC erase_gc = f->output_data.x->reverse_gc; |
389 | 4322 #if 0 |
4323 char dash_list[] = {6, 4, 6, 4}; | |
4324 int dashes = 4; | |
4325 XGCValues gc_values; | |
4326 #endif | |
4327 register int previous_y; | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4328 register int line = (x_mouse_y + 1) * f->output_data.x->line_height |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4329 + f->output_data.x->internal_border_width; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4330 register int left = f->output_data.x->internal_border_width |
389 | 4331 + (w->left |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4332 * FONT_WIDTH (f->output_data.x->font)); |
389 | 4333 register int right = left + (w->width |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4334 * FONT_WIDTH (f->output_data.x->font)) |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4335 - f->output_data.x->internal_border_width; |
389 | 4336 |
4337 #if 0 | |
4338 BLOCK_INPUT; | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4339 gc_values.foreground = f->output_data.x->cursor_pixel; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4340 gc_values.background = f->output_data.x->background_pixel; |
389 | 4341 gc_values.line_width = 1; |
4342 gc_values.line_style = LineOnOffDash; | |
4343 gc_values.cap_style = CapRound; | |
4344 gc_values.join_style = JoinRound; | |
4345 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4346 line_gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4347 GCLineStyle | GCJoinStyle | GCCapStyle |
4348 | GCLineWidth | GCForeground | GCBackground, | |
4349 &gc_values); | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4350 XSetDashes (FRAME_X_DISPLAY (f), line_gc, 0, dash_list, dashes); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4351 gc_values.foreground = f->output_data.x->background_pixel; |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4352 gc_values.background = f->output_data.x->foreground_pixel; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4353 erase_gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4354 GCLineStyle | GCJoinStyle | GCCapStyle |
4355 | GCLineWidth | GCForeground | GCBackground, | |
4356 &gc_values); | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4357 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
|
4358 UNBLOCK_INPUT; |
389 | 4359 #endif |
4360 | |
4361 while (1) | |
4362 { | |
4363 BLOCK_INPUT; | |
4364 if (x_mouse_y >= XINT (w->top) | |
4365 && x_mouse_y < XINT (w->top) + XINT (w->height) - 1) | |
4366 { | |
4367 previous_y = x_mouse_y; | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4368 line = (x_mouse_y + 1) * f->output_data.x->line_height |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4369 + f->output_data.x->internal_border_width; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4370 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4371 line_gc, left, line, right, line); |
4372 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4373 XFlush (FRAME_X_DISPLAY (f)); |
389 | 4374 UNBLOCK_INPUT; |
4375 | |
4376 do | |
4377 { | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
4378 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
|
4379 if (!CONSP (obj) |
389 | 4380 || (! 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
|
4381 Qvertical_scroll_bar)) |
389 | 4382 || x_mouse_grabbed) |
4383 { | |
4384 BLOCK_INPUT; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4385 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4386 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
|
4387 unread_command_event = obj; |
389 | 4388 #if 0 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4389 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
|
4390 XFreeGC (FRAME_X_DISPLAY (f), erase_gc); |
389 | 4391 #endif |
12051
f193ce9efe24
(x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents:
12046
diff
changeset
|
4392 UNBLOCK_INPUT; |
389 | 4393 return Qnil; |
4394 } | |
4395 } | |
4396 while (x_mouse_y == previous_y); | |
4397 | |
4398 BLOCK_INPUT; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4399 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4400 erase_gc, left, line, right, line); |
4401 UNBLOCK_INPUT; | |
4402 } | |
4403 } | |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
4404 #endif |
389 | 4405 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4406 #if 0 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4407 /* 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
|
4408 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
|
4409 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4410 /* Offset in buffer of character under the pointer, or 0. */ |
389 | 4411 int mouse_buffer_offset; |
4412 | |
4413 DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 0, 0, 0, | |
4414 "Track the pointer.") | |
4415 () | |
4416 { | |
4417 static Cursor current_pointer_shape; | |
771 | 4418 FRAME_PTR f = x_mouse_frame; |
389 | 4419 |
4420 BLOCK_INPUT; | |
771 | 4421 if (EQ (Vmouse_frame_part, Qtext_part) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4422 && (current_pointer_shape != f->output_data.x->nontext_cursor)) |
389 | 4423 { |
4424 unsigned char c; | |
4425 struct buffer *buf; | |
4426 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4427 current_pointer_shape = f->output_data.x->nontext_cursor; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4428 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
|
4429 FRAME_X_WINDOW (f), |
389 | 4430 current_pointer_shape); |
4431 | |
4432 buf = XBUFFER (XWINDOW (Vmouse_window)->buffer); | |
4433 c = *(BUF_CHAR_ADDRESS (buf, mouse_buffer_offset)); | |
4434 } | |
771 | 4435 else if (EQ (Vmouse_frame_part, Qmodeline_part) |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4436 && (current_pointer_shape != f->output_data.x->modeline_cursor)) |
389 | 4437 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4438 current_pointer_shape = f->output_data.x->modeline_cursor; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4439 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
|
4440 FRAME_X_WINDOW (f), |
389 | 4441 current_pointer_shape); |
4442 } | |
4443 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4444 XFlush (FRAME_X_DISPLAY (f)); |
389 | 4445 UNBLOCK_INPUT; |
4446 } | |
4447 #endif | |
4448 | |
4449 #if 0 | |
4450 DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 1, 1, "e", | |
4451 "Draw rectangle around character under mouse pointer, if there is one.") | |
4452 (event) | |
4453 Lisp_Object event; | |
4454 { | |
4455 struct window *w = XWINDOW (Vmouse_window); | |
771 | 4456 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
389 | 4457 struct buffer *b = XBUFFER (w->buffer); |
4458 Lisp_Object obj; | |
4459 | |
4460 if (! EQ (Vmouse_window, selected_window)) | |
4461 return Qnil; | |
4462 | |
4463 if (EQ (event, Qnil)) | |
4464 { | |
4465 int x, y; | |
4466 | |
771 | 4467 x_read_mouse_position (selected_frame, &x, &y); |
389 | 4468 } |
4469 | |
4470 BLOCK_INPUT; | |
4471 mouse_track_width = 0; | |
4472 mouse_track_left = mouse_track_top = -1; | |
4473 | |
4474 do | |
4475 { | |
4476 if ((x_mouse_x != mouse_track_left | |
4477 && (x_mouse_x < mouse_track_left | |
4478 || x_mouse_x > (mouse_track_left + mouse_track_width))) | |
4479 || x_mouse_y != mouse_track_top) | |
4480 { | |
4481 int hp = 0; /* Horizontal position */ | |
771 | 4482 int len = FRAME_CURRENT_GLYPHS (f)->used[x_mouse_y]; |
4483 int p = FRAME_CURRENT_GLYPHS (f)->bufp[x_mouse_y]; | |
389 | 4484 int tab_width = XINT (b->tab_width); |
485 | 4485 int ctl_arrow_p = !NILP (b->ctl_arrow); |
389 | 4486 unsigned char c; |
4487 int mode_line_vpos = XFASTINT (w->height) + XFASTINT (w->top) - 1; | |
4488 int in_mode_line = 0; | |
4489 | |
771 | 4490 if (! FRAME_CURRENT_GLYPHS (f)->enable[x_mouse_y]) |
389 | 4491 break; |
4492 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4493 /* Erase previous rectangle. */ |
389 | 4494 if (mouse_track_width) |
4495 { | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4496 x_rectangle (f, f->output_data.x->reverse_gc, |
389 | 4497 mouse_track_left, mouse_track_top, |
4498 mouse_track_width, 1); | |
4499 | |
771 | 4500 if ((mouse_track_left == f->phys_cursor_x |
4501 || mouse_track_left == f->phys_cursor_x - 1) | |
4502 && mouse_track_top == f->phys_cursor_y) | |
389 | 4503 { |
771 | 4504 x_display_cursor (f, 1); |
389 | 4505 } |
4506 } | |
4507 | |
4508 mouse_track_left = x_mouse_x; | |
4509 mouse_track_top = x_mouse_y; | |
4510 mouse_track_width = 0; | |
4511 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4512 if (mouse_track_left > len) /* Past the end of line. */ |
389 | 4513 goto draw_or_not; |
4514 | |
4515 if (mouse_track_top == mode_line_vpos) | |
4516 { | |
4517 in_mode_line = 1; | |
4518 goto draw_or_not; | |
4519 } | |
4520 | |
4521 if (tab_width <= 0 || tab_width > 20) tab_width = 8; | |
4522 do | |
4523 { | |
4524 c = FETCH_CHAR (p); | |
771 | 4525 if (len == f->width && hp == len - 1 && c != '\n') |
389 | 4526 goto draw_or_not; |
4527 | |
4528 switch (c) | |
4529 { | |
4530 case '\t': | |
4531 mouse_track_width = tab_width - (hp % tab_width); | |
4532 p++; | |
4533 hp += mouse_track_width; | |
4534 if (hp > x_mouse_x) | |
4535 { | |
4536 mouse_track_left = hp - mouse_track_width; | |
4537 goto draw_or_not; | |
4538 } | |
4539 continue; | |
4540 | |
4541 case '\n': | |
4542 mouse_track_width = -1; | |
4543 goto draw_or_not; | |
4544 | |
4545 default: | |
4546 if (ctl_arrow_p && (c < 040 || c == 0177)) | |
4547 { | |
4548 if (p > ZV) | |
4549 goto draw_or_not; | |
4550 | |
4551 mouse_track_width = 2; | |
4552 p++; | |
4553 hp +=2; | |
4554 if (hp > x_mouse_x) | |
4555 { | |
4556 mouse_track_left = hp - mouse_track_width; | |
4557 goto draw_or_not; | |
4558 } | |
4559 } | |
4560 else | |
4561 { | |
4562 mouse_track_width = 1; | |
4563 p++; | |
4564 hp++; | |
4565 } | |
4566 continue; | |
4567 } | |
4568 } | |
4569 while (hp <= x_mouse_x); | |
4570 | |
4571 draw_or_not: | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4572 if (mouse_track_width) /* Over text; use text pointer shape. */ |
389 | 4573 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4574 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
|
4575 FRAME_X_WINDOW (f), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4576 f->output_data.x->text_cursor); |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4577 x_rectangle (f, f->output_data.x->cursor_gc, |
389 | 4578 mouse_track_left, mouse_track_top, |
4579 mouse_track_width, 1); | |
4580 } | |
4581 else if (in_mode_line) | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4582 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
|
4583 FRAME_X_WINDOW (f), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4584 f->output_data.x->modeline_cursor); |
389 | 4585 else |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4586 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
|
4587 FRAME_X_WINDOW (f), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4588 f->output_data.x->nontext_cursor); |
389 | 4589 } |
4590 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4591 XFlush (FRAME_X_DISPLAY (f)); |
389 | 4592 UNBLOCK_INPUT; |
4593 | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
4594 obj = read_char (-1, 0, 0, Qnil, 0); |
389 | 4595 BLOCK_INPUT; |
4596 } | |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
4597 while (CONSP (obj) /* Mouse event */ |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
4598 && EQ (Fcar (Fcdr (Fcdr (obj))), Qnil) /* Not scroll bar */ |
389 | 4599 && EQ (Vmouse_depressed, Qnil) /* Only motion events */ |
4600 && EQ (Vmouse_window, selected_window) /* In this window */ | |
771 | 4601 && x_mouse_frame); |
389 | 4602 |
1601
a371ec79bc31
* xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents:
1528
diff
changeset
|
4603 unread_command_event = obj; |
389 | 4604 |
4605 if (mouse_track_width) | |
4606 { | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4607 x_rectangle (f, f->output_data.x->reverse_gc, |
389 | 4608 mouse_track_left, mouse_track_top, |
4609 mouse_track_width, 1); | |
4610 mouse_track_width = 0; | |
771 | 4611 if ((mouse_track_left == f->phys_cursor_x |
4612 || mouse_track_left - 1 == f->phys_cursor_x) | |
4613 && mouse_track_top == f->phys_cursor_y) | |
389 | 4614 { |
771 | 4615 x_display_cursor (f, 1); |
389 | 4616 } |
4617 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4618 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
|
4619 FRAME_X_WINDOW (f), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4620 f->output_data.x->nontext_cursor); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4621 XFlush (FRAME_X_DISPLAY (f)); |
389 | 4622 UNBLOCK_INPUT; |
4623 | |
4624 return Qnil; | |
4625 } | |
4626 #endif | |
4627 | |
4628 #if 0 | |
4629 #include "glyphs.h" | |
4630 | |
4631 /* 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
|
4632 on the frame F at position X, Y. */ |
771 | 4633 |
4634 x_draw_pixmap (f, x, y, image_data, width, height) | |
4635 struct frame *f; | |
389 | 4636 int x, y, width, height; |
4637 char *image_data; | |
4638 { | |
4639 Pixmap image; | |
4640 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4641 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
|
4642 FRAME_X_WINDOW (f), image_data, |
389 | 4643 width, height); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4644 XCopyPlane (FRAME_X_DISPLAY (f), image, FRAME_X_WINDOW (f), |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4645 f->output_data.x->normal_gc, 0, 0, width, height, x, y); |
389 | 4646 } |
4647 #endif | |
4648 | |
4309
c79a44360ed9
(Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
4279
diff
changeset
|
4649 #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
|
4650 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
|
4651 |
389 | 4652 #ifdef HAVE_X11 |
4653 DEFUN ("x-rebind-key", Fx_rebind_key, Sx_rebind_key, 3, 3, 0, | |
4654 "Rebind X keysym KEYSYM, with MODIFIERS, to generate NEWSTRING.\n\ | |
4655 KEYSYM is a string which conforms to the X keysym definitions found\n\ | |
4656 in X11/keysymdef.h, sans the initial XK_. MODIFIERS is nil or a\n\ | |
4657 list of strings specifying modifier keys such as Control_L, which must\n\ | |
4658 also be depressed for NEWSTRING to appear.") | |
4659 (x_keysym, modifiers, newstring) | |
4660 register Lisp_Object x_keysym; | |
4661 register Lisp_Object modifiers; | |
4662 register Lisp_Object newstring; | |
4663 { | |
4664 char *rawstring; | |
642 | 4665 register KeySym keysym; |
4666 KeySym modifier_list[16]; | |
389 | 4667 |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
4668 check_x (); |
389 | 4669 CHECK_STRING (x_keysym, 1); |
4670 CHECK_STRING (newstring, 3); | |
4671 | |
4672 keysym = XStringToKeysym ((char *) XSTRING (x_keysym)->data); | |
4673 if (keysym == NoSymbol) | |
4674 error ("Keysym does not exist"); | |
4675 | |
485 | 4676 if (NILP (modifiers)) |
389 | 4677 XRebindKeysym (x_current_display, keysym, modifier_list, 0, |
4678 XSTRING (newstring)->data, XSTRING (newstring)->size); | |
4679 else | |
4680 { | |
4681 register Lisp_Object rest, mod; | |
4682 register int i = 0; | |
4683 | |
485 | 4684 for (rest = modifiers; !NILP (rest); rest = Fcdr (rest)) |
389 | 4685 { |
4686 if (i == 16) | |
4687 error ("Can't have more than 16 modifiers"); | |
4688 | |
4689 mod = Fcar (rest); | |
4690 CHECK_STRING (mod, 3); | |
4691 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
|
4692 #ifndef HAVE_X11R5 |
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4693 if (modifier_list[i] == NoSymbol |
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4694 || !(IsModifierKey (modifier_list[i]) |
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4695 || ((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
|
4696 || ((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
|
4697 #else |
389 | 4698 if (modifier_list[i] == NoSymbol |
4699 || !IsModifierKey (modifier_list[i])) | |
3692
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4700 #endif |
389 | 4701 error ("Element is not a modifier keysym"); |
4702 i++; | |
4703 } | |
4704 | |
4705 XRebindKeysym (x_current_display, keysym, modifier_list, i, | |
4706 XSTRING (newstring)->data, XSTRING (newstring)->size); | |
4707 } | |
4708 | |
4709 return Qnil; | |
4710 } | |
4711 | |
4712 DEFUN ("x-rebind-keys", Fx_rebind_keys, Sx_rebind_keys, 2, 2, 0, | |
4713 "Rebind KEYCODE to list of strings STRINGS.\n\ | |
4714 STRINGS should be a list of 16 elements, one for each shift combination.\n\ | |
4715 nil as element means don't change.\n\ | |
4716 See the documentation of `x-rebind-key' for more information.") | |
4717 (keycode, strings) | |
4718 register Lisp_Object keycode; | |
4719 register Lisp_Object strings; | |
4720 { | |
4721 register Lisp_Object item; | |
4722 register unsigned char *rawstring; | |
4723 KeySym rawkey, modifier[1]; | |
4724 int strsize; | |
4725 register unsigned i; | |
4726 | |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
4727 check_x (); |
389 | 4728 CHECK_NUMBER (keycode, 1); |
4729 CHECK_CONS (strings, 2); | |
4730 rawkey = (KeySym) ((unsigned) (XINT (keycode))) & 255; | |
4731 for (i = 0; i <= 15; strings = Fcdr (strings), i++) | |
4732 { | |
4733 item = Fcar (strings); | |
485 | 4734 if (!NILP (item)) |
389 | 4735 { |
4736 CHECK_STRING (item, 2); | |
4737 strsize = XSTRING (item)->size; | |
4738 rawstring = (unsigned char *) xmalloc (strsize); | |
4739 bcopy (XSTRING (item)->data, rawstring, strsize); | |
4740 modifier[1] = 1 << i; | |
4741 XRebindKeysym (x_current_display, rawkey, modifier, 1, | |
4742 rawstring, strsize); | |
4743 } | |
4744 } | |
4745 return Qnil; | |
4746 } | |
3141
ffe66ae9bfb3
(Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
3134
diff
changeset
|
4747 #endif /* HAVE_X11 */ |
4309
c79a44360ed9
(Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
4279
diff
changeset
|
4748 #endif /* 0 */ |
389 | 4749 |
4606
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4750 #ifndef HAVE_XSCREENNUMBEROFSCREEN |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4751 int |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4752 XScreenNumberOfScreen (scr) |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4753 register Screen *scr; |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4754 { |
4771
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4755 register Display *dpy; |
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4756 register Screen *dpyscr; |
4606
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4757 register int i; |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4758 |
4771
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4759 dpy = scr->display; |
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4760 dpyscr = dpy->screens; |
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4761 |
4606
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4762 for (i = 0; i < dpy->nscreens; i++, dpyscr++) |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4763 if (scr == dpyscr) |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4764 return i; |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4765 |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4766 return -1; |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4767 } |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4768 #endif /* not HAVE_XSCREENNUMBEROFSCREEN */ |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4769 |
389 | 4770 Visual * |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4771 select_visual (dpy, screen, depth) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4772 Display *dpy; |
389 | 4773 Screen *screen; |
4774 unsigned int *depth; | |
4775 { | |
4776 Visual *v; | |
4777 XVisualInfo *vinfo, vinfo_template; | |
4778 int n_visuals; | |
4779 | |
4780 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
|
4781 |
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
|
4782 #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
|
4783 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
|
4784 #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
|
4785 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
|
4786 #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
|
4787 |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
4788 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
|
4789 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4790 vinfo = XGetVisualInfo (dpy, |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
4791 VisualIDMask | VisualScreenMask, &vinfo_template, |
389 | 4792 &n_visuals); |
4793 if (n_visuals != 1) | |
4794 fatal ("Can't get proper X visual info"); | |
4795 | |
4796 if ((1 << vinfo->depth) == vinfo->colormap_size) | |
4797 *depth = vinfo->depth; | |
4798 else | |
4799 { | |
4800 int i = 0; | |
4801 int n = vinfo->colormap_size - 1; | |
4802 while (n) | |
4803 { | |
4804 n = n >> 1; | |
4805 i++; | |
4806 } | |
4807 *depth = i; | |
4808 } | |
4809 | |
4810 XFree ((char *) vinfo); | |
4811 return v; | |
4812 } | |
4813 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4814 /* 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
|
4815 Open a new connection if necessary. */ |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4816 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4817 struct x_display_info * |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4818 x_display_info_for_name (name) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4819 Lisp_Object name; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4820 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4821 Lisp_Object names; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4822 struct x_display_info *dpyinfo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4823 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4824 CHECK_STRING (name, 0); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4825 |
12381
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4826 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
|
4827 error ("Not using X Windows"); |
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4828 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4829 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
|
4830 dpyinfo; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4831 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
|
4832 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4833 Lisp_Object tem; |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4834 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
|
4835 if (!NILP (tem)) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4836 return dpyinfo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4837 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4838 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4839 /* 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
|
4840 Vx_resource_name = Vinvocation_name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4841 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4842 validate_x_resource_name (); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4843 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4844 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
|
4845 (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
|
4846 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4847 if (dpyinfo == 0) |
12046
d23f2c9990b2
(x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents:
12036
diff
changeset
|
4848 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
|
4849 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4850 x_in_use = 1; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4851 XSETFASTINT (Vwindow_system_version, 11); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4852 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4853 return dpyinfo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4854 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4855 |
389 | 4856 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
|
4857 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
|
4858 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
|
4859 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
|
4860 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
|
4861 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
|
4862 (display, xrm_string, must_succeed) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4863 Lisp_Object display, xrm_string, must_succeed; |
389 | 4864 { |
4865 unsigned int n_planes; | |
4866 unsigned char *xrm_option; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4867 struct x_display_info *dpyinfo; |
389 | 4868 |
4869 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
|
4870 if (! NILP (xrm_string)) |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4871 CHECK_STRING (xrm_string, 1); |
389 | 4872 |
12381
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4873 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
|
4874 error ("Not using X Windows"); |
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4875 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4876 if (! NILP (xrm_string)) |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4877 xrm_option = (unsigned char *) XSTRING (xrm_string)->data; |
389 | 4878 else |
4879 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
|
4880 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4881 /* 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
|
4882 Vx_resource_name = Vinvocation_name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4883 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4884 validate_x_resource_name (); |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4885 |
7802
d687e885fa6a
(Fx_open_connection): Set up Vx_resource_name and xrm_option
Richard M. Stallman <rms@gnu.org>
parents:
7797
diff
changeset
|
4886 /* 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
|
4887 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
|
4888 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
|
4889 (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
|
4890 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4891 if (dpyinfo == 0) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4892 { |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4893 if (!NILP (must_succeed)) |
12046
d23f2c9990b2
(x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents:
12036
diff
changeset
|
4894 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
|
4895 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
|
4896 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
|
4897 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
|
4898 XSTRING (display)->data); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4899 else |
12046
d23f2c9990b2
(x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents:
12036
diff
changeset
|
4900 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
|
4901 } |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4902 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4903 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
|
4904 |
9327
b3398cf56fba
(Fx_open_connection): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents:
9285
diff
changeset
|
4905 XSETFASTINT (Vwindow_system_version, 11); |
389 | 4906 return Qnil; |
4907 } | |
4908 | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4909 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
|
4910 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
|
4911 "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
|
4912 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
|
4913 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
|
4914 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4915 Lisp_Object display; |
389 | 4916 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4917 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
|
4918 struct x_display_info *tail; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4919 int i; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4920 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4921 if (dpyinfo->reference_count > 0) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4922 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
|
4923 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4924 BLOCK_INPUT; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4925 /* 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
|
4926 for (i = 0; i < dpyinfo->n_fonts; i++) |
389 | 4927 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4928 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
|
4929 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
|
4930 /* 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
|
4931 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
|
4932 XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font); |
389 | 4933 } |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4934 x_destroy_all_bitmaps (dpyinfo); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4935 XSetCloseDownMode (dpyinfo->display, DestroyAll); |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4936 |
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4937 #ifdef USE_X_TOOLKIT |
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4938 XtCloseDisplay (dpyinfo->display); |
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4939 #else |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4940 XCloseDisplay (dpyinfo->display); |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4941 #endif |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4942 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4943 x_delete_display (dpyinfo); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4944 UNBLOCK_INPUT; |
8782
51241477cfc5
Delete X11 conditionals.
Richard M. Stallman <rms@gnu.org>
parents:
8780
diff
changeset
|
4945 |
389 | 4946 return Qnil; |
4947 } | |
4948 | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4949 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
|
4950 "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
|
4951 () |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4952 { |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4953 Lisp_Object tail, result; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4954 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4955 result = Qnil; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4956 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
|
4957 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
|
4958 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4959 return result; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4960 } |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4961 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4962 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
|
4963 "If ON is non-nil, report X errors as soon as the erring request is made.\n\ |
389 | 4964 If ON is nil, allow buffering of requests.\n\ |
4965 Turning on synchronization prohibits the Xlib routines from buffering\n\ | |
4966 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
|
4967 easier.\n\ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4968 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
|
4969 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
|
4970 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
|
4971 (on, display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4972 Lisp_Object display, on; |
389 | 4973 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4974 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
|
4975 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4976 XSynchronize (dpyinfo->display, !EQ (on, Qnil)); |
389 | 4977 |
4978 return Qnil; | |
4979 } | |
4980 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4981 /* Wait for responses to all X commands issued so far for frame F. */ |
5536 | 4982 |
4983 void | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4984 x_sync (f) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4985 FRAME_PTR f; |
5536 | 4986 { |
5558 | 4987 BLOCK_INPUT; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4988 XSync (FRAME_X_DISPLAY (f), False); |
5558 | 4989 UNBLOCK_INPUT; |
5536 | 4990 } |
389 | 4991 |
4992 syms_of_xfns () | |
4993 { | |
4994 /* 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
|
4995 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
|
4996 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
4997 /* 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
|
4998 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
|
4999 /*&&& init symbols here &&&*/ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5000 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
|
5001 staticpro (&Qauto_raise); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5002 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
|
5003 staticpro (&Qauto_lower); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5004 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
|
5005 staticpro (&Qbackground_color); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
5006 Qbar = intern ("bar"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
5007 staticpro (&Qbar); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5008 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
|
5009 staticpro (&Qborder_color); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5010 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
|
5011 staticpro (&Qborder_width); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
5012 Qbox = intern ("box"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
5013 staticpro (&Qbox); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5014 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
|
5015 staticpro (&Qcursor_color); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
5016 Qcursor_type = intern ("cursor-type"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
5017 staticpro (&Qcursor_type); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5018 Qfont = intern ("font"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5019 staticpro (&Qfont); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5020 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
|
5021 staticpro (&Qforeground_color); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5022 Qgeometry = intern ("geometry"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5023 staticpro (&Qgeometry); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5024 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
|
5025 staticpro (&Qicon_left); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5026 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
|
5027 staticpro (&Qicon_top); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5028 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
|
5029 staticpro (&Qicon_type); |
12073 | 5030 Qicon_name = intern ("icon-name"); |
5031 staticpro (&Qicon_name); | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5032 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
|
5033 staticpro (&Qinternal_border_width); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5034 Qleft = intern ("left"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5035 staticpro (&Qleft); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5036 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
|
5037 staticpro (&Qmouse_color); |
1874
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
5038 Qnone = intern ("none"); |
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
5039 staticpro (&Qnone); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5040 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
|
5041 staticpro (&Qparent_id); |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
5042 Qscroll_bar_width = intern ("scroll-bar-width"); |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
5043 staticpro (&Qscroll_bar_width); |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
5044 Qsuppress_icon = intern ("suppress-icon"); |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
5045 staticpro (&Qsuppress_icon); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5046 Qtop = intern ("top"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5047 staticpro (&Qtop); |
389 | 5048 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
|
5049 staticpro (&Qundefined_color); |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
5050 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
|
5051 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
|
5052 Qvisibility = intern ("visibility"); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
5053 staticpro (&Qvisibility); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5054 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
|
5055 staticpro (&Qwindow_id); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5056 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
|
5057 staticpro (&Qx_frame_parameter); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
5058 Qx_resource_name = intern ("x-resource-name"); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
5059 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
|
5060 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
|
5061 staticpro (&Quser_position); |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
5062 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
|
5063 staticpro (&Quser_size); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
5064 Qdisplay = intern ("display"); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
5065 staticpro (&Qdisplay); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5066 /* 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
|
5067 |
389 | 5068 Fput (Qundefined_color, Qerror_conditions, |
5069 Fcons (Qundefined_color, Fcons (Qerror, Qnil))); | |
5070 Fput (Qundefined_color, Qerror_message, | |
5071 build_string ("Undefined color")); | |
5072 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5073 init_x_parm_symbols (); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5074 |
9563 | 5075 DEFVAR_LISP ("x-bitmap-file-path", &Vx_bitmap_file_path, |
5076 "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
|
5077 Vx_bitmap_file_path = decode_env_path ((char *) 0, PATH_BITMAPS); |
9563 | 5078 |
4328
3d43e65a593d
(syms_of_xfns): Use DEFVAR_LISP, not DEFVAR_INT, for Vx_pointer_shape.
Roland McGrath <roland@gnu.org>
parents:
4309
diff
changeset
|
5079 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
|
5080 "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
|
5081 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
|
5082 unless you set the mouse color."); |
389 | 5083 Vx_pointer_shape = Qnil; |
5084 | |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
5085 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
|
5086 "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
|
5087 `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
|
5088 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
|
5089 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
|
5090 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
|
5091 switches, if present."); |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
5092 Vx_resource_name = Qnil; |
3170
647229114f47
* xfns.c: Make resource manager work correctly even when
Jim Blandy <jimb@redhat.com>
parents:
3141
diff
changeset
|
5093 |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5094 #if 0 /* This doesn't really do anything. */ |
389 | 5095 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
|
5096 "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
|
5097 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
|
5098 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
|
5099 #endif |
389 | 5100 Vx_nontext_pointer_shape = Qnil; |
5101 | |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5102 #if 0 /* This doesn't really do anything. */ |
389 | 5103 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
|
5104 "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
|
5105 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
|
5106 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
|
5107 #endif |
389 | 5108 Vx_mode_pointer_shape = Qnil; |
5109 | |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5110 DEFVAR_INT ("x-sensitive-text-pointer-shape", |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5111 &Vx_sensitive_text_pointer_shape, |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5112 "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
|
5113 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
|
5114 or when you set the mouse color."); |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5115 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
|
5116 |
389 | 5117 DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel, |
5118 "A string indicating the foreground color of the cursor box."); | |
5119 Vx_cursor_fore_pixel = Qnil; | |
5120 | |
5121 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
|
5122 "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
|
5123 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
|
5124 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
|
5125 /* 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
|
5126 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
|
5127 Vx_no_window_manager = Qnil; |
8170
d92a24366b22
(x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
8103
diff
changeset
|
5128 |
d92a24366b22
(x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
8103
diff
changeset
|
5129 #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
|
5130 Fprovide (intern ("x-toolkit")); |
8170
d92a24366b22
(x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
8103
diff
changeset
|
5131 #endif |
12094
a9fda5417acf
(syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents:
12080
diff
changeset
|
5132 #ifdef USE_MOTIF |
a9fda5417acf
(syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents:
12080
diff
changeset
|
5133 Fprovide (intern ("motif")); |
a9fda5417acf
(syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents:
12080
diff
changeset
|
5134 #endif |
389 | 5135 |
5136 defsubr (&Sx_get_resource); | |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
5137 #if 0 |
389 | 5138 defsubr (&Sx_draw_rectangle); |
5139 defsubr (&Sx_erase_rectangle); | |
5140 defsubr (&Sx_contour_region); | |
5141 defsubr (&Sx_uncontour_region); | |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
5142 #endif |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
5143 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
|
5144 defsubr (&Sx_display_color_p); |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
5145 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
|
5146 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
|
5147 defsubr (&Sx_color_values); |
4279 | 5148 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
|
5149 defsubr (&Sx_server_vendor); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5150 defsubr (&Sx_server_version); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5151 defsubr (&Sx_display_pixel_width); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5152 defsubr (&Sx_display_pixel_height); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5153 defsubr (&Sx_display_mm_width); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5154 defsubr (&Sx_display_mm_height); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5155 defsubr (&Sx_display_screens); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5156 defsubr (&Sx_display_planes); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5157 defsubr (&Sx_display_color_cells); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5158 defsubr (&Sx_display_visual_class); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5159 defsubr (&Sx_display_backing_store); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5160 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
|
5161 #if 0 |
3141
ffe66ae9bfb3
(Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
3134
diff
changeset
|
5162 defsubr (&Sx_rebind_key); |
ffe66ae9bfb3
(Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
3134
diff
changeset
|
5163 defsubr (&Sx_rebind_keys); |
389 | 5164 defsubr (&Sx_track_pointer); |
5165 defsubr (&Sx_grab_pointer); | |
5166 defsubr (&Sx_ungrab_pointer); | |
436
6e0a136fca4f
*** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents:
398
diff
changeset
|
5167 #endif |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
5168 defsubr (&Sx_parse_geometry); |
771 | 5169 defsubr (&Sx_create_frame); |
5170 defsubr (&Sfocus_frame); | |
5171 defsubr (&Sunfocus_frame); | |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
5172 #if 0 |
389 | 5173 defsubr (&Sx_horizontal_line); |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
5174 #endif |
389 | 5175 defsubr (&Sx_open_connection); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
5176 defsubr (&Sx_close_connection); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
5177 defsubr (&Sx_display_list); |
389 | 5178 defsubr (&Sx_synchronize); |
5179 } | |
5180 | |
5181 #endif /* HAVE_X_WINDOWS */ |