Mercurial > emacs
annotate src/xfns.c @ 15536:fb218a8bd186
Add `dir ../lwlib'.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 28 Jun 1996 07:48:15 +0000 |
parents | 94467271b641 |
children | 3d03a3fb8757 |
rev | line source |
---|---|
389 | 1 /* Functions for the X window system. |
15079 | 2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996 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)) |
15022
3f5642bda41c
(x_set_frame_parameters): Get height and width from
Richard M. Stallman <rms@gnu.org>
parents:
14979
diff
changeset
|
834 { |
3f5642bda41c
(x_set_frame_parameters): Get height and width from
Richard M. Stallman <rms@gnu.org>
parents:
14979
diff
changeset
|
835 if (FRAME_NEW_WIDTH (f)) |
3f5642bda41c
(x_set_frame_parameters): Get height and width from
Richard M. Stallman <rms@gnu.org>
parents:
14979
diff
changeset
|
836 XSETINT (width, FRAME_NEW_WIDTH (f)); |
3f5642bda41c
(x_set_frame_parameters): Get height and width from
Richard M. Stallman <rms@gnu.org>
parents:
14979
diff
changeset
|
837 else |
3f5642bda41c
(x_set_frame_parameters): Get height and width from
Richard M. Stallman <rms@gnu.org>
parents:
14979
diff
changeset
|
838 XSETINT (width, FRAME_WIDTH (f)); |
3f5642bda41c
(x_set_frame_parameters): Get height and width from
Richard M. Stallman <rms@gnu.org>
parents:
14979
diff
changeset
|
839 } |
4617
807ba8bcc309
(x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents:
4606
diff
changeset
|
840 if (EQ (height, Qunbound)) |
15022
3f5642bda41c
(x_set_frame_parameters): Get height and width from
Richard M. Stallman <rms@gnu.org>
parents:
14979
diff
changeset
|
841 { |
3f5642bda41c
(x_set_frame_parameters): Get height and width from
Richard M. Stallman <rms@gnu.org>
parents:
14979
diff
changeset
|
842 if (FRAME_NEW_HEIGHT (f)) |
3f5642bda41c
(x_set_frame_parameters): Get height and width from
Richard M. Stallman <rms@gnu.org>
parents:
14979
diff
changeset
|
843 XSETINT (height, FRAME_NEW_HEIGHT (f)); |
3f5642bda41c
(x_set_frame_parameters): Get height and width from
Richard M. Stallman <rms@gnu.org>
parents:
14979
diff
changeset
|
844 else |
3f5642bda41c
(x_set_frame_parameters): Get height and width from
Richard M. Stallman <rms@gnu.org>
parents:
14979
diff
changeset
|
845 XSETINT (height, FRAME_HEIGHT (f)); |
3f5642bda41c
(x_set_frame_parameters): Get height and width from
Richard M. Stallman <rms@gnu.org>
parents:
14979
diff
changeset
|
846 } |
4617
807ba8bcc309
(x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents:
4606
diff
changeset
|
847 |
11932
f3fb1e5dfde1
(x_set_frame_parameters) Fix typo.
Karl Heuer <kwzh@gnu.org>
parents:
11917
diff
changeset
|
848 /* 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
|
849 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
|
850 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
|
851 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
|
852 |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
853 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
|
854 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
|
855 yet. */ |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
856 { |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
857 Lisp_Object frame; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
858 |
5107
2a019dd8ed51
(x_set_frame_parameters): Call check_frame_size
Richard M. Stallman <rms@gnu.org>
parents:
4771
diff
changeset
|
859 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
|
860 |
9285
75f1c0d90b3d
(x_set_frame_parameters, x_set_visibility, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9240
diff
changeset
|
861 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
|
862 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
863 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
|
864 || (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
|
865 || 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
|
866 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
|
867 |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
868 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
|
869 && ! (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
|
870 && ! (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
|
871 && 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
|
872 { |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
873 int leftpos = 0; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
874 int toppos = 0; |
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 /* 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
|
877 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
|
878 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
|
879 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
|
880 else if (INTEGERP (left)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
881 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
882 leftpos = XINT (left); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
883 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
|
884 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
|
885 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
886 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
|
887 && CONSP (XCONS (left)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
888 && 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
|
889 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
890 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
|
891 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
|
892 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
893 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
|
894 && CONSP (XCONS (left)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
895 && 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
|
896 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
897 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
|
898 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
899 |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
900 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
|
901 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
|
902 else if (INTEGERP (top)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
903 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
904 toppos = XINT (top); |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
905 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
|
906 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
|
907 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
908 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
|
909 && CONSP (XCONS (top)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
910 && 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
|
911 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
912 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
|
913 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
|
914 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
915 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
|
916 && CONSP (XCONS (top)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
917 && 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
|
918 { |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
919 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
|
920 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
921 |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
922 |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
923 /* 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
|
924 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
|
925 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
|
926 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
927 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
|
928 |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
929 /* 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
|
930 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
|
931 } |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
932 |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
933 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
|
934 && ! (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
|
935 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
|
936 } |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
937 } |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
938 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
939 /* 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
|
940 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
|
941 not Emacs's own window. */ |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
942 |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
943 void |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
944 x_real_positions (f, xptr, yptr) |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
945 FRAME_PTR f; |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
946 int *xptr, *yptr; |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
947 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
948 int win_x, win_y; |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
949 Window child; |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
950 |
7946
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
951 /* 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
|
952 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
|
953 |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
954 #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
|
955 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
|
956 #else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
957 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
|
958 #endif |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
959 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
|
960 Window *tmp_children; |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
961 int tmp_nchildren; |
4dbba88e2717
(x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents:
7899
diff
changeset
|
962 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
963 while (1) |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
964 { |
12111
832023e90d4d
(x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents:
12094
diff
changeset
|
965 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
|
966 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
967 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
|
968 &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
|
969 &tmp_children, &tmp_nchildren); |
14563
6aa8b322b4d7
(x_real_positions): Cast arg of XFree.
Karl Heuer <kwzh@gnu.org>
parents:
14530
diff
changeset
|
970 XFree ((char *) tmp_children); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
971 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
972 win_x = win_y = 0; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
973 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
974 /* 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
|
975 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
|
976 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
|
977 { |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
978 XTranslateCoordinates (FRAME_X_DISPLAY (f), |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
979 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
980 /* From-window, to-window. */ |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
981 #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
|
982 XtWindow (f->output_data.x->widget), |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
983 #else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
984 f->output_data.x->window_desc, |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
985 #endif |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
986 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
|
987 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
988 /* From-position, to-position. */ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
989 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
|
990 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
991 /* Child of win. */ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
992 &child); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
993 |
11900
54186a96c5b2
(x_set_frame_parameters): Pass 1 as change_gravity
Karl Heuer <kwzh@gnu.org>
parents:
11897
diff
changeset
|
994 #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
|
995 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
|
996 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
|
997 #endif |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
998 } |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
999 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
1000 /* 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
|
1001 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
|
1002 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
|
1003 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
|
1004 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
|
1005 if (! x_had_errors_p (FRAME_X_DISPLAY (f))) |
15495
94467271b641
(x_real_positions): Don't call x_uncatch_errors twice.
Richard M. Stallman <rms@gnu.org>
parents:
15081
diff
changeset
|
1006 { |
94467271b641
(x_real_positions): Don't call x_uncatch_errors twice.
Richard M. Stallman <rms@gnu.org>
parents:
15081
diff
changeset
|
1007 x_uncatch_errors (FRAME_X_DISPLAY (f)); |
94467271b641
(x_real_positions): Don't call x_uncatch_errors twice.
Richard M. Stallman <rms@gnu.org>
parents:
15081
diff
changeset
|
1008 break; |
94467271b641
(x_real_positions): Don't call x_uncatch_errors twice.
Richard M. Stallman <rms@gnu.org>
parents:
15081
diff
changeset
|
1009 } |
12111
832023e90d4d
(x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents:
12094
diff
changeset
|
1010 |
832023e90d4d
(x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents:
12094
diff
changeset
|
1011 x_uncatch_errors (FRAME_X_DISPLAY (f)); |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
1012 } |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
1013 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1014 *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
|
1015 *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
|
1016 } |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
1017 |
771 | 1018 /* Insert a description of internally-recorded parameters of frame X |
389 | 1019 into the parameter alist *ALISTPTR that is to be given to the user. |
1020 Only parameters that are specific to the X window system | |
771 | 1021 and whose values are not correctly recorded in the frame's |
389 | 1022 param_alist need to be considered here. */ |
1023 | |
771 | 1024 x_report_frame_params (f, alistptr) |
1025 struct frame *f; | |
389 | 1026 Lisp_Object *alistptr; |
1027 { | |
1028 char buf[16]; | |
11986
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1029 Lisp_Object tem; |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1030 |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1031 /* 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
|
1032 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
|
1033 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
|
1034 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
|
1035 store_in_alist (alistptr, Qleft, tem); |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1036 else |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1037 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
|
1038 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1039 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
|
1040 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
|
1041 store_in_alist (alistptr, Qtop, tem); |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1042 else |
bfdf35b8c34b
(x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents:
11962
diff
changeset
|
1043 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
|
1044 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1045 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
|
1046 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
|
1047 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
|
1048 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
|
1049 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
|
1050 store_in_alist (alistptr, Qwindow_id, |
389 | 1051 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
|
1052 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
|
1053 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
|
1054 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
|
1055 (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
|
1056 : 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
|
1057 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
|
1058 XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->car); |
389 | 1059 } |
1060 | |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1061 |
8675
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
1062 /* 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
|
1063 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
|
1064 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
|
1065 |
389 | 1066 int |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1067 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
|
1068 FRAME_PTR f; |
389 | 1069 char *color; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1070 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
|
1071 int alloc; |
389 | 1072 { |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1073 register int status; |
389 | 1074 Colormap screen_colormap; |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1075 Display *display = FRAME_X_DISPLAY (f); |
389 | 1076 |
1077 BLOCK_INPUT; | |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1078 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
|
1079 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1080 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
|
1081 if (status && alloc) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1082 { |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1083 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
|
1084 if (!status) |
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 /* 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
|
1087 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
|
1088 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
|
1089 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
|
1090 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1091 XColor *cells; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1092 int no_cells; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1093 int nearest; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1094 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
|
1095 int x; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1096 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1097 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
|
1098 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
|
1099 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1100 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
|
1101 cells[x].pixel = x; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1102 |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1103 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
|
1104 nearest = 0; |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1105 /* 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
|
1106 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
|
1107 * ((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
|
1108 + |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1109 (((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
|
1110 * ((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
|
1111 + |
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[0].blue >> 8)) |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1113 * ((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
|
1114 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
|
1115 { |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1116 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
|
1117 * ((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
|
1118 + |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1119 (((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
|
1120 * ((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
|
1121 + |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1122 (((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
|
1123 * ((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
|
1124 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
|
1125 { |
14615
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1126 XColor temp; |
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1127 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
|
1128 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
|
1129 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
|
1130 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
|
1131 if (status) |
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1132 { |
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1133 nearest = x; |
1bbe2716bcea
(defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents:
14595
diff
changeset
|
1134 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
|
1135 } |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1136 } |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1137 } |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1138 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
|
1139 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
|
1140 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
|
1141 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
|
1142 } |
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1143 } |
389 | 1144 UNBLOCK_INPUT; |
1145 | |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
1146 if (status) |
389 | 1147 return 1; |
1148 else | |
1149 return 0; | |
1150 } | |
1151 | |
1152 /* Given a string ARG naming a color, compute a pixel value from it | |
771 | 1153 suitable for screen F. |
1154 If F is not a color screen, return DEF (default) regardless of what | |
389 | 1155 ARG says. */ |
1156 | |
1157 int | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1158 x_decode_color (f, arg, def) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1159 FRAME_PTR f; |
389 | 1160 Lisp_Object arg; |
1161 int def; | |
1162 { | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1163 XColor cdef; |
389 | 1164 |
1165 CHECK_STRING (arg, 0); | |
1166 | |
1167 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
|
1168 return BLACK_PIX_DEFAULT (f); |
389 | 1169 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
|
1170 return WHITE_PIX_DEFAULT (f); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1171 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1172 if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1) |
389 | 1173 return def; |
1174 | |
11060
0a7048d331e6
(x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents:
11014
diff
changeset
|
1175 /* 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
|
1176 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
|
1177 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
|
1178 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
|
1179 |
13083
16638ebb209f
(Fx_create_frame): Set up buffer-predicate slot.
Richard M. Stallman <rms@gnu.org>
parents:
12832
diff
changeset
|
1180 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
|
1181 Fcons (arg, Qnil))); |
389 | 1182 } |
1183 | |
771 | 1184 /* Functions called only from `x_set_frame_param' |
389 | 1185 to set individual parameters. |
1186 | |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
1187 If FRAME_X_WINDOW (f) is 0, |
771 | 1188 the frame is being created and its X-window does not exist yet. |
389 | 1189 In that case, just record the parameter's new value |
1190 in the standard place; do not attempt to change the window. */ | |
1191 | |
1192 void | |
771 | 1193 x_set_foreground_color (f, arg, oldval) |
1194 struct frame *f; | |
389 | 1195 Lisp_Object arg, oldval; |
1196 { | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1197 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
|
1198 = 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
|
1199 if (FRAME_X_WINDOW (f) != 0) |
389 | 1200 { |
1201 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
|
1202 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
|
1203 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
|
1204 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
|
1205 f->output_data.x->foreground_pixel); |
389 | 1206 UNBLOCK_INPUT; |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1207 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
|
1208 if (FRAME_VISIBLE_P (f)) |
771 | 1209 redraw_frame (f); |
389 | 1210 } |
1211 } | |
1212 | |
1213 void | |
771 | 1214 x_set_background_color (f, arg, oldval) |
1215 struct frame *f; | |
389 | 1216 Lisp_Object arg, oldval; |
1217 { | |
1218 Pixmap temp; | |
1219 int mask; | |
1220 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1221 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
|
1222 = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); |
771 | 1223 |
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
|
1224 if (FRAME_X_WINDOW (f) != 0) |
389 | 1225 { |
1226 BLOCK_INPUT; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1227 /* 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
|
1228 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
|
1229 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
|
1230 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
|
1231 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
|
1232 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
|
1233 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
|
1234 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
|
1235 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
|
1236 { |
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1237 Lisp_Object bar; |
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1238 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
|
1239 bar = XSCROLL_BAR (bar)->next) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1240 XSetWindowBackground (FRAME_X_DISPLAY (f), |
7599
880fcef68f73
(x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents:
7525
diff
changeset
|
1241 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
|
1242 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
|
1243 } |
389 | 1244 UNBLOCK_INPUT; |
1245 | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1246 recompute_basic_faces (f); |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1247 |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1248 if (FRAME_VISIBLE_P (f)) |
771 | 1249 redraw_frame (f); |
389 | 1250 } |
1251 } | |
1252 | |
1253 void | |
771 | 1254 x_set_mouse_color (f, arg, oldval) |
1255 struct frame *f; | |
389 | 1256 Lisp_Object arg, oldval; |
1257 { | |
6759
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
1258 Cursor cursor, nontext_cursor, mode_cursor, cross_cursor; |
389 | 1259 int mask_color; |
1260 | |
1261 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
|
1262 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
|
1263 = 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
|
1264 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
|
1265 /* 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
|
1266 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
|
1267 && 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
|
1268 f->output_data.x->mouse_pixel = f->output_data.x->foreground_pixel; |
389 | 1269 |
1270 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
|
1271 |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3512
diff
changeset
|
1272 /* 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
|
1273 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
|
1274 |
389 | 1275 if (!EQ (Qnil, Vx_pointer_shape)) |
1276 { | |
1277 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
|
1278 cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XINT (Vx_pointer_shape)); |
389 | 1279 } |
1280 else | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1281 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
|
1282 x_check_errors (FRAME_X_DISPLAY (f), "bad text pointer cursor: %s"); |
389 | 1283 |
1284 if (!EQ (Qnil, Vx_nontext_pointer_shape)) | |
1285 { | |
1286 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
|
1287 nontext_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), |
389 | 1288 XINT (Vx_nontext_pointer_shape)); |
1289 } | |
1290 else | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1291 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
|
1292 x_check_errors (FRAME_X_DISPLAY (f), "bad nontext pointer cursor: %s"); |
389 | 1293 |
1294 if (!EQ (Qnil, Vx_mode_pointer_shape)) | |
1295 { | |
1296 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
|
1297 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
|
1298 XINT (Vx_mode_pointer_shape)); |
389 | 1299 } |
1300 else | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1301 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
|
1302 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
|
1303 |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
1304 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
|
1305 { |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
1306 CHECK_NUMBER (Vx_sensitive_text_pointer_shape, 0); |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
1307 cross_cursor |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1308 = XCreateFontCursor (FRAME_X_DISPLAY (f), |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
1309 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
|
1310 } |
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
1311 else |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1312 cross_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_crosshair); |
389 | 1313 |
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
|
1314 /* 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
|
1315 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
|
1316 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
|
1317 |
389 | 1318 { |
1319 XColor fore_color, back_color; | |
1320 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1321 fore_color.pixel = f->output_data.x->mouse_pixel; |
389 | 1322 back_color.pixel = mask_color; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1323 XQueryColor (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1324 DefaultColormap (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1325 DefaultScreen (FRAME_X_DISPLAY (f))), |
389 | 1326 &fore_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1327 XQueryColor (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1328 DefaultColormap (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1329 DefaultScreen (FRAME_X_DISPLAY (f))), |
389 | 1330 &back_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1331 XRecolorCursor (FRAME_X_DISPLAY (f), cursor, |
389 | 1332 &fore_color, &back_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1333 XRecolorCursor (FRAME_X_DISPLAY (f), nontext_cursor, |
389 | 1334 &fore_color, &back_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1335 XRecolorCursor (FRAME_X_DISPLAY (f), mode_cursor, |
389 | 1336 &fore_color, &back_color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1337 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
|
1338 &fore_color, &back_color); |
389 | 1339 } |
1340 | |
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
|
1341 if (FRAME_X_WINDOW (f) != 0) |
389 | 1342 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1343 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor); |
389 | 1344 } |
1345 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1346 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
|
1347 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
|
1348 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
|
1349 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1350 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
|
1351 && 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
|
1352 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
|
1353 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
|
1354 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1355 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
|
1356 && 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
|
1357 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
|
1358 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
|
1359 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
|
1360 && 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
|
1361 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
|
1362 f->output_data.x->cross_cursor = cross_cursor; |
389 | 1363 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1364 XFlush (FRAME_X_DISPLAY (f)); |
389 | 1365 UNBLOCK_INPUT; |
1366 } | |
1367 | |
1368 void | |
771 | 1369 x_set_cursor_color (f, arg, oldval) |
1370 struct frame *f; | |
389 | 1371 Lisp_Object arg, oldval; |
1372 { | |
1373 unsigned long fore_pixel; | |
1374 | |
1375 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
|
1376 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
|
1377 WHITE_PIX_DEFAULT (f)); |
389 | 1378 else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1379 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
|
1380 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
|
1381 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1382 /* 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
|
1383 if (f->output_data.x->cursor_pixel == f->output_data.x->background_pixel) |
389 | 1384 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1385 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
|
1386 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
|
1387 fore_pixel = f->output_data.x->background_pixel; |
389 | 1388 } |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1389 f->output_data.x->cursor_foreground_pixel = fore_pixel; |
389 | 1390 |
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
|
1391 if (FRAME_X_WINDOW (f) != 0) |
389 | 1392 { |
1393 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
|
1394 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
|
1395 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
|
1396 XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->cursor_gc, |
389 | 1397 fore_pixel); |
1398 UNBLOCK_INPUT; | |
1399 | |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1400 if (FRAME_VISIBLE_P (f)) |
389 | 1401 { |
771 | 1402 x_display_cursor (f, 0); |
1403 x_display_cursor (f, 1); | |
389 | 1404 } |
1405 } | |
1406 } | |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1407 |
771 | 1408 /* Set the border-color of frame F to value described by ARG. |
389 | 1409 ARG can be a string naming a color. |
1410 The border-color is used for the border that is drawn by the X server. | |
1411 Note that this does not fully take effect if done before | |
771 | 1412 F has an x-window; it must be redone when the window is created. |
389 | 1413 |
1414 Note: this is done in two routines because of the way X10 works. | |
1415 | |
1416 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
|
1417 and so emacs' border colors may be overridden. */ |
389 | 1418 |
1419 void | |
771 | 1420 x_set_border_color (f, arg, oldval) |
1421 struct frame *f; | |
389 | 1422 Lisp_Object arg, oldval; |
1423 { | |
1424 unsigned char *str; | |
1425 int pix; | |
1426 | |
1427 CHECK_STRING (arg, 0); | |
1428 str = XSTRING (arg)->data; | |
1429 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1430 pix = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
389 | 1431 |
771 | 1432 x_set_border_pixel (f, pix); |
389 | 1433 } |
1434 | |
771 | 1435 /* Set the border-color of frame F to pixel value PIX. |
389 | 1436 Note that this does not fully take effect if done before |
771 | 1437 F has an x-window. */ |
1438 | |
1439 x_set_border_pixel (f, pix) | |
1440 struct frame *f; | |
389 | 1441 int pix; |
1442 { | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1443 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
|
1444 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1445 if (FRAME_X_WINDOW (f) != 0 && f->output_data.x->border_width > 0) |
389 | 1446 { |
1447 Pixmap temp; | |
1448 int mask; | |
1449 | |
1450 BLOCK_INPUT; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1451 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
|
1452 (unsigned long)pix); |
389 | 1453 UNBLOCK_INPUT; |
1454 | |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1455 if (FRAME_VISIBLE_P (f)) |
771 | 1456 redraw_frame (f); |
389 | 1457 } |
1458 } | |
1459 | |
1460 void | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1461 x_set_cursor_type (f, arg, oldval) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1462 FRAME_PTR f; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1463 Lisp_Object arg, oldval; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1464 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1465 if (EQ (arg, Qbar)) |
10742
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1466 { |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1467 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
|
1468 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
|
1469 } |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1470 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
|
1471 && INTEGERP (XCONS (arg)->cdr)) |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1472 { |
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1473 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
|
1474 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
|
1475 } |
3134
efdaaa695ad4
(x_set_cursor_type): If arg not recognized, use box cursor.
Richard M. Stallman <rms@gnu.org>
parents:
3108
diff
changeset
|
1476 else |
10742
e4d6f6f1fc17
(x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents:
10717
diff
changeset
|
1477 /* 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
|
1478 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
|
1479 .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
|
1480 FRAME_DESIRED_CURSOR (f) = filled_box_cursor; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1481 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1482 /* 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
|
1483 often do people change cursor types? */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1484 update_mode_lines++; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1485 } |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1486 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1487 void |
771 | 1488 x_set_icon_type (f, arg, oldval) |
1489 struct frame *f; | |
389 | 1490 Lisp_Object arg, oldval; |
1491 { | |
1492 Lisp_Object tem; | |
1493 int result; | |
1494 | |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1495 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
|
1496 { |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1497 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
|
1498 return; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1499 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1500 else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil)) |
389 | 1501 return; |
1502 | |
1503 BLOCK_INPUT; | |
485 | 1504 if (NILP (arg)) |
12073 | 1505 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
|
1506 (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
|
1507 ? f->icon_name |
12073 | 1508 : f->name))->data); |
9563 | 1509 else |
1510 result = x_bitmap_icon (f, arg); | |
389 | 1511 |
1512 if (result) | |
1513 { | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1514 UNBLOCK_INPUT; |
9353
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1515 error ("No icon window available"); |
389 | 1516 } |
1517 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1518 XFlush (FRAME_X_DISPLAY (f)); |
389 | 1519 UNBLOCK_INPUT; |
1520 } | |
1521 | |
9563 | 1522 /* Return non-nil if frame F wants a bitmap icon. */ |
1523 | |
1524 Lisp_Object | |
9353
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1525 x_icon_type (f) |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1526 FRAME_PTR f; |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1527 { |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1528 Lisp_Object tem; |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1529 |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1530 tem = assq_no_quit (Qicon_type, f->param_alist); |
9563 | 1531 if (CONSP (tem)) |
1532 return XCONS (tem)->cdr; | |
1533 else | |
1534 return Qnil; | |
9353
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1535 } |
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1536 |
12073 | 1537 void |
1538 x_set_icon_name (f, arg, oldval) | |
1539 struct frame *f; | |
1540 Lisp_Object arg, oldval; | |
1541 { | |
1542 Lisp_Object tem; | |
1543 int result; | |
1544 | |
1545 if (STRINGP (arg)) | |
1546 { | |
1547 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) | |
1548 return; | |
1549 } | |
1550 else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil)) | |
1551 return; | |
1552 | |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
1553 f->icon_name = arg; |
12073 | 1554 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1555 if (f->output_data.x->icon_bitmap != 0) |
12073 | 1556 return; |
1557 | |
1558 BLOCK_INPUT; | |
1559 | |
1560 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
|
1561 (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
|
1562 ? f->icon_name |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1563 : !NILP (f->title) |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1564 ? f->title |
12073 | 1565 : f->name))->data); |
1566 | |
1567 if (result) | |
1568 { | |
1569 UNBLOCK_INPUT; | |
1570 error ("No icon window available"); | |
1571 } | |
1572 | |
1573 XFlush (FRAME_X_DISPLAY (f)); | |
1574 UNBLOCK_INPUT; | |
1575 } | |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1576 |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1577 extern Lisp_Object x_new_font (); |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1578 |
389 | 1579 void |
771 | 1580 x_set_font (f, arg, oldval) |
1581 struct frame *f; | |
389 | 1582 Lisp_Object arg, oldval; |
1583 { | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1584 Lisp_Object result; |
389 | 1585 |
1586 CHECK_STRING (arg, 1); | |
1587 | |
1588 BLOCK_INPUT; | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1589 result = x_new_font (f, XSTRING (arg)->data); |
389 | 1590 UNBLOCK_INPUT; |
1591 | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1592 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
|
1593 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
|
1594 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
|
1595 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
|
1596 else if (STRINGP (result)) |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1597 { |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1598 recompute_basic_faces (f); |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1599 store_frame_param (f, Qfont, result); |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1600 } |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1601 else |
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
1602 abort (); |
389 | 1603 } |
1604 | |
1605 void | |
771 | 1606 x_set_border_width (f, arg, oldval) |
1607 struct frame *f; | |
389 | 1608 Lisp_Object arg, oldval; |
1609 { | |
1610 CHECK_NUMBER (arg, 0); | |
1611 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1612 if (XINT (arg) == f->output_data.x->border_width) |
389 | 1613 return; |
1614 | |
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
|
1615 if (FRAME_X_WINDOW (f) != 0) |
389 | 1616 error ("Cannot change the border width of a window"); |
1617 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1618 f->output_data.x->border_width = XINT (arg); |
389 | 1619 } |
1620 | |
1621 void | |
771 | 1622 x_set_internal_border_width (f, arg, oldval) |
1623 struct frame *f; | |
389 | 1624 Lisp_Object arg, oldval; |
1625 { | |
1626 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
|
1627 int old = f->output_data.x->internal_border_width; |
389 | 1628 |
1629 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
|
1630 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
|
1631 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
|
1632 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
|
1633 |
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1634 if (f->output_data.x->internal_border_width == old) |
389 | 1635 return; |
1636 | |
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
|
1637 if (FRAME_X_WINDOW (f) != 0) |
389 | 1638 { |
1639 BLOCK_INPUT; | |
5899
4e8f26a0f2b7
*** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5721
diff
changeset
|
1640 x_set_window_size (f, 0, f->width, f->height); |
389 | 1641 #if 0 |
771 | 1642 x_set_resize_hint (f); |
389 | 1643 #endif |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1644 XFlush (FRAME_X_DISPLAY (f)); |
389 | 1645 UNBLOCK_INPUT; |
771 | 1646 SET_FRAME_GARBAGED (f); |
389 | 1647 } |
1648 } | |
1649 | |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1650 void |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1651 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
|
1652 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
|
1653 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
|
1654 { |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1655 Lisp_Object frame; |
9285
75f1c0d90b3d
(x_set_frame_parameters, x_set_visibility, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9240
diff
changeset
|
1656 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
|
1657 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1658 if (NILP (value)) |
5899
4e8f26a0f2b7
*** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5721
diff
changeset
|
1659 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
|
1660 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
|
1661 Ficonify_frame (frame); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
1662 else |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1663 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
|
1664 } |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1665 |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1666 static void |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1667 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
|
1668 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
|
1669 int n; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1670 { |
3477
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1671 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
|
1672 |
9329
4e1048594e7f
(x_set_menu_bar_lines_1): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents:
9327
diff
changeset
|
1673 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
|
1674 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
|
1675 |
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1676 /* 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
|
1677 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
|
1678 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
|
1679 |
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1680 /* 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
|
1681 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
|
1682 { |
3477
c079a2d6cf0e
(x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents:
3447
diff
changeset
|
1683 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
|
1684 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
|
1685 } |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1686 } |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1687 |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1688 void |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1689 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
|
1690 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
|
1691 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
|
1692 { |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1693 int nlines; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1694 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
|
1695 |
2880
9a78169e44df
* xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents:
2842
diff
changeset
|
1696 /* 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
|
1697 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
|
1698 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
|
1699 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
|
1700 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
|
1701 return; |
9a78169e44df
* xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents:
2842
diff
changeset
|
1702 |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
1703 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
|
1704 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
|
1705 else |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1706 nlines = 0; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1707 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1708 #ifdef USE_X_TOOLKIT |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1709 FRAME_MENU_BAR_LINES (f) = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1710 if (nlines) |
12832
0d750e41c4f2
(x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents:
12773
diff
changeset
|
1711 { |
0d750e41c4f2
(x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents:
12773
diff
changeset
|
1712 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
|
1713 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
|
1714 /* 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
|
1715 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
|
1716 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1717 else |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1718 { |
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
|
1719 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
|
1720 free_frame_menubar (f); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1721 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
|
1722 if (FRAME_X_P (f)) |
714433bead7f
(x_set_menu_bar_lines) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
13508
diff
changeset
|
1723 f->output_data.x->menubar_widget = 0; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1724 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1725 #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
|
1726 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
|
1727 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
|
1728 #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
|
1729 } |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1730 |
4650 | 1731 /* 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
|
1732 x_id_name. |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1733 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1734 If EXPLICIT is non-zero, that indicates that lisp code is setting the |
4650 | 1735 name; if NAME is a string, set F's name to NAME and set |
1736 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
|
1737 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1738 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
|
1739 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
|
1740 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
|
1741 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1742 void |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1743 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
|
1744 struct frame *f; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1745 Lisp_Object name; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1746 int explicit; |
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 /* 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
|
1749 Emacs redisplay code. */ |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1750 if (explicit) |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1751 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1752 /* 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
|
1753 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
|
1754 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
|
1755 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
|
1756 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1757 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
|
1758 } |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1759 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
|
1760 return; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1761 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1762 /* 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
|
1763 if (NILP (name)) |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
1764 { |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
1765 /* 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
|
1766 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
|
1767 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
|
1768 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
|
1769 return; |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
1770 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
|
1771 } |
833 | 1772 else |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1773 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
|
1774 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1775 /* 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
|
1776 if (! NILP (Fstring_equal (name, f->name))) |
727 | 1777 return; |
1778 | |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1779 f->name = name; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1780 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1781 /* 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
|
1782 the name parameter. */ |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1783 if (! NILP (f->title)) |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1784 name = f->title; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1785 |
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
|
1786 if (FRAME_X_WINDOW (f)) |
389 | 1787 { |
708 | 1788 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
|
1789 #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
|
1790 { |
12073 | 1791 XTextProperty text, icon; |
1792 Lisp_Object icon_name; | |
1793 | |
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
|
1794 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
|
1795 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
|
1796 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
|
1797 text.nitems = XSTRING (name)->size; |
12073 | 1798 |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
1799 icon_name = (!NILP (f->icon_name) ? f->icon_name : name); |
12073 | 1800 |
1801 icon.value = XSTRING (icon_name)->data; | |
1802 icon.encoding = XA_STRING; | |
1803 icon.format = 8; | |
1804 icon.nitems = XSTRING (icon_name)->size; | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1805 #ifdef USE_X_TOOLKIT |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1806 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
|
1807 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
|
1808 XSetWMIconName (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget), |
12073 | 1809 &icon); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1810 #else /* not USE_X_TOOLKIT */ |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1811 XSetWMName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text); |
12073 | 1812 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
|
1813 #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
|
1814 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1815 #else /* not HAVE_X11R4 */ |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1816 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
|
1817 XSTRING (name)->data); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1818 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
|
1819 XSTRING (name)->data); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1820 #endif /* not HAVE_X11R4 */ |
708 | 1821 UNBLOCK_INPUT; |
389 | 1822 } |
1018
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 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
|
1826 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
|
1827 redisplay code. */ |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1828 void |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1829 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
|
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, 1); |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1834 } |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1835 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1836 /* 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
|
1837 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
|
1838 lisp code. */ |
1125
059624bf9bf0
Declare x_implicitly_set_name to be void.
Jim Blandy <jimb@redhat.com>
parents:
1096
diff
changeset
|
1839 void |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1840 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
|
1841 FRAME_PTR f; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1842 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
|
1843 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1844 x_set_name (f, arg, 0); |
389 | 1845 } |
14482
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 /* 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
|
1848 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
|
1849 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1850 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
|
1851 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
|
1852 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
|
1853 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1854 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
|
1855 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
|
1856 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
|
1857 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1858 void |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1859 x_set_title (f, name) |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1860 struct frame *f; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1861 Lisp_Object 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 /* 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
|
1864 if (EQ (name, f->title)) |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1865 return; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1866 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1867 update_mode_lines = 1; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1868 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1869 f->title = 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 if (NILP (name)) |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1872 name = f->name; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1873 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1874 if (FRAME_X_WINDOW (f)) |
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 BLOCK_INPUT; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1877 #ifdef HAVE_X11R4 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1878 { |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1879 XTextProperty text, icon; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1880 Lisp_Object icon_name; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1881 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1882 text.value = XSTRING (name)->data; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1883 text.encoding = XA_STRING; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1884 text.format = 8; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1885 text.nitems = XSTRING (name)->size; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1886 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1887 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
|
1888 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1889 icon.value = XSTRING (icon_name)->data; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1890 icon.encoding = XA_STRING; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1891 icon.format = 8; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1892 icon.nitems = XSTRING (icon_name)->size; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1893 #ifdef USE_X_TOOLKIT |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1894 XSetWMName (FRAME_X_DISPLAY (f), |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1895 XtWindow (f->output_data.x->widget), &text); |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1896 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
|
1897 &icon); |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1898 #else /* not USE_X_TOOLKIT */ |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1899 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
|
1900 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
|
1901 #endif /* not USE_X_TOOLKIT */ |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1902 } |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1903 #else /* not HAVE_X11R4 */ |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1904 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
|
1905 XSTRING (name)->data); |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1906 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
|
1907 XSTRING (name)->data); |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1908 #endif /* not HAVE_X11R4 */ |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1909 UNBLOCK_INPUT; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1910 } |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1911 } |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1912 |
389 | 1913 void |
771 | 1914 x_set_autoraise (f, arg, oldval) |
1915 struct frame *f; | |
389 | 1916 Lisp_Object arg, oldval; |
1917 { | |
771 | 1918 f->auto_raise = !EQ (Qnil, arg); |
389 | 1919 } |
1920 | |
1921 void | |
771 | 1922 x_set_autolower (f, arg, oldval) |
1923 struct frame *f; | |
389 | 1924 Lisp_Object arg, oldval; |
1925 { | |
771 | 1926 f->auto_lower = !EQ (Qnil, arg); |
389 | 1927 } |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1928 |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1929 void |
9580
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1930 x_set_unsplittable (f, arg, oldval) |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1931 struct frame *f; |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1932 Lisp_Object arg, oldval; |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1933 { |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1934 f->no_split = !NILP (arg); |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1935 } |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1936 |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1937 void |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1938 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
|
1939 struct frame *f; |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1940 Lisp_Object arg, oldval; |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1941 { |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1942 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
|
1943 { |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
1944 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
|
1945 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
1946 /* 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
|
1947 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
|
1948 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
|
1949 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
|
1950 if (FRAME_X_WINDOW (f)) |
5899
4e8f26a0f2b7
*** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
5721
diff
changeset
|
1951 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
|
1952 } |
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1953 } |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1954 |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1955 void |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1956 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
|
1957 struct frame *f; |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1958 Lisp_Object arg, oldval; |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1959 { |
9166
44b44e900cf1
(x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents:
9103
diff
changeset
|
1960 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
|
1961 { |
44b44e900cf1
(x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents:
9103
diff
changeset
|
1962 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
|
1963 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
|
1964 } |
44b44e900cf1
(x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents:
9103
diff
changeset
|
1965 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
|
1966 && 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
|
1967 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1968 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
|
1969 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
|
1970 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
|
1971 if (FRAME_X_WINDOW (f)) |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1972 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
|
1973 } |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1974 } |
389 | 1975 |
771 | 1976 /* Subroutines of creating an X frame. */ |
389 | 1977 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
1978 /* 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
|
1979 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
|
1980 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1981 static void |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1982 validate_x_resource_name () |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
1983 { |
11353
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1984 int len; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1985 /* 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
|
1986 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
|
1987 /* 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
|
1988 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
|
1989 Lisp_Object new; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1990 int i; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1991 |
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
|
1992 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
|
1993 { |
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 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
|
1995 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
|
1996 |
11353
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1997 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
|
1998 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
1999 /* 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
|
2000 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
|
2001 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
|
2002 { |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
2003 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
|
2004 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
|
2005 || (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
|
2006 || (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
|
2007 || c == '-' || c == '_')) |
11353
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2008 bad_count++; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2009 else |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2010 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
|
2011 } |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
2012 } |
5b784d881c0f
(validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents:
7408
diff
changeset
|
2013 else |
11353
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2014 /* 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
|
2015 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
|
2016 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2017 /* 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
|
2018 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
|
2019 return; |
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 /* 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
|
2022 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
|
2023 || (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
|
2024 { |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2025 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
|
2026 return; |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2027 } |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2028 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2029 /* 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
|
2030 with underscores. */ |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2031 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2032 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
|
2033 |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2034 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
|
2035 { |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2036 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
|
2037 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
|
2038 || (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
|
2039 || (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
|
2040 || c == '-' || c == '_')) |
9e3da029f921
(x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents:
11235
diff
changeset
|
2041 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
|
2042 } |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2043 } |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2044 |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2045 |
389 | 2046 extern char *x_get_string_resource (); |
2047 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2048 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
|
2049 "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
|
2050 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
|
2051 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
|
2052 the name specified by the `-name' or `-rn' command-line arguments.\n\ |
389 | 2053 \n\ |
1733
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
2054 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
|
2055 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
|
2056 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
|
2057 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
|
2058 (attribute, class, component, subclass) |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2059 Lisp_Object attribute, class, component, subclass; |
389 | 2060 { |
2061 register char *value; | |
2062 char *name_key; | |
2063 char *class_key; | |
2064 | |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
2065 check_x (); |
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
2066 |
389 | 2067 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
|
2068 CHECK_STRING (class, 0); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2069 |
1733
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
2070 if (!NILP (component)) |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
2071 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
|
2072 if (!NILP (subclass)) |
2d41a3d7b9a6
(Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents:
1719
diff
changeset
|
2073 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
|
2074 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
|
2075 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
|
2076 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2077 validate_x_resource_name (); |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2078 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2079 /* 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
|
2080 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
|
2081 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
|
2082 + (STRINGP (component) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2083 ? XSTRING (component)->size : 0) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2084 + XSTRING (attribute)->size |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2085 + 3); |
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 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
|
2088 + XSTRING (class)->size |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2089 + (STRINGP (subclass) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2090 ? XSTRING (subclass)->size : 0) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2091 + 3); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2092 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2093 /* 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
|
2094 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
|
2095 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
|
2096 strcpy (class_key, EMACS_CLASS); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2097 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2098 strcat (class_key, "."); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2099 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
|
2100 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2101 if (!NILP (component)) |
389 | 2102 { |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2103 strcat (class_key, "."); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2104 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
|
2105 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2106 strcat (name_key, "."); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2107 strcat (name_key, XSTRING (component)->data); |
389 | 2108 } |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2109 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2110 strcat (name_key, "."); |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2111 strcat (name_key, XSTRING (attribute)->data); |
389 | 2112 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2113 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
|
2114 name_key, class_key); |
389 | 2115 |
2116 if (value != (char *) 0) | |
2117 return build_string (value); | |
2118 else | |
2119 return Qnil; | |
2120 } | |
2121 | |
3173
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2122 /* 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
|
2123 |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2124 char * |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2125 x_get_resource_string (attribute, class) |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2126 char *attribute, *class; |
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 register char *value; |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2129 char *name_key; |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2130 char *class_key; |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2131 |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2132 /* 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
|
2133 and the final '\0'. */ |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2134 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
|
2135 + strlen (attribute) + 2); |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2136 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
|
2137 + strlen (class) + 2); |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2138 |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2139 sprintf (name_key, "%s.%s", |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2140 XSTRING (Vinvocation_name)->data, |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2141 attribute); |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2142 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
|
2143 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2144 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
|
2145 name_key, class_key); |
3173
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2146 } |
c3c1b1ceab05
(x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
3170
diff
changeset
|
2147 |
398 | 2148 /* Types we might convert a resource string into. */ |
2149 enum resource_types | |
2150 { | |
4571
25bee4fe64aa
(enum resource_types): Delete final comma.
Richard M. Stallman <rms@gnu.org>
parents:
4367
diff
changeset
|
2151 number, boolean, string, symbol |
398 | 2152 }; |
2153 | |
389 | 2154 /* Return the value of parameter PARAM. |
398 | 2155 |
771 | 2156 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
|
2157 database, using ATTRIBUTE as the attribute name and CLASS as its class. |
398 | 2158 |
2159 Convert the resource to the type specified by desired_type. | |
2160 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2161 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
|
2162 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
|
2163 and don't let it get stored in any Lisp-visible variables! */ |
389 | 2164 |
2165 static Lisp_Object | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2166 x_get_arg (alist, param, attribute, class, type) |
641 | 2167 Lisp_Object alist, param; |
398 | 2168 char *attribute; |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2169 char *class; |
398 | 2170 enum resource_types type; |
389 | 2171 { |
2172 register Lisp_Object tem; | |
2173 | |
2174 tem = Fassq (param, alist); | |
2175 if (EQ (tem, Qnil)) | |
771 | 2176 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
|
2177 if (EQ (tem, Qnil)) |
389 | 2178 { |
974
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 if (attribute) |
398 | 2181 { |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2182 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
|
2183 build_string (class), |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2184 Qnil, Qnil); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2185 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2186 if (NILP (tem)) |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2187 return Qunbound; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2188 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2189 switch (type) |
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 number: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2192 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
|
2193 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2194 case boolean: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2195 tem = Fdowncase (tem); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2196 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
|
2197 || !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
|
2198 return Qt; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2199 else |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2200 return Qnil; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2201 |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2202 case string: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2203 return tem; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2204 |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2205 case symbol: |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2206 /* 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
|
2207 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
|
2208 { |
6519
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
2209 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
|
2210 lower = Fdowncase (tem); |
6523
d9d9ab5951dd
(x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents:
6522
diff
changeset
|
2211 if (!strcmp (XSTRING (lower)->data, "on") |
d9d9ab5951dd
(x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents:
6522
diff
changeset
|
2212 || !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
|
2213 return Qt; |
6523
d9d9ab5951dd
(x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents:
6522
diff
changeset
|
2214 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
|
2215 || !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
|
2216 return Qnil; |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2217 else |
2686
a84b9a78ab08
(x_get_arg): Call Fintern, not intern.
Richard M. Stallman <rms@gnu.org>
parents:
2439
diff
changeset
|
2218 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
|
2219 } |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2220 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2221 default: |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2222 abort (); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2223 } |
398 | 2224 } |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2225 else |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2226 return Qunbound; |
389 | 2227 } |
2228 return Fcdr (tem); | |
2229 } | |
2230 | |
771 | 2231 /* Record in frame F the specified or default value according to ALIST |
389 | 2232 of the parameter named PARAM (a Lisp symbol). |
2233 If no value is specified for PARAM, look for an X default for XPROP | |
771 | 2234 on the frame named NAME. |
389 | 2235 If that is not found either, use the value DEFLT. */ |
2236 | |
2237 static Lisp_Object | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2238 x_default_parameter (f, alist, prop, deflt, xprop, xclass, type) |
771 | 2239 struct frame *f; |
389 | 2240 Lisp_Object alist; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2241 Lisp_Object prop; |
389 | 2242 Lisp_Object deflt; |
2243 char *xprop; | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2244 char *xclass; |
398 | 2245 enum resource_types type; |
389 | 2246 { |
2247 Lisp_Object tem; | |
2248 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2249 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
|
2250 if (EQ (tem, Qunbound)) |
389 | 2251 tem = deflt; |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2252 x_set_frame_parameters (f, Fcons (Fcons (prop, tem), Qnil)); |
389 | 2253 return tem; |
2254 } | |
2255 | |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
2256 DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0, |
389 | 2257 "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
|
2258 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
|
2259 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
|
2260 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
|
2261 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
|
2262 or a list (- N) meaning -N pixels relative to bottom/right corner.") |
389 | 2263 (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
|
2264 Lisp_Object string; |
389 | 2265 { |
2266 int geometry, x, y; | |
2267 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
|
2268 Lisp_Object result; |
389 | 2269 |
2270 CHECK_STRING (string, 0); | |
2271 | |
2272 geometry = XParseGeometry ((char *) XSTRING (string)->data, | |
2273 &x, &y, &width, &height); | |
2274 | |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2275 #if 0 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2276 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
|
2277 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
|
2278 #endif |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2279 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2280 result = Qnil; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2281 if (geometry & XValue) |
389 | 2282 { |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2283 Lisp_Object element; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2284 |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2285 if (x >= 0 && (geometry & XNegative)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2286 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
|
2287 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
|
2288 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
|
2289 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2290 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
|
2291 result = Fcons (element, result); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2292 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2293 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2294 if (geometry & YValue) |
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 Lisp_Object element; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2297 |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2298 if (y >= 0 && (geometry & YNegative)) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2299 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
|
2300 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
|
2301 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
|
2302 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2303 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
|
2304 result = Fcons (element, result); |
389 | 2305 } |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2306 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2307 if (geometry & WidthValue) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2308 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
|
2309 if (geometry & HeightValue) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2310 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
|
2311 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2312 return result; |
389 | 2313 } |
2314 | |
2315 /* 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
|
2316 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
|
2317 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2318 This function does not make the coordinates positive. */ |
389 | 2319 |
2320 #define DEFAULT_ROWS 40 | |
2321 #define DEFAULT_COLS 80 | |
2322 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2323 static int |
771 | 2324 x_figure_window_size (f, parms) |
2325 struct frame *f; | |
389 | 2326 Lisp_Object parms; |
2327 { | |
7251
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2328 register Lisp_Object tem0, tem1, tem2; |
389 | 2329 int height, width, left, top; |
2330 register int geometry; | |
2331 long window_prompting = 0; | |
2332 | |
2333 /* Default values if we fall through. | |
2334 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
|
2335 window manager prompting. */ |
771 | 2336 f->width = DEFAULT_COLS; |
2337 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
|
2338 /* 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
|
2339 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
|
2340 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
|
2341 f->output_data.x->left_pos = 0; |
389 | 2342 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2343 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
|
2344 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
|
2345 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
|
2346 if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) |
389 | 2347 { |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2348 if (!EQ (tem0, Qunbound)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2349 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2350 CHECK_NUMBER (tem0, 0); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2351 f->height = XINT (tem0); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2352 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2353 if (!EQ (tem1, Qunbound)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2354 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2355 CHECK_NUMBER (tem1, 0); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2356 f->width = XINT (tem1); |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2357 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2358 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
|
2359 window_prompting |= USSize; |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2360 else |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2361 window_prompting |= PSize; |
389 | 2362 } |
2363 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2364 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
|
2365 = (!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
|
2366 ? 0 |
60497ceed71a
(x_figure_window_size): Use new formula for scroll bar width.
Karl Heuer <kwzh@gnu.org>
parents:
9231
diff
changeset
|
2367 : 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
|
2368 ? 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
|
2369 : (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
|
2370 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
|
2371 f->output_data.x->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height); |
389 | 2372 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2373 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
|
2374 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
|
2375 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
|
2376 if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) |
389 | 2377 { |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2378 if (EQ (tem0, Qminus)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2379 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2380 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
|
2381 window_prompting |= YNegative; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2382 } |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2383 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
|
2384 && CONSP (XCONS (tem0)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2385 && 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
|
2386 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2387 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
|
2388 window_prompting |= YNegative; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2389 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2390 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
|
2391 && CONSP (XCONS (tem0)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2392 && 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
|
2393 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2394 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
|
2395 } |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2396 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
|
2397 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
|
2398 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2399 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2400 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
|
2401 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
|
2402 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
|
2403 window_prompting |= YNegative; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2404 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2405 |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2406 if (EQ (tem1, Qminus)) |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2407 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2408 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
|
2409 window_prompting |= XNegative; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2410 } |
9022
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2411 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
|
2412 && CONSP (XCONS (tem1)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2413 && 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
|
2414 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2415 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
|
2416 window_prompting |= XNegative; |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2417 } |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2418 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
|
2419 && CONSP (XCONS (tem1)->cdr) |
10fa443c671a
(Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents:
9014
diff
changeset
|
2420 && 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
|
2421 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2422 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
|
2423 } |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2424 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
|
2425 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
|
2426 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2427 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2428 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
|
2429 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
|
2430 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
|
2431 window_prompting |= XNegative; |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2432 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2433 |
10264
92dcc001aa20
(x_figure_window_size): Treat missing user-position parm as nil.
Richard M. Stallman <rms@gnu.org>
parents:
10222
diff
changeset
|
2434 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
|
2435 window_prompting |= USPosition; |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2436 else |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
2437 window_prompting |= PPosition; |
389 | 2438 } |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
2439 |
3293
03e4cad68481
(Fx_close_current_connection): Clear x_current_display.
Richard M. Stallman <rms@gnu.org>
parents:
3203
diff
changeset
|
2440 return window_prompting; |
389 | 2441 } |
2442 | |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2443 #if !defined (HAVE_X11R4) && !defined (HAVE_XSETWMPROTOCOLS) |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2444 |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2445 Status |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2446 XSetWMProtocols (dpy, w, protocols, count) |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2447 Display *dpy; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2448 Window w; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2449 Atom *protocols; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2450 int count; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2451 { |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2452 Atom prop; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2453 prop = XInternAtom (dpy, "WM_PROTOCOLS", False); |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2454 if (prop == None) return False; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2455 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
|
2456 (unsigned char *) protocols, count); |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2457 return True; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
2458 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2459 #endif /* not HAVE_X11R4 && not HAVE_XSETWMPROTOCOLS */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2460 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2461 #ifdef USE_X_TOOLKIT |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2462 |
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
|
2463 /* 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
|
2464 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
|
2465 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
|
2466 for example, but Xt doesn't). */ |
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 static void |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2469 hack_wm_protocols (f, widget) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2470 FRAME_PTR f; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2471 Widget widget; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2472 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2473 Display *dpy = XtDisplay (widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2474 Window w = XtWindow (widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2475 int need_delete = 1; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2476 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
|
2477 int need_save = 1; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2478 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2479 BLOCK_INPUT; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2480 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2481 Atom type, *atoms = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2482 int format = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2483 unsigned long nitems = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2484 unsigned long bytes_after; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2485 |
11882
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
2486 if ((XGetWindowProperty (dpy, w, |
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
2487 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
|
2488 (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
|
2489 &type, &format, &nitems, &bytes_after, |
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
2490 (unsigned char **) &atoms) |
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
2491 == Success) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2492 && format == 32 && type == XA_ATOM) |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2493 while (nitems > 0) |
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 nitems--; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2496 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
|
2497 need_delete = 0; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2498 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
|
2499 need_focus = 0; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2500 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
|
2501 need_save = 0; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2502 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2503 if (atoms) XFree ((char *) atoms); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2504 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2505 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2506 Atom props [10]; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2507 int count = 0; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2508 if (need_delete) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2509 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
|
2510 if (need_focus) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2511 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
|
2512 if (need_save) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2513 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
|
2514 if (count) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2515 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
|
2516 XA_ATOM, 32, PropModeAppend, |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2517 (unsigned char *) props, count); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2518 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2519 UNBLOCK_INPUT; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2520 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2521 #endif |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2522 |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2523 #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
|
2524 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2525 /* 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
|
2526 |
389 | 2527 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
|
2528 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
|
2529 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
|
2530 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
|
2531 int minibuffer_only; |
389 | 2532 { |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2533 XClassHint class_hints; |
6059
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2534 XSetWindowAttributes attributes; |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2535 unsigned long attribute_mask; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2536 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2537 Widget shell_widget; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2538 Widget pane_widget; |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2539 Widget frame_widget; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2540 Arg al [25]; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2541 int ac; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2542 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2543 BLOCK_INPUT; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2544 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2545 /* 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
|
2546 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
|
2547 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
|
2548 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2549 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
|
2550 |
11496
db02849ee365
(x_window): Use (or reuse) frame's namebuf instead of a
Karl Heuer <kwzh@gnu.org>
parents:
11483
diff
changeset
|
2551 { |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2552 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
|
2553 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
|
2554 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
|
2555 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2556 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2557 ac = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2558 XtSetArg (al[ac], XtNallowShellResize, 1); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2559 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
|
2560 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
|
2561 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
|
2562 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
|
2563 applicationShellWidgetClass, |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
2564 FRAME_X_DISPLAY (f), al, ac); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2565 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2566 f->output_data.x->widget = shell_widget; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2567 /* maybe_set_screen_title_format (shell_widget); */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2568 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2569 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
|
2570 (widget_value *) NULL, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2571 shell_widget, False, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2572 (lw_callback) NULL, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2573 (lw_callback) NULL, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2574 (lw_callback) NULL); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2575 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2576 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
|
2577 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2578 /* 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
|
2579 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
|
2580 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2581 ac = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2582 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2583 XtSetArg (al[ac], XtNshowGrip, 0); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2584 XtSetArg (al[ac], XtNallowResize, 1); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2585 XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2586 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
|
2587 frame_widget = XtCreateWidget (f->namebuf, |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2588 emacsFrameClass, |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2589 pane_widget, al, ac); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2590 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2591 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
|
2592 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2593 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
|
2594 |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2595 /* 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
|
2596 { |
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 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
|
2598 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
|
2599 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
|
2600 int ac = 0; |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2601 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
|
2602 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
|
2603 = (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
|
2604 ? (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
|
2605 + 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
|
2606 : 0); |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2607 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
|
2608 |
7969
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2609 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
|
2610 { |
9808
4c43c9dbe130
(x_window): Make ibw 0 by default.
Richard M. Stallman <rms@gnu.org>
parents:
9742
diff
changeset
|
2611 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
|
2612 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
|
2613 menubar_size += ibw; |
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2614 } |
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2615 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2616 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
|
2617 |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2618 /* 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
|
2619 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
|
2620 Both conclusions reached experimentally. -- rms. */ |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2621 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
|
2622 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
|
2623 &extra_borders, NULL); |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2624 |
11707
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2625 /* 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
|
2626 and specify it. |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2627 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
|
2628 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
|
2629 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
|
2630 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2631 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
|
2632 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
|
2633 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
|
2634 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
|
2635 if (xneg) |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2636 left = -left; |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2637 if (yneg) |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2638 top = -top; |
11893
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2639 |
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2640 if (window_prompting & USPosition) |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2641 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
|
2642 PIXEL_WIDTH (f) + extra_borders, |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2643 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
|
2644 (xneg ? '-' : '+'), left, |
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2645 (yneg ? '-' : '+'), top); |
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2646 else |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2647 sprintf (shell_position, "=%dx%d", |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2648 PIXEL_WIDTH (f) + extra_borders, |
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2649 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
|
2650 } |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2651 |
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
|
2652 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
|
2653 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
|
2654 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
|
2655 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
|
2656 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
|
2657 } |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2658 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2659 XtManageChild (pane_widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2660 XtRealizeWidget (shell_widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2661 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2662 FRAME_X_WINDOW (f) = XtWindow (frame_widget); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2663 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2664 validate_x_resource_name (); |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2665 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2666 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
|
2667 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
|
2668 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
|
2669 |
13227
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2670 #ifdef HAVE_X_I18N |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2671 #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
|
2672 { |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2673 XIM xim; |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2674 XIC xic = NULL; |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2675 |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2676 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
|
2677 |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2678 if (xim) |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2679 { |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2680 xic = XCreateIC (xim, |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2681 XNInputStyle, XIMPreeditNothing | XIMStatusNothing, |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2682 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
|
2683 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
|
2684 NULL); |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2685 |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2686 if (xic == 0) |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2687 { |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2688 XCloseIM (xim); |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2689 xim = NULL; |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2690 } |
13227
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2691 } |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2692 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
|
2693 FRAME_XIC (f) = xic; |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2694 } |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2695 #else /* X_I18N_INHIBITED */ |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2696 FRAME_XIM (f) = 0; |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2697 FRAME_XIC (f) = 0; |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2698 #endif /* X_I18N_INHIBITED */ |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2699 #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
|
2700 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2701 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
|
2702 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
|
2703 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
|
2704 &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
|
2705 |
9703
85ac0e4030d4
(x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents:
9690
diff
changeset
|
2706 hack_wm_protocols (f, shell_widget); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2707 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2708 #ifdef HACK_EDITRES |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2709 XtAddEventHandler (shell_widget, 0, True, _XEditResCheckMessages, 0); |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2710 #endif |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2711 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2712 /* 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
|
2713 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
|
2714 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
|
2715 */ |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2716 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
|
2717 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
|
2718 XA_ATOM, 32, PropModeAppend, |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2719 (unsigned char*) NULL, 0); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2720 |
6059
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2721 /* 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
|
2722 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
|
2723 attribute_mask = CWEventMask; |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2724 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
|
2725 attribute_mask, &attributes); |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2726 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2727 XtMapWidget (frame_widget); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2728 |
6790
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 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
|
2730 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
|
2731 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
|
2732 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
|
2733 { |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2734 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
|
2735 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
|
2736 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2737 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
|
2738 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
|
2739 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
|
2740 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
|
2741 } |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2742 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2743 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
|
2744 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
|
2745 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2746 UNBLOCK_INPUT; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2747 |
11962
f9b853c18bb5
(x_window): Call initialize_frame_menubar
Karl Heuer <kwzh@gnu.org>
parents:
11932
diff
changeset
|
2748 if (!minibuffer_only && FRAME_EXTERNAL_MENU_BAR (f)) |
f9b853c18bb5
(x_window): Call initialize_frame_menubar
Karl Heuer <kwzh@gnu.org>
parents:
11932
diff
changeset
|
2749 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
|
2750 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
|
2751 |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2752 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
|
2753 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
|
2754 } |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2755 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2756 #else /* not USE_X_TOOLKIT */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2757 |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2758 /* 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
|
2759 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2760 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
|
2761 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
|
2762 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2763 { |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2764 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
|
2765 XSetWindowAttributes attributes; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2766 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
|
2767 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2768 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
|
2769 attributes.border_pixel = f->output_data.x->border_pixel; |
389 | 2770 attributes.bit_gravity = StaticGravity; |
2771 attributes.backing_store = NotUseful; | |
2772 attributes.save_under = True; | |
2773 attributes.event_mask = STANDARD_EVENT_SET; | |
2774 attribute_mask = (CWBackPixel | CWBorderPixel | CWBitGravity | |
2775 #if 0 | |
2776 | CWBackingStore | CWSaveUnder | |
2777 #endif | |
2778 | CWEventMask); | |
2779 | |
2780 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
|
2781 FRAME_X_WINDOW (f) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2782 = 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
|
2783 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
|
2784 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
|
2785 f->output_data.x->top_pos, |
771 | 2786 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
|
2787 f->output_data.x->border_width, |
389 | 2788 CopyFromParent, /* depth */ |
2789 InputOutput, /* class */ | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2790 FRAME_X_DISPLAY_INFO (f)->visual, |
389 | 2791 attribute_mask, &attributes); |
13227
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2792 #ifdef HAVE_X_I18N |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2793 #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
|
2794 { |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2795 XIM xim; |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2796 XIC xic = NULL; |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2797 |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2798 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
|
2799 |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2800 if (xim) |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2801 { |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2802 xic = XCreateIC (xim, |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2803 XNInputStyle, XIMPreeditNothing | XIMStatusNothing, |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2804 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
|
2805 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
|
2806 NULL); |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2807 |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2808 if (!xic) |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2809 { |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2810 XCloseIM (xim); |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2811 xim = NULL; |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2812 } |
13227
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2813 } |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2814 |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2815 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
|
2816 FRAME_XIC (f) = xic; |
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2817 } |
14831
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2818 #else /* X_I18N_INHIBITED */ |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2819 FRAME_XIM (f) = 0; |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2820 FRAME_XIC (f) = 0; |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2821 #endif /* X_I18N_INHIBITED */ |
df37dc2b9bfb
(X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents:
14746
diff
changeset
|
2822 #endif /* HAVE_X_I18N */ |
389 | 2823 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2824 validate_x_resource_name (); |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2825 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2826 class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data; |
389 | 2827 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
|
2828 XSetClassHint (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &class_hints); |
771 | 2829 |
11897
cbd3724a9696
(x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents:
11894
diff
changeset
|
2830 /* 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
|
2831 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
|
2832 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
|
2833 |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
2834 /* 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
|
2835 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
|
2836 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
|
2837 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
|
2838 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2839 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
|
2840 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
|
2841 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
|
2842 &f->output_data.x->wm_hints); |
15081
ab8c81feacf9
(x_window) [! USE_X_TOOLKIT]: Initialize wm_hints.icon_pixmap.
Richard M. Stallman <rms@gnu.org>
parents:
15079
diff
changeset
|
2843 f->output_data.x->wm_hints.icon_pixmap = None; |
7860
26a1d7b2670b
(x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents:
7802
diff
changeset
|
2844 |
26a1d7b2670b
(x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents:
7802
diff
changeset
|
2845 /* 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
|
2846 { |
26a1d7b2670b
(x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents:
7802
diff
changeset
|
2847 Atom protocols[2]; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2848 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
|
2849 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
|
2850 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
|
2851 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2852 |
817 | 2853 /* x_set_name normally ignores requests to set the name if the |
2854 requested name is the same as the current name. This is the one | |
2855 place where that assumption isn't correct; f->name is set, but | |
2856 the X server hasn't been told. */ | |
2857 { | |
6519
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
2858 Lisp_Object name; |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2859 int explicit = f->explicit_name; |
817 | 2860 |
6519
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
2861 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
|
2862 name = f->name; |
817 | 2863 f->name = Qnil; |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2864 x_set_name (f, name, explicit); |
817 | 2865 } |
2866 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2867 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
|
2868 f->output_data.x->text_cursor); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2869 |
389 | 2870 UNBLOCK_INPUT; |
2871 | |
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
|
2872 if (FRAME_X_WINDOW (f) == 0) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2873 error ("Unable to create window"); |
389 | 2874 } |
2875 | |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2876 #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
|
2877 |
389 | 2878 /* Handle the icon stuff for this window. Perhaps later we might |
2879 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
|
2880 well. */ |
389 | 2881 |
2882 static void | |
771 | 2883 x_icon (f, parms) |
2884 struct frame *f; | |
389 | 2885 Lisp_Object parms; |
2886 { | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2887 Lisp_Object icon_x, icon_y; |
389 | 2888 |
2889 /* 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
|
2890 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
|
2891 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
|
2892 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
|
2893 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) |
389 | 2894 { |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2895 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
|
2896 CHECK_NUMBER (icon_y, 0); |
389 | 2897 } |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2898 else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound)) |
389 | 2899 error ("Both left and top icon corners of icon must be specified"); |
2900 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2901 BLOCK_INPUT; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2902 |
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
|
2903 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
|
2904 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
|
2905 |
389 | 2906 /* 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
|
2907 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
|
2908 (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
|
2909 ? IconicState |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2910 : NormalState)); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2911 |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
2912 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
|
2913 ? 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
|
2914 : f->name))->data); |
12073 | 2915 |
389 | 2916 UNBLOCK_INPUT; |
2917 } | |
2918 | |
2919 /* Make the GC's needed for this window, setting the | |
2920 background, border and mouse colors; also create the | |
2921 mouse cursor and the gray border tile. */ | |
2922 | |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2923 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
|
2924 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2925 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
|
2926 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
|
2927 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
|
2928 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
|
2929 }; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2930 |
389 | 2931 static void |
771 | 2932 x_make_gc (f) |
2933 struct frame *f; | |
389 | 2934 { |
2935 XGCValues gc_values; | |
2936 GC temp_gc; | |
2937 XImage tileimage; | |
2938 | |
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
|
2939 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
|
2940 |
771 | 2941 /* Create the GC's of this frame. |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2942 Note that many default values are used. */ |
389 | 2943 |
2944 /* 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
|
2945 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
|
2946 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
|
2947 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
|
2948 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
|
2949 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
|
2950 FRAME_X_WINDOW (f), |
389 | 2951 GCLineWidth | GCFont |
2952 | GCForeground | GCBackground, | |
2953 &gc_values); | |
2954 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2955 /* 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
|
2956 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
|
2957 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
|
2958 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
|
2959 FRAME_X_WINDOW (f), |
389 | 2960 GCFont | GCForeground | GCBackground |
2961 | GCLineWidth, | |
2962 &gc_values); | |
2963 | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2964 /* 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
|
2965 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
|
2966 gc_values.background = f->output_data.x->cursor_pixel; |
389 | 2967 gc_values.fill_style = FillOpaqueStippled; |
2968 gc_values.stipple | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2969 = XCreateBitmapFromData (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2970 FRAME_X_DISPLAY_INFO (f)->root_window, |
389 | 2971 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
|
2972 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
|
2973 = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 2974 (GCFont | GCForeground | GCBackground |
2975 | GCFillStyle | GCStipple | GCLineWidth), | |
2976 &gc_values); | |
2977 | |
2978 /* Create the gray border tile used when the pointer is not in | |
771 | 2979 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
|
2980 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
|
2981 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
|
2982 = (XCreatePixmapFromBitmapData |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2983 (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
|
2984 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
|
2985 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
|
2986 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
|
2987 DefaultDepth (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2988 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
|
2989 |
1982e2983822
* xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents:
2328
diff
changeset
|
2990 UNBLOCK_INPUT; |
389 | 2991 } |
2992 | |
771 | 2993 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, |
389 | 2994 1, 1, 0, |
771 | 2995 "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
|
2996 Returns an Emacs frame object.\n\ |
771 | 2997 ALIST is an alist of frame parameters.\n\ |
2998 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
|
2999 and do not specify a specific minibuffer window to use,\n\ |
771 | 3000 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
|
3001 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
|
3002 \n\ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3003 This function is an internal primitive--use `make-frame' instead.") |
389 | 3004 (parms) |
3005 Lisp_Object parms; | |
3006 { | |
771 | 3007 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
|
3008 Lisp_Object frame, tem; |
389 | 3009 Lisp_Object name; |
3010 int minibuffer_only = 0; | |
3011 long window_prompting = 0; | |
3012 int width, height; | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3013 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
|
3014 struct gcpro gcpro1; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3015 Lisp_Object display; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3016 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
|
3017 Lisp_Object parent; |
11774
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3018 struct kboard *kb; |
389 | 3019 |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
3020 check_x (); |
389 | 3021 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3022 /* 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
|
3023 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
|
3024 Vx_resource_name = Vinvocation_name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3025 |
12316
459ad0d54bef
(Fx_create_frame): Fix last arg to x_get_arg for Qdisplay.
Richard M. Stallman <rms@gnu.org>
parents:
12276
diff
changeset
|
3026 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
|
3027 if (EQ (display, Qunbound)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3028 display = Qnil; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3029 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
|
3030 #ifdef MULTI_KBOARD |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3031 kb = dpyinfo->kboard; |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3032 #else |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3033 kb = &the_only_kboard; |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3034 #endif |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3035 |
14381 | 3036 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
|
3037 if (!STRINGP (name) |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3038 && ! EQ (name, Qunbound) |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3039 && ! NILP (name)) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3040 error ("Invalid frame name--not a string or nil"); |
398 | 3041 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3042 if (STRINGP (name)) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3043 Vx_resource_name = name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3044 |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3045 /* 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
|
3046 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
|
3047 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
|
3048 parent = Qnil; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3049 if (! NILP (parent)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3050 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
|
3051 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3052 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
|
3053 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
|
3054 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
|
3055 else if (EQ (tem, Qonly)) |
389 | 3056 { |
771 | 3057 f = make_minibuffer_frame (); |
389 | 3058 minibuffer_only = 1; |
3059 } | |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
3060 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
|
3061 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
|
3062 else |
771 | 3063 f = make_frame (1); |
3064 | |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3065 /* 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
|
3066 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
|
3067 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3068 XSETFRAME (frame, f); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3069 GCPRO1 (frame); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3070 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3071 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
|
3072 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
|
3073 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
|
3074 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
|
3075 |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
3076 f->icon_name |
12073 | 3077 = 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
|
3078 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
|
3079 f->icon_name = Qnil; |
12073 | 3080 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3081 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
|
3082 #ifdef MULTI_KBOARD |
11774
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3083 FRAME_KBOARD (f) = kb; |
11014
634a98104921
(Fx_create_frame): set the frame's kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10920
diff
changeset
|
3084 #endif |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3085 |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3086 /* 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
|
3087 |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3088 if (!NILP (parent)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3089 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3090 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
|
3091 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
|
3092 } |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3093 else |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3094 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3095 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
|
3096 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
|
3097 } |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3098 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3099 /* 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
|
3100 f->phys_cursor_x = -1; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3101 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3102 /* 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
|
3103 be set. */ |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3104 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
|
3105 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3106 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
|
3107 f->explicit_name = 0; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3108 } |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3109 else |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3110 { |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3111 f->name = name; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3112 f->explicit_name = 1; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3113 /* 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
|
3114 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
|
3115 } |
771 | 3116 |
389 | 3117 /* Extract the window parameters from the supplied values |
3118 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
|
3119 { |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
3120 Lisp_Object font; |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
3121 |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3122 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
|
3123 BLOCK_INPUT; |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3124 /* 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
|
3125 if (STRINGP (font)) |
4269
fcbdc9cca97a
(Fx_create_frame): Typo in previous change.
Richard M. Stallman <rms@gnu.org>
parents:
4259
diff
changeset
|
3126 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
|
3127 /* 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
|
3128 if (!STRINGP (font)) |
8270
1a0af0f4fb1d
(Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents:
8192
diff
changeset
|
3129 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
|
3130 if (! STRINGP (font)) |
8270
1a0af0f4fb1d
(Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents:
8192
diff
changeset
|
3131 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
|
3132 if (! STRINGP (font)) |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3133 /* 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
|
3134 and takes too long. */ |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3135 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
|
3136 /* 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
|
3137 if (! STRINGP (font)) |
8270
1a0af0f4fb1d
(Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents:
8192
diff
changeset
|
3138 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
|
3139 UNBLOCK_INPUT; |
e2e92cd737bf
* xfns.c (Fx_create_frame): Block input around call to
Jim Blandy <jimb@redhat.com>
parents:
4146
diff
changeset
|
3140 if (! STRINGP (font)) |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3141 font = build_string ("fixed"); |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3142 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
3143 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
|
3144 "font", "Font", string); |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
3145 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3146 |
9808
4c43c9dbe130
(x_window): Make ibw 0 by default.
Richard M. Stallman <rms@gnu.org>
parents:
9742
diff
changeset
|
3147 #ifdef USE_X_TOOLKIT |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
3148 /* 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
|
3149 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
|
3150 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
|
3151 #endif |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
3152 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3153 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
|
3154 "borderwidth", "BorderWidth", number); |
3923
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3155 /* 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
|
3156 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
|
3157 it). */ |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3158 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
|
3159 { |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3160 Lisp_Object value; |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3161 |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3162 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
|
3163 "internalBorder", "BorderWidth", number); |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3164 if (! EQ (value, Qunbound)) |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3165 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
|
3166 parms); |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3167 } |
1786
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, 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
|
3169 "internalBorderWidth", "BorderWidth", number); |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3170 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
|
3171 "verticalScrollBars", "ScrollBars", boolean); |
389 | 3172 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3173 /* 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
|
3174 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
|
3175 "foreground", "Foreground", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3176 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
|
3177 "background", "Background", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3178 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
|
3179 "pointerColor", "Foreground", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3180 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
|
3181 "cursorColor", "Foreground", string); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3182 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
|
3183 "borderColor", "BorderColor", string); |
389 | 3184 |
8758
fac1c4722677
(Fx_create_frame): Make 1 the default for menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
8675
diff
changeset
|
3185 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
|
3186 "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
|
3187 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
|
3188 "scrollBarWidth", "ScrollBarWidth", number); |
13083
16638ebb209f
(Fx_create_frame): Set up buffer-predicate slot.
Richard M. Stallman <rms@gnu.org>
parents:
12832
diff
changeset
|
3189 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
|
3190 "bufferPredicate", "BufferPredicate", symbol); |
14381 | 3191 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
|
3192 "title", "Title", string); |
6882
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3193 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3194 f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; |
771 | 3195 window_prompting = x_figure_window_size (f, parms); |
3196 | |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3197 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
|
3198 { |
7261
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3199 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
|
3200 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
|
3201 else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3202 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
|
3203 } |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3204 else |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3205 { |
a752899939f7
(x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents:
7251
diff
changeset
|
3206 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
|
3207 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
|
3208 else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3209 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
|
3210 } |
675e4ec5f14f
(Fx_create_frame): Delete excess args to x_wm_set_size_hint.
Richard M. Stallman <rms@gnu.org>
parents:
6882
diff
changeset
|
3211 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3212 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
|
3213 |
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
|
3214 #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
|
3215 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
|
3216 #else |
771 | 3217 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
|
3218 #endif |
771 | 3219 x_icon (f, parms); |
3220 x_make_gc (f); | |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
3221 init_frame_faces (f); |
771 | 3222 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3223 /* 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
|
3224 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
|
3225 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
|
3226 "bitmapIcon", "BitmapIcon", symbol); |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3227 |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3228 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
|
3229 "autoRaise", "AutoRaiseLower", boolean); |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3230 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
|
3231 "autoLower", "AutoRaiseLower", boolean); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3232 x_default_parameter (f, parms, Qcursor_type, Qbox, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3233 "cursorType", "CursorType", symbol); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3234 |
771 | 3235 /* Dimensions, especially f->height, must be done via change_frame_size. |
389 | 3236 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
|
3237 f->height. */ |
771 | 3238 width = f->width; |
3239 height = f->height; | |
3240 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
|
3241 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
|
3242 |
11707
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
3243 /* 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
|
3244 and how badly we want them. */ |
389 | 3245 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
|
3246 x_wm_set_size_hint (f, window_prompting, 0); |
389 | 3247 UNBLOCK_INPUT; |
3248 | |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3249 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean); |
771 | 3250 f->no_split = minibuffer_only || EQ (tem, Qt); |
389 | 3251 |
8103
b0d56b9856c4
(Fx_create_frame): Add GC protection for local var `f'.
Paul Reilly <pmr@pajato.com>
parents:
8091
diff
changeset
|
3252 UNGCPRO; |
b0d56b9856c4
(Fx_create_frame): Add GC protection for local var `f'.
Paul Reilly <pmr@pajato.com>
parents:
8091
diff
changeset
|
3253 |
5429
87c67c389867
(Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents:
5229
diff
changeset
|
3254 /* 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
|
3255 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
|
3256 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
|
3257 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
|
3258 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
|
3259 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3260 /* 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
|
3261 its display. */ |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3262 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
|
3263 |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
3264 /* 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
|
3265 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
|
3266 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
|
3267 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
|
3268 { |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3269 Lisp_Object visibility; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3270 |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3271 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
|
3272 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
|
3273 visibility = Qt; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3274 |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3275 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
|
3276 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
|
3277 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
|
3278 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
|
3279 else |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3280 /* 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
|
3281 ; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3282 } |
771 | 3283 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3284 return unbind_to (count, frame); |
389 | 3285 } |
3286 | |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3287 /* 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
|
3288 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
|
3289 know about that structure. */ |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3290 Lisp_Object |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3291 x_get_focus_frame (frame) |
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3292 struct frame *frame; |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3293 { |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3294 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
|
3295 Lisp_Object xfocus; |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3296 if (! dpyinfo->x_focus_frame) |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3297 return Qnil; |
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3298 |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3299 XSETFRAME (xfocus, dpyinfo->x_focus_frame); |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3300 return xfocus; |
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3301 } |
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3302 |
771 | 3303 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
|
3304 "This function is obsolete, and does nothing.") |
771 | 3305 (frame) |
3306 Lisp_Object frame; | |
389 | 3307 { |
3308 return Qnil; | |
3309 } | |
3310 | |
771 | 3311 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
|
3312 "This function is obsolete, and does nothing.") |
389 | 3313 () |
3314 { | |
3315 return Qnil; | |
3316 } | |
3317 | |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3318 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
|
3319 "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
|
3320 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
|
3321 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
|
3322 \n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3323 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
|
3324 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
|
3325 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
|
3326 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
|
3327 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
|
3328 \n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3329 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
|
3330 set-face-font.\n\ |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3331 \n\ |
6783
3122395ded44
(Fx_list_fonts): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
6770
diff
changeset
|
3332 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
|
3333 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
|
3334 (pattern, face, frame) |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3335 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
|
3336 { |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3337 int num_fonts; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3338 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
|
3339 #ifndef BROKEN_XLISTFONTSWITHINFO |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3340 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
|
3341 #endif |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3342 XFontStruct *size_ref; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3343 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
|
3344 FRAME_PTR f; |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3345 |
5948 | 3346 check_x (); |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3347 CHECK_STRING (pattern, 0); |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3348 if (!NILP (face)) |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3349 CHECK_SYMBOL (face, 1); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3350 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3351 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
|
3352 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3353 /* 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
|
3354 |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3355 if (NILP (face)) |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3356 size_ref = 0; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3357 else |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3358 { |
6882
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3359 int face_id; |
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3360 |
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3361 /* 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
|
3362 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
|
3363 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
|
3364 |
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3365 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
|
3366 |
3881
9d92b383b584
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3821
diff
changeset
|
3367 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
|
3368 || 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
|
3369 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
|
3370 else |
53c89f73e85a
(Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents:
3339
diff
changeset
|
3371 { |
3881
9d92b383b584
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3821
diff
changeset
|
3372 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
|
3373 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
|
3374 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
|
3375 } |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3376 } |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3377 |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3378 /* 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
|
3379 list = Fassoc (pattern, |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3380 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
|
3381 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3382 /* 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
|
3383 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
|
3384 { |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3385 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
|
3386 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3387 /* 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
|
3388 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
|
3389 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3390 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
|
3391 return list; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3392 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3393 BLOCK_INPUT; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3394 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3395 /* 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
|
3396 newlist = Qnil; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3397 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
|
3398 { |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3399 XFontStruct *thisinfo; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3400 |
14979
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3401 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
|
3402 |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3403 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
|
3404 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
|
3405 |
14979
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3406 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
|
3407 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
|
3408 |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3409 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
|
3410 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
|
3411 |
12546
f4fb791df099
(Fx_list_fonts): Don't free thisinfo if it is 0.
Karl Heuer <kwzh@gnu.org>
parents:
12470
diff
changeset
|
3412 if (thisinfo != 0) |
f4fb791df099
(Fx_list_fonts): Don't free thisinfo if it is 0.
Karl Heuer <kwzh@gnu.org>
parents:
12470
diff
changeset
|
3413 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
|
3414 } |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3415 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3416 UNBLOCK_INPUT; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3417 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3418 return newlist; |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3419 } |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3420 |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3421 BLOCK_INPUT; |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3422 |
14979
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3423 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
|
3424 |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3425 /* 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
|
3426 #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
|
3427 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
|
3428 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
|
3429 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
|
3430 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
|
3431 &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
|
3432 &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
|
3433 else |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3434 #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
|
3435 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
|
3436 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
|
3437 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
|
3438 &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
|
3439 |
14979
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3440 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
|
3441 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
|
3442 |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3443 UNBLOCK_INPUT; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3444 |
3640
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3445 list = Qnil; |
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3446 |
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3447 if (names) |
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3448 { |
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3449 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
|
3450 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
|
3451 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3452 /* 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
|
3453 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
|
3454 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
|
3455 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
|
3456 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
|
3457 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
|
3458 = 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
|
3459 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
|
3460 |
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3461 /* 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
|
3462 list = Qnil; |
3640
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3463 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
|
3464 { |
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 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
|
3466 |
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
|
3467 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
|
3468 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
|
3469 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
|
3470 { |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3471 #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
|
3472 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
|
3473 |
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 BLOCK_INPUT; |
14979
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3475 |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3476 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
|
3477 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
|
3478 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
|
3479 "XLoadQueryFont failure: %s"); |
fc1c21bc2e05
(Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents:
14965
diff
changeset
|
3480 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
|
3481 |
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
|
3482 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
|
3483 |
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 keeper = thisinfo && same_size_fonts (thisinfo, size_ref); |
15071
2ae4beb73bf5
(Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents:
15022
diff
changeset
|
3485 BLOCK_INPUT; |
2ae4beb73bf5
(Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents:
15022
diff
changeset
|
3486 if (thisinfo && ! keeper) |
2ae4beb73bf5
(Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents:
15022
diff
changeset
|
3487 XFreeFont (FRAME_X_DISPLAY (f), thisinfo); |
2ae4beb73bf5
(Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents:
15022
diff
changeset
|
3488 else if (thisinfo) |
2ae4beb73bf5
(Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents:
15022
diff
changeset
|
3489 XFreeFontInfo (NULL, thisinfo, 1); |
2ae4beb73bf5
(Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents:
15022
diff
changeset
|
3490 UNBLOCK_INPUT; |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3491 #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
|
3492 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
|
3493 #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
|
3494 } |
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
|
3495 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
|
3496 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
|
3497 } |
9014
7b805f79f3b4
(Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents:
8961
diff
changeset
|
3498 list = Fnreverse (list); |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3499 |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3500 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
|
3501 #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
|
3502 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
|
3503 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
|
3504 else |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3505 #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
|
3506 XFreeFontNames (names); |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
3507 UNBLOCK_INPUT; |
3640
df1a2751ca24
(Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3508 } |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3509 |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3510 return list; |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3511 } |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3512 |
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3513 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3514 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
|
3515 "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
|
3516 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
|
3517 (color, frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3518 Lisp_Object color, frame; |
389 | 3519 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3520 XColor foo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3521 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
|
3522 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3523 CHECK_STRING (color, 1); |
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 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
|
3526 return Qt; |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3527 else |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3528 return Qnil; |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3529 } |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3530 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3531 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
|
3532 "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
|
3533 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
|
3534 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
|
3535 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
|
3536 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
|
3537 (color, frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3538 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
|
3539 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3540 XColor foo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3541 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
|
3542 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3543 CHECK_STRING (color, 1); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3544 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3545 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
|
3546 { |
4c69fcaaa037
(Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents:
8405
diff
changeset
|
3547 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
|
3548 |
4c69fcaaa037
(Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents:
8405
diff
changeset
|
3549 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
|
3550 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
|
3551 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
|
3552 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
|
3553 } |
389 | 3554 else |
3555 return Qnil; | |
3556 } | |
3557 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3558 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
|
3559 "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
|
3560 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
|
3561 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
|
3562 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
|
3563 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3564 Lisp_Object display; |
389 | 3565 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3566 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
|
3567 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3568 if (dpyinfo->n_planes <= 2) |
389 | 3569 return Qnil; |
3570 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3571 switch (dpyinfo->visual->class) |
389 | 3572 { |
3573 case StaticColor: | |
3574 case PseudoColor: | |
3575 case TrueColor: | |
3576 case DirectColor: | |
3577 return Qt; | |
3578 | |
3579 default: | |
3580 return Qnil; | |
3581 } | |
3582 } | |
3583 | |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3584 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
|
3585 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3586 "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
|
3587 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
|
3588 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
|
3589 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
|
3590 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
|
3591 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3592 Lisp_Object display; |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3593 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3594 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
|
3595 |
12347
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3596 if (dpyinfo->n_planes <= 1) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3597 return Qnil; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3598 |
12347
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3599 switch (dpyinfo->visual->class) |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3600 { |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3601 case StaticColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3602 case PseudoColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3603 case TrueColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3604 case DirectColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3605 case StaticGray: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3606 case GrayScale: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3607 return Qt; |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3608 |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3609 default: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3610 return Qnil; |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3611 } |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3612 } |
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3613 |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3614 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
|
3615 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3616 "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
|
3617 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
|
3618 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
|
3619 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
|
3620 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3621 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3622 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3623 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
|
3624 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3625 return make_number (dpyinfo->width); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3626 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3627 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3628 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
|
3629 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
|
3630 "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
|
3631 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
|
3632 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
|
3633 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
|
3634 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3635 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3636 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3637 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
|
3638 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3639 return make_number (dpyinfo->height); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3640 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3641 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3642 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
|
3643 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3644 "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
|
3645 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
|
3646 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
|
3647 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
|
3648 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3649 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3650 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3651 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
|
3652 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3653 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
|
3654 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3655 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3656 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
|
3657 0, 1, 0, |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3658 "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
|
3659 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
|
3660 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
|
3661 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
|
3662 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3663 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3664 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3665 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
|
3666 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3667 return make_number (DisplayCells (dpyinfo->display, |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3668 XScreenNumberOfScreen (dpyinfo->screen))); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3669 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3670 |
4279 | 3671 DEFUN ("x-server-max-request-size", Fx_server_max_request_size, |
3672 Sx_server_max_request_size, | |
3673 0, 1, 0, | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3674 "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
|
3675 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
|
3676 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
|
3677 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
|
3678 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3679 Lisp_Object display; |
4279 | 3680 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3681 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
|
3682 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3683 return make_number (MAXREQUEST (dpyinfo->display)); |
4279 | 3684 } |
3685 | |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3686 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
|
3687 "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
|
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 char *vendor = ServerVendor (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 if (! vendor) vendor = ""; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3698 return build_string (vendor); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3699 } |
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 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
|
3702 "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
|
3703 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
|
3704 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
|
3705 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
|
3706 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
|
3707 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
|
3708 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
|
3709 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3710 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3711 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3712 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
|
3713 Display *dpy = dpyinfo->display; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3714 |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3715 return Fcons (make_number (ProtocolVersion (dpy)), |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3716 Fcons (make_number (ProtocolRevision (dpy)), |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3717 Fcons (make_number (VendorRelease (dpy)), Qnil))); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3718 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3719 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3720 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
|
3721 "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
|
3722 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
|
3723 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
|
3724 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
|
3725 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3726 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3727 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3728 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
|
3729 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3730 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
|
3731 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3732 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3733 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
|
3734 "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
|
3735 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
|
3736 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
|
3737 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
|
3738 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3739 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3740 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3741 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
|
3742 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3743 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
|
3744 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3745 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3746 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
|
3747 "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
|
3748 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
|
3749 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
|
3750 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
|
3751 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3752 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3753 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3754 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
|
3755 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3756 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
|
3757 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3758 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3759 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
|
3760 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
|
3761 "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
|
3762 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
|
3763 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
|
3764 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
|
3765 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
|
3766 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3767 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3768 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3769 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
|
3770 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3771 switch (DoesBackingStore (dpyinfo->screen)) |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3772 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3773 case Always: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3774 return intern ("always"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3775 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3776 case WhenMapped: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3777 return intern ("when-mapped"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3778 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3779 case NotUseful: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3780 return intern ("not-useful"); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3781 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3782 default: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3783 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
|
3784 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3785 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3786 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3787 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
|
3788 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
|
3789 "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
|
3790 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
|
3791 `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
|
3792 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
|
3793 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
|
3794 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
|
3795 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3796 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3797 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3798 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
|
3799 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3800 switch (dpyinfo->visual->class) |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3801 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3802 case StaticGray: return (intern ("static-gray")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3803 case GrayScale: return (intern ("gray-scale")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3804 case StaticColor: return (intern ("static-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3805 case PseudoColor: return (intern ("pseudo-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3806 case TrueColor: return (intern ("true-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3807 case DirectColor: return (intern ("direct-color")); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3808 default: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3809 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
|
3810 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3811 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3812 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3813 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
|
3814 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
|
3815 "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
|
3816 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
|
3817 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
|
3818 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
|
3819 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3820 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3821 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3822 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
|
3823 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3824 if (DoesSaveUnders (dpyinfo->screen) == True) |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3825 return Qt; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3826 else |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3827 return Qnil; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3828 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3829 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3830 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3831 x_pixel_width (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3832 register struct frame *f; |
389 | 3833 { |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3834 return PIXEL_WIDTH (f); |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3835 } |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3836 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3837 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3838 x_pixel_height (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3839 register struct frame *f; |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3840 { |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3841 return PIXEL_HEIGHT (f); |
389 | 3842 } |
3843 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3844 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3845 x_char_width (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3846 register struct frame *f; |
389 | 3847 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3848 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
|
3849 } |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3850 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3851 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3852 x_char_height (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3853 register struct frame *f; |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3854 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3855 return f->output_data.x->line_height; |
389 | 3856 } |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3857 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3858 int |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3859 x_screen_planes (frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3860 Lisp_Object frame; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3861 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3862 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
|
3863 } |
389 | 3864 |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
3865 #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
|
3866 |
771 | 3867 /* Draw a rectangle on the frame with left top corner including |
389 | 3868 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
|
3869 CHARS by LINES wide and long and is the color of the cursor. */ |
389 | 3870 |
3871 void | |
771 | 3872 x_rectangle (f, gc, left_char, top_char, chars, lines) |
3873 register struct frame *f; | |
389 | 3874 GC gc; |
3875 register int top_char, left_char, chars, lines; | |
3876 { | |
3877 int width; | |
3878 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
|
3879 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
|
3880 + 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
|
3881 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
|
3882 + f->output_data.x->internal_border_width); |
389 | 3883 |
3884 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
|
3885 width = FONT_WIDTH (f->output_data.x->font) / 2; |
389 | 3886 else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3887 width = FONT_WIDTH (f->output_data.x->font) * chars; |
389 | 3888 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
|
3889 height = f->output_data.x->line_height / 2; |
389 | 3890 else |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3891 height = f->output_data.x->line_height * lines; |
771 | 3892 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3893 XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 3894 gc, left, top, width, height); |
3895 } | |
3896 | |
3897 DEFUN ("x-draw-rectangle", Fx_draw_rectangle, Sx_draw_rectangle, 5, 5, 0, | |
771 | 3898 "Draw a rectangle on FRAME between coordinates specified by\n\ |
389 | 3899 numbers X0, Y0, X1, Y1 in the cursor pixel.") |
771 | 3900 (frame, X0, Y0, X1, Y1) |
3901 register Lisp_Object frame, X0, X1, Y0, Y1; | |
389 | 3902 { |
3903 register int x0, y0, x1, y1, top, left, n_chars, n_lines; | |
3904 | |
771 | 3905 CHECK_LIVE_FRAME (frame, 0); |
389 | 3906 CHECK_NUMBER (X0, 0); |
3907 CHECK_NUMBER (Y0, 1); | |
3908 CHECK_NUMBER (X1, 2); | |
3909 CHECK_NUMBER (Y1, 3); | |
3910 | |
3911 x0 = XINT (X0); | |
3912 x1 = XINT (X1); | |
3913 y0 = XINT (Y0); | |
3914 y1 = XINT (Y1); | |
3915 | |
3916 if (y1 > y0) | |
3917 { | |
3918 top = y0; | |
3919 n_lines = y1 - y0 + 1; | |
3920 } | |
3921 else | |
3922 { | |
3923 top = y1; | |
3924 n_lines = y0 - y1 + 1; | |
3925 } | |
3926 | |
3927 if (x1 > x0) | |
3928 { | |
3929 left = x0; | |
3930 n_chars = x1 - x0 + 1; | |
3931 } | |
3932 else | |
3933 { | |
3934 left = x1; | |
3935 n_chars = x0 - x1 + 1; | |
3936 } | |
3937 | |
3938 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
|
3939 x_rectangle (XFRAME (frame), XFRAME (frame)->output_data.x->cursor_gc, |
389 | 3940 left, top, n_chars, n_lines); |
3941 UNBLOCK_INPUT; | |
3942 | |
3943 return Qt; | |
3944 } | |
3945 | |
3946 DEFUN ("x-erase-rectangle", Fx_erase_rectangle, Sx_erase_rectangle, 5, 5, 0, | |
771 | 3947 "Draw a rectangle drawn on FRAME between coordinates\n\ |
389 | 3948 X0, Y0, X1, Y1 in the regular background-pixel.") |
771 | 3949 (frame, X0, Y0, X1, Y1) |
3950 register Lisp_Object frame, X0, Y0, X1, Y1; | |
389 | 3951 { |
3952 register int x0, y0, x1, y1, top, left, n_chars, n_lines; | |
3953 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3954 CHECK_LIVE_FRAME (frame, 0); |
389 | 3955 CHECK_NUMBER (X0, 0); |
3956 CHECK_NUMBER (Y0, 1); | |
3957 CHECK_NUMBER (X1, 2); | |
3958 CHECK_NUMBER (Y1, 3); | |
3959 | |
3960 x0 = XINT (X0); | |
3961 x1 = XINT (X1); | |
3962 y0 = XINT (Y0); | |
3963 y1 = XINT (Y1); | |
3964 | |
3965 if (y1 > y0) | |
3966 { | |
3967 top = y0; | |
3968 n_lines = y1 - y0 + 1; | |
3969 } | |
3970 else | |
3971 { | |
3972 top = y1; | |
3973 n_lines = y0 - y1 + 1; | |
3974 } | |
3975 | |
3976 if (x1 > x0) | |
3977 { | |
3978 left = x0; | |
3979 n_chars = x1 - x0 + 1; | |
3980 } | |
3981 else | |
3982 { | |
3983 left = x1; | |
3984 n_chars = x0 - x1 + 1; | |
3985 } | |
3986 | |
3987 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
|
3988 x_rectangle (XFRAME (frame), XFRAME (frame)->output_data.x->reverse_gc, |
389 | 3989 left, top, n_chars, n_lines); |
3990 UNBLOCK_INPUT; | |
3991 | |
3992 return Qt; | |
3993 } | |
3994 | |
3995 /* Draw lines around the text region beginning at the character position | |
3996 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
|
3997 pixel and line characteristics. */ |
389 | 3998 |
771 | 3999 #define line_len(line) (FRAME_CURRENT_GLYPHS (f)->used[(line)]) |
389 | 4000 |
4001 static void | |
771 | 4002 outline_region (f, gc, top_x, top_y, bottom_x, bottom_y) |
4003 register struct frame *f; | |
389 | 4004 GC gc; |
4005 int top_x, top_y, bottom_x, bottom_y; | |
4006 { | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4007 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
|
4008 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
|
4009 register int font_h = f->output_data.x->line_height; |
389 | 4010 int y = top_y; |
4011 int x = line_len (y); | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
4012 XPoint *pixel_points |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
4013 = (XPoint *) alloca (((bottom_y - top_y + 2) * 4) * sizeof (XPoint)); |
389 | 4014 register XPoint *this_point = pixel_points; |
4015 | |
4016 /* Do the horizontal top line/lines */ | |
4017 if (top_x == 0) | |
4018 { | |
4019 this_point->x = ibw; | |
4020 this_point->y = ibw + (font_h * top_y); | |
4021 this_point++; | |
4022 if (x == 0) | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4023 this_point->x = ibw + (font_w / 2); /* Half-size for newline chars. */ |
389 | 4024 else |
4025 this_point->x = ibw + (font_w * x); | |
4026 this_point->y = (this_point - 1)->y; | |
4027 } | |
4028 else | |
4029 { | |
4030 this_point->x = ibw; | |
4031 this_point->y = ibw + (font_h * (top_y + 1)); | |
4032 this_point++; | |
4033 this_point->x = ibw + (font_w * top_x); | |
4034 this_point->y = (this_point - 1)->y; | |
4035 this_point++; | |
4036 this_point->x = (this_point - 1)->x; | |
4037 this_point->y = ibw + (font_h * top_y); | |
4038 this_point++; | |
4039 this_point->x = ibw + (font_w * x); | |
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 right side. */ |
389 | 4044 while (y < bottom_y) |
4045 { /* Right vertical edge */ | |
4046 this_point++; | |
4047 this_point->x = (this_point - 1)->x; | |
4048 this_point->y = ibw + (font_h * (y + 1)); | |
4049 this_point++; | |
4050 | |
4051 y++; /* Horizontal connection to next line */ | |
4052 x = line_len (y); | |
4053 if (x == 0) | |
4054 this_point->x = ibw + (font_w / 2); | |
4055 else | |
4056 this_point->x = ibw + (font_w * x); | |
4057 | |
4058 this_point->y = (this_point - 1)->y; | |
4059 } | |
4060 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4061 /* Now do the bottom and connect to the top left point. */ |
389 | 4062 this_point->x = ibw + (font_w * (bottom_x + 1)); |
4063 | |
4064 this_point++; | |
4065 this_point->x = (this_point - 1)->x; | |
4066 this_point->y = ibw + (font_h * (bottom_y + 1)); | |
4067 this_point++; | |
4068 this_point->x = ibw; | |
4069 this_point->y = (this_point - 1)->y; | |
4070 this_point++; | |
4071 this_point->x = pixel_points->x; | |
4072 this_point->y = pixel_points->y; | |
4073 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4074 XDrawLines (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4075 gc, pixel_points, |
4076 (this_point - pixel_points + 1), CoordModeOrigin); | |
4077 } | |
4078 | |
4079 DEFUN ("x-contour-region", Fx_contour_region, Sx_contour_region, 1, 1, 0, | |
4080 "Highlight the region between point and the character under the mouse\n\ | |
771 | 4081 selected frame.") |
389 | 4082 (event) |
4083 register Lisp_Object event; | |
4084 { | |
4085 register int x0, y0, x1, y1; | |
771 | 4086 register struct frame *f = selected_frame; |
389 | 4087 register int p1, p2; |
4088 | |
4089 CHECK_CONS (event, 0); | |
4090 | |
4091 BLOCK_INPUT; | |
4092 x0 = XINT (Fcar (Fcar (event))); | |
4093 y0 = XINT (Fcar (Fcdr (Fcar (event)))); | |
4094 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4095 /* 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
|
4096 /* ReWrite this... */ |
389 | 4097 |
771 | 4098 x1 = f->cursor_x; |
4099 y1 = f->cursor_y; | |
389 | 4100 |
4101 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
|
4102 outline_region (f, f->output_data.x->cursor_gc, |
389 | 4103 x0, y0, x1, y1); |
4104 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
|
4105 outline_region (f, f->output_data.x->cursor_gc, |
389 | 4106 x1, y1, x0, y0); |
4107 else /* same line: draw horizontal rectangle */ | |
4108 { | |
4109 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
|
4110 x_rectangle (f, f->output_data.x->cursor_gc, |
389 | 4111 x0, y0, (x1 - x0 + 1), 1); |
4112 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
|
4113 x_rectangle (f, f->output_data.x->cursor_gc, |
389 | 4114 x1, y1, (x0 - x1 + 1), 1); |
4115 } | |
4116 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4117 XFlush (FRAME_X_DISPLAY (f)); |
389 | 4118 UNBLOCK_INPUT; |
4119 | |
4120 return Qnil; | |
4121 } | |
4122 | |
4123 DEFUN ("x-uncontour-region", Fx_uncontour_region, Sx_uncontour_region, 1, 1, 0, | |
4124 "Erase any highlighting of the region between point and the character\n\ | |
771 | 4125 at X, Y on the selected frame.") |
389 | 4126 (event) |
4127 register Lisp_Object event; | |
4128 { | |
4129 register int x0, y0, x1, y1; | |
771 | 4130 register struct frame *f = selected_frame; |
389 | 4131 |
4132 BLOCK_INPUT; | |
4133 x0 = XINT (Fcar (Fcar (event))); | |
4134 y0 = XINT (Fcar (Fcdr (Fcar (event)))); | |
771 | 4135 x1 = f->cursor_x; |
4136 y1 = f->cursor_y; | |
389 | 4137 |
4138 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
|
4139 outline_region (f, f->output_data.x->reverse_gc, |
389 | 4140 x0, y0, x1, y1); |
4141 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
|
4142 outline_region (f, f->output_data.x->reverse_gc, |
389 | 4143 x1, y1, x0, y0); |
4144 else /* same line: draw horizontal rectangle */ | |
4145 { | |
4146 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
|
4147 x_rectangle (f, f->output_data.x->reverse_gc, |
389 | 4148 x0, y0, (x1 - x0 + 1), 1); |
4149 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
|
4150 x_rectangle (f, f->output_data.x->reverse_gc, |
389 | 4151 x1, y1, (x0 - x1 + 1), 1); |
4152 } | |
4153 UNBLOCK_INPUT; | |
4154 | |
4155 return Qnil; | |
4156 } | |
4157 | |
4158 #if 0 | |
4159 int contour_begin_x, contour_begin_y; | |
4160 int contour_end_x, contour_end_y; | |
4161 int contour_npoints; | |
4162 | |
4163 /* Clip the top part of the contour lines down (and including) line Y_POS. | |
4164 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
|
4165 down a line at that character. */ |
389 | 4166 |
4167 static void | |
4168 clip_contour_top (y_pos, x_pos) | |
4169 { | |
4170 register XPoint *begin = contour_lines[y_pos].top_left; | |
4171 register XPoint *end; | |
4172 register int npoints; | |
771 | 4173 register struct display_line *line = selected_frame->phys_lines[y_pos + 1]; |
389 | 4174 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4175 if (x_pos >= line->len - 1) /* Draw one, straight horizontal line. */ |
389 | 4176 { |
4177 end = contour_lines[y_pos].top_right; | |
4178 npoints = (end - begin + 1); | |
4179 XDrawLines (x_current_display, contour_window, | |
4180 contour_erase_gc, begin_erase, npoints, CoordModeOrigin); | |
4181 | |
4182 bcopy (end, begin + 1, contour_last_point - end + 1); | |
4183 contour_last_point -= (npoints - 2); | |
4184 XDrawLines (x_current_display, contour_window, | |
4185 contour_erase_gc, begin, 2, CoordModeOrigin); | |
4186 XFlush (x_current_display); | |
4187 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4188 /* Now, update contour_lines structure. */ |
389 | 4189 } |
4190 /* ______. */ | |
4191 else /* |________*/ | |
4192 { | |
4193 register XPoint *p = begin + 1; | |
4194 end = contour_lines[y_pos].bottom_right; | |
4195 npoints = (end - begin + 1); | |
4196 XDrawLines (x_current_display, contour_window, | |
4197 contour_erase_gc, begin_erase, npoints, CoordModeOrigin); | |
4198 | |
4199 p->y = begin->y; | |
4200 p->x = ibw + (font_w * (x_pos + 1)); | |
4201 p++; | |
4202 p->y = begin->y + font_h; | |
4203 p->x = (p - 1)->x; | |
4204 bcopy (end, begin + 3, contour_last_point - end + 1); | |
4205 contour_last_point -= (npoints - 5); | |
4206 XDrawLines (x_current_display, contour_window, | |
4207 contour_erase_gc, begin, 4, CoordModeOrigin); | |
4208 XFlush (x_current_display); | |
4209 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4210 /* Now, update contour_lines structure. */ |
389 | 4211 } |
4212 } | |
4213 | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3512
diff
changeset
|
4214 /* 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
|
4215 the contour upwards. */ |
389 | 4216 |
4217 static void | |
4218 extend_contour_top (line) | |
4219 { | |
4220 } | |
4221 | |
4222 static void | |
4223 clip_contour_bottom (x_pos, y_pos) | |
4224 int x_pos, y_pos; | |
4225 { | |
4226 } | |
4227 | |
4228 static void | |
4229 extend_contour_bottom (x_pos, y_pos) | |
4230 { | |
4231 } | |
4232 | |
4233 DEFUN ("x-select-region", Fx_select_region, Sx_select_region, 1, 1, "e", | |
4234 "") | |
4235 (event) | |
4236 Lisp_Object event; | |
4237 { | |
771 | 4238 register struct frame *f = selected_frame; |
4239 register int point_x = f->cursor_x; | |
4240 register int point_y = f->cursor_y; | |
389 | 4241 register int mouse_below_point; |
4242 register Lisp_Object obj; | |
4243 register int x_contour_x, x_contour_y; | |
4244 | |
4245 x_contour_x = x_mouse_x; | |
4246 x_contour_y = x_mouse_y; | |
4247 if (x_contour_y > point_y || (x_contour_y == point_y | |
4248 && x_contour_x > point_x)) | |
4249 { | |
4250 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
|
4251 outline_region (f, f->output_data.x->cursor_gc, point_x, point_y, |
389 | 4252 x_contour_x, x_contour_y); |
4253 } | |
4254 else | |
4255 { | |
4256 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
|
4257 outline_region (f, f->output_data.x->cursor_gc, x_contour_x, x_contour_y, |
389 | 4258 point_x, point_y); |
4259 } | |
4260 | |
4261 while (1) | |
4262 { | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
4263 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
|
4264 if (!CONSP (obj)) |
389 | 4265 break; |
4266 | |
4267 if (mouse_below_point) | |
4268 { | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4269 if (x_mouse_y <= point_y) /* Flipped. */ |
389 | 4270 { |
4271 mouse_below_point = 0; | |
4272 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4273 outline_region (f, f->output_data.x->reverse_gc, point_x, point_y, |
389 | 4274 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
|
4275 outline_region (f, f->output_data.x->cursor_gc, x_mouse_x, x_mouse_y, |
389 | 4276 point_x, point_y); |
4277 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4278 else if (x_mouse_y < x_contour_y) /* Bottom clipped. */ |
389 | 4279 { |
4280 clip_contour_bottom (x_mouse_y); | |
4281 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4282 else if (x_mouse_y > x_contour_y) /* Bottom extended. */ |
389 | 4283 { |
4284 extend_bottom_contour (x_mouse_y); | |
4285 } | |
4286 | |
4287 x_contour_x = x_mouse_x; | |
4288 x_contour_y = x_mouse_y; | |
4289 } | |
4290 else /* mouse above or same line as point */ | |
4291 { | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4292 if (x_mouse_y >= point_y) /* Flipped. */ |
389 | 4293 { |
4294 mouse_below_point = 1; | |
4295 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4296 outline_region (f, f->output_data.x->reverse_gc, |
389 | 4297 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
|
4298 outline_region (f, f->output_data.x->cursor_gc, point_x, point_y, |
389 | 4299 x_mouse_x, x_mouse_y); |
4300 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4301 else if (x_mouse_y > x_contour_y) /* Top clipped. */ |
389 | 4302 { |
4303 clip_contour_top (x_mouse_y); | |
4304 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4305 else if (x_mouse_y < x_contour_y) /* Top extended. */ |
389 | 4306 { |
4307 extend_contour_top (x_mouse_y); | |
4308 } | |
4309 } | |
4310 } | |
4311 | |
1601
a371ec79bc31
* xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents:
1528
diff
changeset
|
4312 unread_command_event = obj; |
389 | 4313 if (mouse_below_point) |
4314 { | |
4315 contour_begin_x = point_x; | |
4316 contour_begin_y = point_y; | |
4317 contour_end_x = x_contour_x; | |
4318 contour_end_y = x_contour_y; | |
4319 } | |
4320 else | |
4321 { | |
4322 contour_begin_x = x_contour_x; | |
4323 contour_begin_y = x_contour_y; | |
4324 contour_end_x = point_x; | |
4325 contour_end_y = point_y; | |
4326 } | |
4327 } | |
4328 #endif | |
4329 | |
4330 DEFUN ("x-horizontal-line", Fx_horizontal_line, Sx_horizontal_line, 1, 1, "e", | |
4331 "") | |
4332 (event) | |
4333 Lisp_Object event; | |
4334 { | |
4335 register Lisp_Object obj; | |
771 | 4336 struct frame *f = selected_frame; |
389 | 4337 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
|
4338 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
|
4339 register GC erase_gc = f->output_data.x->reverse_gc; |
389 | 4340 #if 0 |
4341 char dash_list[] = {6, 4, 6, 4}; | |
4342 int dashes = 4; | |
4343 XGCValues gc_values; | |
4344 #endif | |
4345 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
|
4346 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
|
4347 + 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
|
4348 register int left = f->output_data.x->internal_border_width |
389 | 4349 + (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
|
4350 * FONT_WIDTH (f->output_data.x->font)); |
389 | 4351 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
|
4352 * 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
|
4353 - f->output_data.x->internal_border_width; |
389 | 4354 |
4355 #if 0 | |
4356 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
|
4357 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
|
4358 gc_values.background = f->output_data.x->background_pixel; |
389 | 4359 gc_values.line_width = 1; |
4360 gc_values.line_style = LineOnOffDash; | |
4361 gc_values.cap_style = CapRound; | |
4362 gc_values.join_style = JoinRound; | |
4363 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4364 line_gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4365 GCLineStyle | GCJoinStyle | GCCapStyle |
4366 | GCLineWidth | GCForeground | GCBackground, | |
4367 &gc_values); | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4368 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
|
4369 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
|
4370 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
|
4371 erase_gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4372 GCLineStyle | GCJoinStyle | GCCapStyle |
4373 | GCLineWidth | GCForeground | GCBackground, | |
4374 &gc_values); | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4375 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
|
4376 UNBLOCK_INPUT; |
389 | 4377 #endif |
4378 | |
4379 while (1) | |
4380 { | |
4381 BLOCK_INPUT; | |
4382 if (x_mouse_y >= XINT (w->top) | |
4383 && x_mouse_y < XINT (w->top) + XINT (w->height) - 1) | |
4384 { | |
4385 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
|
4386 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
|
4387 + 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
|
4388 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4389 line_gc, left, line, right, line); |
4390 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4391 XFlush (FRAME_X_DISPLAY (f)); |
389 | 4392 UNBLOCK_INPUT; |
4393 | |
4394 do | |
4395 { | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
4396 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
|
4397 if (!CONSP (obj) |
389 | 4398 || (! 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
|
4399 Qvertical_scroll_bar)) |
389 | 4400 || x_mouse_grabbed) |
4401 { | |
4402 BLOCK_INPUT; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4403 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4404 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
|
4405 unread_command_event = obj; |
389 | 4406 #if 0 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4407 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
|
4408 XFreeGC (FRAME_X_DISPLAY (f), erase_gc); |
389 | 4409 #endif |
12051
f193ce9efe24
(x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents:
12046
diff
changeset
|
4410 UNBLOCK_INPUT; |
389 | 4411 return Qnil; |
4412 } | |
4413 } | |
4414 while (x_mouse_y == previous_y); | |
4415 | |
4416 BLOCK_INPUT; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4417 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 4418 erase_gc, left, line, right, line); |
4419 UNBLOCK_INPUT; | |
4420 } | |
4421 } | |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
4422 #endif |
389 | 4423 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4424 #if 0 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4425 /* 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
|
4426 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
|
4427 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4428 /* Offset in buffer of character under the pointer, or 0. */ |
389 | 4429 int mouse_buffer_offset; |
4430 | |
4431 DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 0, 0, 0, | |
4432 "Track the pointer.") | |
4433 () | |
4434 { | |
4435 static Cursor current_pointer_shape; | |
771 | 4436 FRAME_PTR f = x_mouse_frame; |
389 | 4437 |
4438 BLOCK_INPUT; | |
771 | 4439 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
|
4440 && (current_pointer_shape != f->output_data.x->nontext_cursor)) |
389 | 4441 { |
4442 unsigned char c; | |
4443 struct buffer *buf; | |
4444 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4445 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
|
4446 XDefineCursor (FRAME_X_DISPLAY (f), |
1050
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
4447 FRAME_X_WINDOW (f), |
389 | 4448 current_pointer_shape); |
4449 | |
4450 buf = XBUFFER (XWINDOW (Vmouse_window)->buffer); | |
4451 c = *(BUF_CHAR_ADDRESS (buf, mouse_buffer_offset)); | |
4452 } | |
771 | 4453 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
|
4454 && (current_pointer_shape != f->output_data.x->modeline_cursor)) |
389 | 4455 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4456 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
|
4457 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
|
4458 FRAME_X_WINDOW (f), |
389 | 4459 current_pointer_shape); |
4460 } | |
4461 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4462 XFlush (FRAME_X_DISPLAY (f)); |
389 | 4463 UNBLOCK_INPUT; |
4464 } | |
4465 #endif | |
4466 | |
4467 #if 0 | |
4468 DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 1, 1, "e", | |
4469 "Draw rectangle around character under mouse pointer, if there is one.") | |
4470 (event) | |
4471 Lisp_Object event; | |
4472 { | |
4473 struct window *w = XWINDOW (Vmouse_window); | |
771 | 4474 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
389 | 4475 struct buffer *b = XBUFFER (w->buffer); |
4476 Lisp_Object obj; | |
4477 | |
4478 if (! EQ (Vmouse_window, selected_window)) | |
4479 return Qnil; | |
4480 | |
4481 if (EQ (event, Qnil)) | |
4482 { | |
4483 int x, y; | |
4484 | |
771 | 4485 x_read_mouse_position (selected_frame, &x, &y); |
389 | 4486 } |
4487 | |
4488 BLOCK_INPUT; | |
4489 mouse_track_width = 0; | |
4490 mouse_track_left = mouse_track_top = -1; | |
4491 | |
4492 do | |
4493 { | |
4494 if ((x_mouse_x != mouse_track_left | |
4495 && (x_mouse_x < mouse_track_left | |
4496 || x_mouse_x > (mouse_track_left + mouse_track_width))) | |
4497 || x_mouse_y != mouse_track_top) | |
4498 { | |
4499 int hp = 0; /* Horizontal position */ | |
771 | 4500 int len = FRAME_CURRENT_GLYPHS (f)->used[x_mouse_y]; |
4501 int p = FRAME_CURRENT_GLYPHS (f)->bufp[x_mouse_y]; | |
389 | 4502 int tab_width = XINT (b->tab_width); |
485 | 4503 int ctl_arrow_p = !NILP (b->ctl_arrow); |
389 | 4504 unsigned char c; |
4505 int mode_line_vpos = XFASTINT (w->height) + XFASTINT (w->top) - 1; | |
4506 int in_mode_line = 0; | |
4507 | |
771 | 4508 if (! FRAME_CURRENT_GLYPHS (f)->enable[x_mouse_y]) |
389 | 4509 break; |
4510 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4511 /* Erase previous rectangle. */ |
389 | 4512 if (mouse_track_width) |
4513 { | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4514 x_rectangle (f, f->output_data.x->reverse_gc, |
389 | 4515 mouse_track_left, mouse_track_top, |
4516 mouse_track_width, 1); | |
4517 | |
771 | 4518 if ((mouse_track_left == f->phys_cursor_x |
4519 || mouse_track_left == f->phys_cursor_x - 1) | |
4520 && mouse_track_top == f->phys_cursor_y) | |
389 | 4521 { |
771 | 4522 x_display_cursor (f, 1); |
389 | 4523 } |
4524 } | |
4525 | |
4526 mouse_track_left = x_mouse_x; | |
4527 mouse_track_top = x_mouse_y; | |
4528 mouse_track_width = 0; | |
4529 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4530 if (mouse_track_left > len) /* Past the end of line. */ |
389 | 4531 goto draw_or_not; |
4532 | |
4533 if (mouse_track_top == mode_line_vpos) | |
4534 { | |
4535 in_mode_line = 1; | |
4536 goto draw_or_not; | |
4537 } | |
4538 | |
4539 if (tab_width <= 0 || tab_width > 20) tab_width = 8; | |
4540 do | |
4541 { | |
4542 c = FETCH_CHAR (p); | |
771 | 4543 if (len == f->width && hp == len - 1 && c != '\n') |
389 | 4544 goto draw_or_not; |
4545 | |
4546 switch (c) | |
4547 { | |
4548 case '\t': | |
4549 mouse_track_width = tab_width - (hp % tab_width); | |
4550 p++; | |
4551 hp += mouse_track_width; | |
4552 if (hp > x_mouse_x) | |
4553 { | |
4554 mouse_track_left = hp - mouse_track_width; | |
4555 goto draw_or_not; | |
4556 } | |
4557 continue; | |
4558 | |
4559 case '\n': | |
4560 mouse_track_width = -1; | |
4561 goto draw_or_not; | |
4562 | |
4563 default: | |
4564 if (ctl_arrow_p && (c < 040 || c == 0177)) | |
4565 { | |
4566 if (p > ZV) | |
4567 goto draw_or_not; | |
4568 | |
4569 mouse_track_width = 2; | |
4570 p++; | |
4571 hp +=2; | |
4572 if (hp > x_mouse_x) | |
4573 { | |
4574 mouse_track_left = hp - mouse_track_width; | |
4575 goto draw_or_not; | |
4576 } | |
4577 } | |
4578 else | |
4579 { | |
4580 mouse_track_width = 1; | |
4581 p++; | |
4582 hp++; | |
4583 } | |
4584 continue; | |
4585 } | |
4586 } | |
4587 while (hp <= x_mouse_x); | |
4588 | |
4589 draw_or_not: | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4590 if (mouse_track_width) /* Over text; use text pointer shape. */ |
389 | 4591 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4592 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
|
4593 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
|
4594 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
|
4595 x_rectangle (f, f->output_data.x->cursor_gc, |
389 | 4596 mouse_track_left, mouse_track_top, |
4597 mouse_track_width, 1); | |
4598 } | |
4599 else if (in_mode_line) | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4600 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
|
4601 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
|
4602 f->output_data.x->modeline_cursor); |
389 | 4603 else |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4604 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
|
4605 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
|
4606 f->output_data.x->nontext_cursor); |
389 | 4607 } |
4608 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4609 XFlush (FRAME_X_DISPLAY (f)); |
389 | 4610 UNBLOCK_INPUT; |
4611 | |
1096
d79192bacdce
(Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents:
1050
diff
changeset
|
4612 obj = read_char (-1, 0, 0, Qnil, 0); |
389 | 4613 BLOCK_INPUT; |
4614 } | |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
4615 while (CONSP (obj) /* Mouse event */ |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
4616 && EQ (Fcar (Fcdr (Fcdr (obj))), Qnil) /* Not scroll bar */ |
389 | 4617 && EQ (Vmouse_depressed, Qnil) /* Only motion events */ |
4618 && EQ (Vmouse_window, selected_window) /* In this window */ | |
771 | 4619 && x_mouse_frame); |
389 | 4620 |
1601
a371ec79bc31
* xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents:
1528
diff
changeset
|
4621 unread_command_event = obj; |
389 | 4622 |
4623 if (mouse_track_width) | |
4624 { | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
4625 x_rectangle (f, f->output_data.x->reverse_gc, |
389 | 4626 mouse_track_left, mouse_track_top, |
4627 mouse_track_width, 1); | |
4628 mouse_track_width = 0; | |
771 | 4629 if ((mouse_track_left == f->phys_cursor_x |
4630 || mouse_track_left - 1 == f->phys_cursor_x) | |
4631 && mouse_track_top == f->phys_cursor_y) | |
389 | 4632 { |
771 | 4633 x_display_cursor (f, 1); |
389 | 4634 } |
4635 } | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4636 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
|
4637 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
|
4638 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
|
4639 XFlush (FRAME_X_DISPLAY (f)); |
389 | 4640 UNBLOCK_INPUT; |
4641 | |
4642 return Qnil; | |
4643 } | |
4644 #endif | |
4645 | |
4646 #if 0 | |
4647 #include "glyphs.h" | |
4648 | |
4649 /* 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
|
4650 on the frame F at position X, Y. */ |
771 | 4651 |
4652 x_draw_pixmap (f, x, y, image_data, width, height) | |
4653 struct frame *f; | |
389 | 4654 int x, y, width, height; |
4655 char *image_data; | |
4656 { | |
4657 Pixmap image; | |
4658 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4659 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
|
4660 FRAME_X_WINDOW (f), image_data, |
389 | 4661 width, height); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4662 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
|
4663 f->output_data.x->normal_gc, 0, 0, width, height, x, y); |
389 | 4664 } |
4665 #endif | |
4666 | |
4309
c79a44360ed9
(Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
4279
diff
changeset
|
4667 #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
|
4668 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
|
4669 |
389 | 4670 #ifdef HAVE_X11 |
4671 DEFUN ("x-rebind-key", Fx_rebind_key, Sx_rebind_key, 3, 3, 0, | |
4672 "Rebind X keysym KEYSYM, with MODIFIERS, to generate NEWSTRING.\n\ | |
4673 KEYSYM is a string which conforms to the X keysym definitions found\n\ | |
4674 in X11/keysymdef.h, sans the initial XK_. MODIFIERS is nil or a\n\ | |
4675 list of strings specifying modifier keys such as Control_L, which must\n\ | |
4676 also be depressed for NEWSTRING to appear.") | |
4677 (x_keysym, modifiers, newstring) | |
4678 register Lisp_Object x_keysym; | |
4679 register Lisp_Object modifiers; | |
4680 register Lisp_Object newstring; | |
4681 { | |
4682 char *rawstring; | |
642 | 4683 register KeySym keysym; |
4684 KeySym modifier_list[16]; | |
389 | 4685 |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
4686 check_x (); |
389 | 4687 CHECK_STRING (x_keysym, 1); |
4688 CHECK_STRING (newstring, 3); | |
4689 | |
4690 keysym = XStringToKeysym ((char *) XSTRING (x_keysym)->data); | |
4691 if (keysym == NoSymbol) | |
4692 error ("Keysym does not exist"); | |
4693 | |
485 | 4694 if (NILP (modifiers)) |
389 | 4695 XRebindKeysym (x_current_display, keysym, modifier_list, 0, |
4696 XSTRING (newstring)->data, XSTRING (newstring)->size); | |
4697 else | |
4698 { | |
4699 register Lisp_Object rest, mod; | |
4700 register int i = 0; | |
4701 | |
485 | 4702 for (rest = modifiers; !NILP (rest); rest = Fcdr (rest)) |
389 | 4703 { |
4704 if (i == 16) | |
4705 error ("Can't have more than 16 modifiers"); | |
4706 | |
4707 mod = Fcar (rest); | |
4708 CHECK_STRING (mod, 3); | |
4709 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
|
4710 #ifndef HAVE_X11R5 |
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4711 if (modifier_list[i] == NoSymbol |
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4712 || !(IsModifierKey (modifier_list[i]) |
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4713 || ((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
|
4714 || ((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
|
4715 #else |
389 | 4716 if (modifier_list[i] == NoSymbol |
4717 || !IsModifierKey (modifier_list[i])) | |
3692
589aaa4a815b
* xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents:
3679
diff
changeset
|
4718 #endif |
389 | 4719 error ("Element is not a modifier keysym"); |
4720 i++; | |
4721 } | |
4722 | |
4723 XRebindKeysym (x_current_display, keysym, modifier_list, i, | |
4724 XSTRING (newstring)->data, XSTRING (newstring)->size); | |
4725 } | |
4726 | |
4727 return Qnil; | |
4728 } | |
4729 | |
4730 DEFUN ("x-rebind-keys", Fx_rebind_keys, Sx_rebind_keys, 2, 2, 0, | |
4731 "Rebind KEYCODE to list of strings STRINGS.\n\ | |
4732 STRINGS should be a list of 16 elements, one for each shift combination.\n\ | |
4733 nil as element means don't change.\n\ | |
4734 See the documentation of `x-rebind-key' for more information.") | |
4735 (keycode, strings) | |
4736 register Lisp_Object keycode; | |
4737 register Lisp_Object strings; | |
4738 { | |
4739 register Lisp_Object item; | |
4740 register unsigned char *rawstring; | |
4741 KeySym rawkey, modifier[1]; | |
4742 int strsize; | |
4743 register unsigned i; | |
4744 | |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
4745 check_x (); |
389 | 4746 CHECK_NUMBER (keycode, 1); |
4747 CHECK_CONS (strings, 2); | |
4748 rawkey = (KeySym) ((unsigned) (XINT (keycode))) & 255; | |
4749 for (i = 0; i <= 15; strings = Fcdr (strings), i++) | |
4750 { | |
4751 item = Fcar (strings); | |
485 | 4752 if (!NILP (item)) |
389 | 4753 { |
4754 CHECK_STRING (item, 2); | |
4755 strsize = XSTRING (item)->size; | |
4756 rawstring = (unsigned char *) xmalloc (strsize); | |
4757 bcopy (XSTRING (item)->data, rawstring, strsize); | |
4758 modifier[1] = 1 << i; | |
4759 XRebindKeysym (x_current_display, rawkey, modifier, 1, | |
4760 rawstring, strsize); | |
4761 } | |
4762 } | |
4763 return Qnil; | |
4764 } | |
3141
ffe66ae9bfb3
(Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
3134
diff
changeset
|
4765 #endif /* HAVE_X11 */ |
4309
c79a44360ed9
(Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
4279
diff
changeset
|
4766 #endif /* 0 */ |
389 | 4767 |
4606
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4768 #ifndef HAVE_XSCREENNUMBEROFSCREEN |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4769 int |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4770 XScreenNumberOfScreen (scr) |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4771 register Screen *scr; |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4772 { |
4771
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4773 register Display *dpy; |
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4774 register Screen *dpyscr; |
4606
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4775 register int i; |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4776 |
4771
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4777 dpy = scr->display; |
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4778 dpyscr = dpy->screens; |
d6ddaf79ea6a
(XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents:
4696
diff
changeset
|
4779 |
4606
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4780 for (i = 0; i < dpy->nscreens; i++, dpyscr++) |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4781 if (scr == dpyscr) |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4782 return i; |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4783 |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4784 return -1; |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4785 } |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4786 #endif /* not HAVE_XSCREENNUMBEROFSCREEN */ |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
4787 |
389 | 4788 Visual * |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4789 select_visual (dpy, screen, depth) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4790 Display *dpy; |
389 | 4791 Screen *screen; |
4792 unsigned int *depth; | |
4793 { | |
4794 Visual *v; | |
4795 XVisualInfo *vinfo, vinfo_template; | |
4796 int n_visuals; | |
4797 | |
4798 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
|
4799 |
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
|
4800 #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
|
4801 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
|
4802 #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
|
4803 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
|
4804 #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
|
4805 |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
4806 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
|
4807 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4808 vinfo = XGetVisualInfo (dpy, |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
4809 VisualIDMask | VisualScreenMask, &vinfo_template, |
389 | 4810 &n_visuals); |
4811 if (n_visuals != 1) | |
4812 fatal ("Can't get proper X visual info"); | |
4813 | |
4814 if ((1 << vinfo->depth) == vinfo->colormap_size) | |
4815 *depth = vinfo->depth; | |
4816 else | |
4817 { | |
4818 int i = 0; | |
4819 int n = vinfo->colormap_size - 1; | |
4820 while (n) | |
4821 { | |
4822 n = n >> 1; | |
4823 i++; | |
4824 } | |
4825 *depth = i; | |
4826 } | |
4827 | |
4828 XFree ((char *) vinfo); | |
4829 return v; | |
4830 } | |
4831 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4832 /* 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
|
4833 Open a new connection if necessary. */ |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4834 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4835 struct x_display_info * |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4836 x_display_info_for_name (name) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4837 Lisp_Object name; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4838 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4839 Lisp_Object names; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4840 struct x_display_info *dpyinfo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4841 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4842 CHECK_STRING (name, 0); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4843 |
12381
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4844 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
|
4845 error ("Not using X Windows"); |
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4846 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4847 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
|
4848 dpyinfo; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4849 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
|
4850 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4851 Lisp_Object tem; |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4852 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
|
4853 if (!NILP (tem)) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4854 return dpyinfo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4855 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4856 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4857 /* 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
|
4858 Vx_resource_name = Vinvocation_name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4859 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4860 validate_x_resource_name (); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4861 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4862 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
|
4863 (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
|
4864 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4865 if (dpyinfo == 0) |
12046
d23f2c9990b2
(x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents:
12036
diff
changeset
|
4866 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
|
4867 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4868 x_in_use = 1; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4869 XSETFASTINT (Vwindow_system_version, 11); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4870 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4871 return dpyinfo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4872 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4873 |
389 | 4874 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
|
4875 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
|
4876 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
|
4877 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
|
4878 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
|
4879 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
|
4880 (display, xrm_string, must_succeed) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4881 Lisp_Object display, xrm_string, must_succeed; |
389 | 4882 { |
4883 unsigned int n_planes; | |
4884 unsigned char *xrm_option; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4885 struct x_display_info *dpyinfo; |
389 | 4886 |
4887 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
|
4888 if (! NILP (xrm_string)) |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4889 CHECK_STRING (xrm_string, 1); |
389 | 4890 |
12381
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4891 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
|
4892 error ("Not using X Windows"); |
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4893 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4894 if (! NILP (xrm_string)) |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4895 xrm_option = (unsigned char *) XSTRING (xrm_string)->data; |
389 | 4896 else |
4897 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
|
4898 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4899 /* 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
|
4900 Vx_resource_name = Vinvocation_name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
4901 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4902 validate_x_resource_name (); |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4903 |
7802
d687e885fa6a
(Fx_open_connection): Set up Vx_resource_name and xrm_option
Richard M. Stallman <rms@gnu.org>
parents:
7797
diff
changeset
|
4904 /* 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
|
4905 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
|
4906 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
|
4907 (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
|
4908 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4909 if (dpyinfo == 0) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4910 { |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4911 if (!NILP (must_succeed)) |
12046
d23f2c9990b2
(x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents:
12036
diff
changeset
|
4912 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
|
4913 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
|
4914 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
|
4915 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
|
4916 XSTRING (display)->data); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4917 else |
12046
d23f2c9990b2
(x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents:
12036
diff
changeset
|
4918 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
|
4919 } |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4920 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4921 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
|
4922 |
9327
b3398cf56fba
(Fx_open_connection): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents:
9285
diff
changeset
|
4923 XSETFASTINT (Vwindow_system_version, 11); |
389 | 4924 return Qnil; |
4925 } | |
4926 | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4927 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
|
4928 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
|
4929 "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
|
4930 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
|
4931 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
|
4932 (display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4933 Lisp_Object display; |
389 | 4934 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4935 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
|
4936 struct x_display_info *tail; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4937 int i; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4938 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4939 if (dpyinfo->reference_count > 0) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4940 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
|
4941 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4942 BLOCK_INPUT; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4943 /* 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
|
4944 for (i = 0; i < dpyinfo->n_fonts; i++) |
389 | 4945 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4946 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
|
4947 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
|
4948 /* 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
|
4949 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
|
4950 XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font); |
389 | 4951 } |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4952 x_destroy_all_bitmaps (dpyinfo); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4953 XSetCloseDownMode (dpyinfo->display, DestroyAll); |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4954 |
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4955 #ifdef USE_X_TOOLKIT |
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4956 XtCloseDisplay (dpyinfo->display); |
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4957 #else |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4958 XCloseDisplay (dpyinfo->display); |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4959 #endif |
9690
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 x_delete_display (dpyinfo); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4962 UNBLOCK_INPUT; |
8782
51241477cfc5
Delete X11 conditionals.
Richard M. Stallman <rms@gnu.org>
parents:
8780
diff
changeset
|
4963 |
389 | 4964 return Qnil; |
4965 } | |
4966 | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4967 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
|
4968 "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
|
4969 () |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4970 { |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4971 Lisp_Object tail, result; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4972 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4973 result = Qnil; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4974 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
|
4975 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
|
4976 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4977 return result; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4978 } |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4979 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4980 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
|
4981 "If ON is non-nil, report X errors as soon as the erring request is made.\n\ |
389 | 4982 If ON is nil, allow buffering of requests.\n\ |
4983 Turning on synchronization prohibits the Xlib routines from buffering\n\ | |
4984 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
|
4985 easier.\n\ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4986 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
|
4987 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
|
4988 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
|
4989 (on, display) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4990 Lisp_Object display, on; |
389 | 4991 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4992 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
|
4993 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4994 XSynchronize (dpyinfo->display, !EQ (on, Qnil)); |
389 | 4995 |
4996 return Qnil; | |
4997 } | |
4998 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4999 /* Wait for responses to all X commands issued so far for frame F. */ |
5536 | 5000 |
5001 void | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
5002 x_sync (f) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
5003 FRAME_PTR f; |
5536 | 5004 { |
5558 | 5005 BLOCK_INPUT; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
5006 XSync (FRAME_X_DISPLAY (f), False); |
5558 | 5007 UNBLOCK_INPUT; |
5536 | 5008 } |
389 | 5009 |
5010 syms_of_xfns () | |
5011 { | |
5012 /* 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
|
5013 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
|
5014 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5015 /* 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
|
5016 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
|
5017 /*&&& init symbols here &&&*/ |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5018 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
|
5019 staticpro (&Qauto_raise); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5020 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
|
5021 staticpro (&Qauto_lower); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5022 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
|
5023 staticpro (&Qbackground_color); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
5024 Qbar = intern ("bar"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
5025 staticpro (&Qbar); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5026 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
|
5027 staticpro (&Qborder_color); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5028 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
|
5029 staticpro (&Qborder_width); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
5030 Qbox = intern ("box"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
5031 staticpro (&Qbox); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5032 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
|
5033 staticpro (&Qcursor_color); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
5034 Qcursor_type = intern ("cursor-type"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
5035 staticpro (&Qcursor_type); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5036 Qfont = intern ("font"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5037 staticpro (&Qfont); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5038 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
|
5039 staticpro (&Qforeground_color); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5040 Qgeometry = intern ("geometry"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5041 staticpro (&Qgeometry); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5042 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
|
5043 staticpro (&Qicon_left); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5044 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
|
5045 staticpro (&Qicon_top); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5046 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
|
5047 staticpro (&Qicon_type); |
12073 | 5048 Qicon_name = intern ("icon-name"); |
5049 staticpro (&Qicon_name); | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5050 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
|
5051 staticpro (&Qinternal_border_width); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5052 Qleft = intern ("left"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5053 staticpro (&Qleft); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5054 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
|
5055 staticpro (&Qmouse_color); |
1874
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
5056 Qnone = intern ("none"); |
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
5057 staticpro (&Qnone); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5058 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
|
5059 staticpro (&Qparent_id); |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
5060 Qscroll_bar_width = intern ("scroll-bar-width"); |
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
5061 staticpro (&Qscroll_bar_width); |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
5062 Qsuppress_icon = intern ("suppress-icon"); |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
5063 staticpro (&Qsuppress_icon); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5064 Qtop = intern ("top"); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5065 staticpro (&Qtop); |
389 | 5066 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
|
5067 staticpro (&Qundefined_color); |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
5068 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
|
5069 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
|
5070 Qvisibility = intern ("visibility"); |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
5071 staticpro (&Qvisibility); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5072 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
|
5073 staticpro (&Qwindow_id); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5074 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
|
5075 staticpro (&Qx_frame_parameter); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
5076 Qx_resource_name = intern ("x-resource-name"); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
5077 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
|
5078 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
|
5079 staticpro (&Quser_position); |
02cc4eee5928
(x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents:
7209
diff
changeset
|
5080 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
|
5081 staticpro (&Quser_size); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
5082 Qdisplay = intern ("display"); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
5083 staticpro (&Qdisplay); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5084 /* 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
|
5085 |
389 | 5086 Fput (Qundefined_color, Qerror_conditions, |
5087 Fcons (Qundefined_color, Fcons (Qerror, Qnil))); | |
5088 Fput (Qundefined_color, Qerror_message, | |
5089 build_string ("Undefined color")); | |
5090 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5091 init_x_parm_symbols (); |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5092 |
9563 | 5093 DEFVAR_LISP ("x-bitmap-file-path", &Vx_bitmap_file_path, |
5094 "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
|
5095 Vx_bitmap_file_path = decode_env_path ((char *) 0, PATH_BITMAPS); |
9563 | 5096 |
4328
3d43e65a593d
(syms_of_xfns): Use DEFVAR_LISP, not DEFVAR_INT, for Vx_pointer_shape.
Roland McGrath <roland@gnu.org>
parents:
4309
diff
changeset
|
5097 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
|
5098 "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
|
5099 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
|
5100 unless you set the mouse color."); |
389 | 5101 Vx_pointer_shape = Qnil; |
5102 | |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
5103 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
|
5104 "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
|
5105 `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
|
5106 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
|
5107 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
|
5108 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
|
5109 switches, if present."); |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
5110 Vx_resource_name = Qnil; |
3170
647229114f47
* xfns.c: Make resource manager work correctly even when
Jim Blandy <jimb@redhat.com>
parents:
3141
diff
changeset
|
5111 |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5112 #if 0 /* This doesn't really do anything. */ |
389 | 5113 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
|
5114 "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
|
5115 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
|
5116 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
|
5117 #endif |
389 | 5118 Vx_nontext_pointer_shape = Qnil; |
5119 | |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5120 #if 0 /* This doesn't really do anything. */ |
389 | 5121 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
|
5122 "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
|
5123 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
|
5124 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
|
5125 #endif |
389 | 5126 Vx_mode_pointer_shape = Qnil; |
5127 | |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5128 DEFVAR_INT ("x-sensitive-text-pointer-shape", |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5129 &Vx_sensitive_text_pointer_shape, |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5130 "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
|
5131 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
|
5132 or when you set the mouse color."); |
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5133 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
|
5134 |
389 | 5135 DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel, |
5136 "A string indicating the foreground color of the cursor box."); | |
5137 Vx_cursor_fore_pixel = Qnil; | |
5138 | |
5139 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
|
5140 "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
|
5141 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
|
5142 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
|
5143 /* 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
|
5144 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
|
5145 Vx_no_window_manager = Qnil; |
8170
d92a24366b22
(x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
8103
diff
changeset
|
5146 |
d92a24366b22
(x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
8103
diff
changeset
|
5147 #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
|
5148 Fprovide (intern ("x-toolkit")); |
8170
d92a24366b22
(x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
8103
diff
changeset
|
5149 #endif |
12094
a9fda5417acf
(syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents:
12080
diff
changeset
|
5150 #ifdef USE_MOTIF |
a9fda5417acf
(syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents:
12080
diff
changeset
|
5151 Fprovide (intern ("motif")); |
a9fda5417acf
(syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents:
12080
diff
changeset
|
5152 #endif |
389 | 5153 |
5154 defsubr (&Sx_get_resource); | |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
5155 #if 0 |
389 | 5156 defsubr (&Sx_draw_rectangle); |
5157 defsubr (&Sx_erase_rectangle); | |
5158 defsubr (&Sx_contour_region); | |
5159 defsubr (&Sx_uncontour_region); | |
689
45401d45581d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
687
diff
changeset
|
5160 #endif |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
5161 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
|
5162 defsubr (&Sx_display_color_p); |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
5163 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
|
5164 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
|
5165 defsubr (&Sx_color_values); |
4279 | 5166 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
|
5167 defsubr (&Sx_server_vendor); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5168 defsubr (&Sx_server_version); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5169 defsubr (&Sx_display_pixel_width); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5170 defsubr (&Sx_display_pixel_height); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5171 defsubr (&Sx_display_mm_width); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5172 defsubr (&Sx_display_mm_height); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5173 defsubr (&Sx_display_screens); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5174 defsubr (&Sx_display_planes); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5175 defsubr (&Sx_display_color_cells); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5176 defsubr (&Sx_display_visual_class); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5177 defsubr (&Sx_display_backing_store); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5178 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
|
5179 #if 0 |
3141
ffe66ae9bfb3
(Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
3134
diff
changeset
|
5180 defsubr (&Sx_rebind_key); |
ffe66ae9bfb3
(Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents:
3134
diff
changeset
|
5181 defsubr (&Sx_rebind_keys); |
389 | 5182 defsubr (&Sx_track_pointer); |
5183 defsubr (&Sx_grab_pointer); | |
5184 defsubr (&Sx_ungrab_pointer); | |
436
6e0a136fca4f
*** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents:
398
diff
changeset
|
5185 #endif |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
5186 defsubr (&Sx_parse_geometry); |
771 | 5187 defsubr (&Sx_create_frame); |
5188 defsubr (&Sfocus_frame); | |
5189 defsubr (&Sunfocus_frame); | |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
5190 #if 0 |
389 | 5191 defsubr (&Sx_horizontal_line); |
687
e2b747dd6a6e
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
642
diff
changeset
|
5192 #endif |
389 | 5193 defsubr (&Sx_open_connection); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
5194 defsubr (&Sx_close_connection); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
5195 defsubr (&Sx_display_list); |
389 | 5196 defsubr (&Sx_synchronize); |
5197 } | |
5198 | |
5199 #endif /* HAVE_X_WINDOWS */ |