Mercurial > emacs
annotate src/xfns.c @ 73084:96b7fa2c103b
*** empty log message ***
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Sat, 23 Sep 2006 21:07:44 +0000 |
parents | cec998346c98 |
children | 1fd4b3c12646 2d56e13fd23d bb0e318b7c53 |
rev | line source |
---|---|
389 | 1 /* Functions for the X window system. |
59905
d6551c039c8f
Copyright update.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59904
diff
changeset
|
2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, |
68651
3bd95f4f2941
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
68396
diff
changeset
|
3 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
389 | 4 |
5 This file is part of GNU Emacs. | |
6 | |
7 GNU Emacs is free software; you can redistribute it and/or modify | |
8 it under the terms of the GNU General Public License as published by | |
708 | 9 the Free Software Foundation; either version 2, or (at your option) |
389 | 10 any later version. |
11 | |
12 GNU Emacs is distributed in the hope that it will be useful, | |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 GNU General Public License for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
18 along with GNU Emacs; see the file COPYING. If not, write to | |
64084 | 19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 Boston, MA 02110-1301, USA. */ | |
389 | 21 |
26088
b7aa6ac26872
Add support for large files, 64-bit Solaris, system locale codings.
Paul Eggert <eggert@twinsun.com>
parents:
26032
diff
changeset
|
22 #include <config.h> |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
23 #include <stdio.h> |
25528
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
24 #include <math.h> |
7899 | 25 |
40700
6f6287da52d1
Include unistd.h, if it exists.
Richard M. Stallman <rms@gnu.org>
parents:
40656
diff
changeset
|
26 #ifdef HAVE_UNISTD_H |
6f6287da52d1
Include unistd.h, if it exists.
Richard M. Stallman <rms@gnu.org>
parents:
40656
diff
changeset
|
27 #include <unistd.h> |
6f6287da52d1
Include unistd.h, if it exists.
Richard M. Stallman <rms@gnu.org>
parents:
40656
diff
changeset
|
28 #endif |
6f6287da52d1
Include unistd.h, if it exists.
Richard M. Stallman <rms@gnu.org>
parents:
40656
diff
changeset
|
29 |
8091
f40cbe50c74f
(XLIB_ILLEGAL_ACCESS): Defined.
Richard M. Stallman <rms@gnu.org>
parents:
8090
diff
changeset
|
30 /* This makes the fields of a Display accessible, in Xlib header files. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
31 |
8091
f40cbe50c74f
(XLIB_ILLEGAL_ACCESS): Defined.
Richard M. Stallman <rms@gnu.org>
parents:
8090
diff
changeset
|
32 #define XLIB_ILLEGAL_ACCESS |
f40cbe50c74f
(XLIB_ILLEGAL_ACCESS): Defined.
Richard M. Stallman <rms@gnu.org>
parents:
8090
diff
changeset
|
33 |
389 | 34 #include "lisp.h" |
35 #include "xterm.h" | |
771 | 36 #include "frame.h" |
389 | 37 #include "window.h" |
38 #include "buffer.h" | |
26876 | 39 #include "intervals.h" |
389 | 40 #include "dispextern.h" |
515 | 41 #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
|
42 #include "blockinput.h" |
24412
d11ac02f9d6a
Use epaths.h istead of paths.h.
Richard M. Stallman <rms@gnu.org>
parents:
24170
diff
changeset
|
43 #include <epaths.h> |
17048
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
44 #include "charset.h" |
30351
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
45 #include "coding.h" |
17048
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
46 #include "fontset.h" |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
47 #include "systime.h" |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
48 #include "termhooks.h" |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
49 #include "atimer.h" |
389 | 50 |
51 #ifdef HAVE_X_WINDOWS | |
25451
786ab5197e4b
Include <stdlib.h> if available, and declare abort only if not. Include
Andreas Schwab <schwab@suse.de>
parents:
25390
diff
changeset
|
52 |
786ab5197e4b
Include <stdlib.h> if available, and declare abort only if not. Include
Andreas Schwab <schwab@suse.de>
parents:
25390
diff
changeset
|
53 #include <ctype.h> |
27069
b2934c683b5e
(gif_load): Avoid sign extension and thus out of bounds
Gerd Moellmann <gerd@gnu.org>
parents:
27066
diff
changeset
|
54 #include <sys/types.h> |
b2934c683b5e
(gif_load): Avoid sign extension and thus out of bounds
Gerd Moellmann <gerd@gnu.org>
parents:
27066
diff
changeset
|
55 #include <sys/stat.h> |
389 | 56 |
2355
cec8c9490d8a
* xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents:
2341
diff
changeset
|
57 #ifndef VMS |
3821
8f353c2491d0
* xfns.c: Always #include "bitmaps/gray.xbm"; the bitmaps seem to
Jim Blandy <jimb@redhat.com>
parents:
3692
diff
changeset
|
58 #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
|
59 #include "bitmaps/gray.xbm" |
2657b04dd324
[EMACS_BIT_MAPS]: Include gray.xbm from ./bitmaps.
Richard M. Stallman <rms@gnu.org>
parents:
3507
diff
changeset
|
60 #else |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
61 #include <X11/bitmaps/gray> |
3512
2657b04dd324
[EMACS_BIT_MAPS]: Include gray.xbm from ./bitmaps.
Richard M. Stallman <rms@gnu.org>
parents:
3507
diff
changeset
|
62 #endif |
2355
cec8c9490d8a
* xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents:
2341
diff
changeset
|
63 #else |
cec8c9490d8a
* xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents:
2341
diff
changeset
|
64 #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
|
65 #endif |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
66 |
49322 | 67 #ifdef USE_GTK |
68 #include "gtkutil.h" | |
69 #endif | |
70 | |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
71 #ifdef USE_X_TOOLKIT |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
72 #include <X11/Shell.h> |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
73 |
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
|
74 #ifndef USE_MOTIF |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
75 #include <X11/Xaw/Paned.h> |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
76 #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
|
77 #endif /* USE_MOTIF */ |
5671
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 #ifdef USG |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
80 #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
|
81 #include <X11/Xos.h> |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
82 #define USG |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
83 #else |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
84 #include <X11/Xos.h> |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
85 #endif |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
86 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
87 #include "widget.h" |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
88 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
89 #include "../lwlib/lwlib.h" |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
90 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
91 #ifdef USE_MOTIF |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
92 #include <Xm/Xm.h> |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
93 #include <Xm/DialogS.h> |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
94 #include <Xm/FileSB.h> |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
95 #endif |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
96 |
13508
b64345cf1ee9
(HACK_EDITRES): Don't define if NO_EDITRES is defined.
Richard M. Stallman <rms@gnu.org>
parents:
13227
diff
changeset
|
97 /* 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
|
98 Exception: HP-UX (at least version A.09.05) has X11R5 without EditRes */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
99 |
13508
b64345cf1ee9
(HACK_EDITRES): Don't define if NO_EDITRES is defined.
Richard M. Stallman <rms@gnu.org>
parents:
13227
diff
changeset
|
100 #if (XtSpecificationRelease >= 5) && !defined(NO_EDITRES) |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
101 #define HACK_EDITRES |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
102 extern void _XEditResCheckMessages (); |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
103 #endif /* R5 + Athena */ |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
104 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
105 /* Unique id counter for widgets created by the Lucid Widget Library. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
106 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
107 extern LWLIB_ID widget_id_tick; |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
108 |
15720
f1549b7501af
(Fx_create_frame): Do xlwmenu hack only if USE_LUCID.
Karl Heuer <kwzh@gnu.org>
parents:
15706
diff
changeset
|
109 #ifdef USE_LUCID |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
110 /* This is part of a kludge--see lwlib/xlwmenu.c. */ |
15706
bf891f379d9f
(xlwmenu_default_font): Declare, but don't define.
Karl Heuer <kwzh@gnu.org>
parents:
15704
diff
changeset
|
111 extern XFontStruct *xlwmenu_default_font; |
15720
f1549b7501af
(Fx_create_frame): Do xlwmenu hack only if USE_LUCID.
Karl Heuer <kwzh@gnu.org>
parents:
15706
diff
changeset
|
112 #endif |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
113 |
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
|
114 extern void free_frame_menubar (); |
25528
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
115 extern double atof (); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
116 |
37210
8b47704e0150
(Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37173
diff
changeset
|
117 #ifdef USE_MOTIF |
8b47704e0150
(Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37173
diff
changeset
|
118 |
8b47704e0150
(Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37173
diff
changeset
|
119 /* LessTif/Motif version info. */ |
8b47704e0150
(Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37173
diff
changeset
|
120 |
8b47704e0150
(Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37173
diff
changeset
|
121 static Lisp_Object Vmotif_version_string; |
8b47704e0150
(Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37173
diff
changeset
|
122 |
8b47704e0150
(Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37173
diff
changeset
|
123 #endif /* USE_MOTIF */ |
8b47704e0150
(Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37173
diff
changeset
|
124 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
125 #endif /* USE_X_TOOLKIT */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
126 |
52334
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
127 #ifdef USE_GTK |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
128 |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
129 /* GTK+ version info */ |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
130 |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
131 static Lisp_Object Vgtk_version_string; |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
132 |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
133 #endif /* USE_GTK */ |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
134 |
4279 | 135 #ifdef HAVE_X11R4 |
136 #define MAXREQUEST(dpy) (XMaxRequestSize (dpy)) | |
137 #else | |
138 #define MAXREQUEST(dpy) ((dpy)->max_request_size) | |
139 #endif | |
140 | |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
141 /* The gray bitmap `bitmaps/gray'. This is done because xterm.c uses |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
142 it, and including `bitmaps/gray' more than once is a problem when |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
143 config.h defines `static' as an empty replacement string. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
144 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
145 int gray_bitmap_width = gray_width; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
146 int gray_bitmap_height = gray_height; |
34512
d069886667e6
(gray_bitmap_bits): Declare `char *'.
Gerd Moellmann <gerd@gnu.org>
parents:
34476
diff
changeset
|
147 char *gray_bitmap_bits = gray_bits; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
148 |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
149 /* Non-zero means we're allowed to display an hourglass cursor. */ |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
150 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
151 int display_hourglass_p; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
152 |
58463
86fddd350b35
* gtkutil.c (xg_get_file_name): Rename use-old-gtk-file-dialog to
Jan Djärv <jan.h.d@swipnet.se>
parents:
58283
diff
changeset
|
153 /* Non-zero means prompt with the old GTK file selection dialog. */ |
86fddd350b35
* gtkutil.c (xg_get_file_name): Rename use-old-gtk-file-dialog to
Jan Djärv <jan.h.d@swipnet.se>
parents:
58283
diff
changeset
|
154 |
72964
4e1cc9325b0e
* xfns.c (syms_of_xfns): Rename x-use-old-gtk-file-dialog
Jan Djärv <jan.h.d@swipnet.se>
parents:
72932
diff
changeset
|
155 int x_gtk_use_old_file_dialog; |
58463
86fddd350b35
* gtkutil.c (xg_get_file_name): Rename use-old-gtk-file-dialog to
Jan Djärv <jan.h.d@swipnet.se>
parents:
58283
diff
changeset
|
156 |
67842
095b05723996
* xfns.c: x_show_hidden_files, new variable.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67761
diff
changeset
|
157 /* If non-zero, by default show hidden files in the GTK file chooser. */ |
095b05723996
* xfns.c: x_show_hidden_files, new variable.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67761
diff
changeset
|
158 |
095b05723996
* xfns.c: x_show_hidden_files, new variable.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67761
diff
changeset
|
159 int x_gtk_show_hidden_files; |
095b05723996
* xfns.c: x_show_hidden_files, new variable.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67761
diff
changeset
|
160 |
72932
eea4777d0d23
* xfns.c (syms_of_xfns): New variable: x-gtk-show-chooser-help-text.
Jan Djärv <jan.h.d@swipnet.se>
parents:
72777
diff
changeset
|
161 /* If non-zero, don't show additional help text in the GTK file chooser. */ |
eea4777d0d23
* xfns.c (syms_of_xfns): New variable: x-gtk-show-chooser-help-text.
Jan Djärv <jan.h.d@swipnet.se>
parents:
72777
diff
changeset
|
162 |
72969
f8188a2ff5f6
* xfns.c (syms_of_xfns): Rename x_gtk_show_chooser_help_text to
Jan Djärv <jan.h.d@swipnet.se>
parents:
72964
diff
changeset
|
163 int x_gtk_file_dialog_help_text; |
72932
eea4777d0d23
* xfns.c (syms_of_xfns): New variable: x-gtk-show-chooser-help-text.
Jan Djärv <jan.h.d@swipnet.se>
parents:
72777
diff
changeset
|
164 |
68880
f5fa98f7c3b7
* xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar.
Jan Djärv <jan.h.d@swipnet.se>
parents:
68651
diff
changeset
|
165 /* If non-zero, don't collapse to tool bar when it is detached. */ |
f5fa98f7c3b7
* xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar.
Jan Djärv <jan.h.d@swipnet.se>
parents:
68651
diff
changeset
|
166 |
f5fa98f7c3b7
* xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar.
Jan Djärv <jan.h.d@swipnet.se>
parents:
68651
diff
changeset
|
167 int x_gtk_whole_detached_tool_bar; |
f5fa98f7c3b7
* xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar.
Jan Djärv <jan.h.d@swipnet.se>
parents:
68651
diff
changeset
|
168 |
389 | 169 /* 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
|
170 over text or in the modeline. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
171 |
389 | 172 Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape; |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
173 Lisp_Object Vx_hourglass_pointer_shape; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
174 |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
175 /* The shape when over mouse-sensitive text. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
176 |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
177 Lisp_Object Vx_sensitive_text_pointer_shape; |
389 | 178 |
33960
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
179 /* If non-nil, the pointer shape to indicate that windows can be |
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
180 dragged horizontally. */ |
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
181 |
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
182 Lisp_Object Vx_window_horizontal_drag_shape; |
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
183 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
184 /* Color of chars displayed in cursor box. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
185 |
389 | 186 Lisp_Object Vx_cursor_fore_pixel; |
187 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
188 /* Nonzero if using X. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
189 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
190 static int x_in_use; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
191 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
192 /* Non nil if no window manager is in use. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
193 |
389 | 194 Lisp_Object Vx_no_window_manager; |
195 | |
17048
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
196 /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
197 |
17048
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
198 Lisp_Object Vx_pixel_size_width_font_regexp; |
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
199 |
1874
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
200 Lisp_Object Qnone; |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
201 Lisp_Object Qsuppress_icon; |
389 | 202 Lisp_Object Qundefined_color; |
35402
302fbe91e359
(Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
35360
diff
changeset
|
203 Lisp_Object Qcompound_text, Qcancel_timer; |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
204 |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
205 /* In dispnew.c */ |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
206 |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
207 extern Lisp_Object Vwindow_system_version; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
208 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
209 /* The below are defined in frame.c. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
210 |
34895
53e52b3525bf
Use #if GLYPH_DEBUG instead of #ifdef GLYPH_DEBUG.
Gerd Moellmann <gerd@gnu.org>
parents:
34662
diff
changeset
|
211 #if GLYPH_DEBUG |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
212 int image_cache_refcount, dpyinfo_refcount; |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
213 #endif |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
214 |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
215 |
389 | 216 |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
217 /* Error if we are not connected to X. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
218 |
5948 | 219 void |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
220 check_x () |
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
221 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
222 if (! x_in_use) |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
223 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
|
224 } |
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
225 |
13867
19a05b5a597d
(check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents:
13781
diff
changeset
|
226 /* 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
|
227 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
|
228 |
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
229 int |
13867
19a05b5a597d
(check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents:
13781
diff
changeset
|
230 have_menus_p () |
7791
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
231 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
232 return x_in_use; |
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 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
235 /* 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
|
236 and checking validity for X. */ |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
237 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
238 FRAME_PTR |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
239 check_x_frame (frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
240 Lisp_Object frame; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
241 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
242 FRAME_PTR f; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
243 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
244 if (NILP (frame)) |
25679
8b09c5927f1c
(QCfile): Moved to xdisp.c.
Gerd Moellmann <gerd@gnu.org>
parents:
25646
diff
changeset
|
245 frame = selected_frame; |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
246 CHECK_LIVE_FRAME (frame); |
25679
8b09c5927f1c
(QCfile): Moved to xdisp.c.
Gerd Moellmann <gerd@gnu.org>
parents:
25646
diff
changeset
|
247 f = XFRAME (frame); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
248 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
|
249 error ("Non-X frame used"); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
250 return f; |
7791
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
251 } |
2b4e4a76468b
(using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7683
diff
changeset
|
252 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
253 /* 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
|
254 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
|
255 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
|
256 |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
257 struct x_display_info * |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
258 check_x_display_info (frame) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
259 Lisp_Object frame; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
260 { |
31543
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
261 struct x_display_info *dpyinfo = NULL; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
262 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
263 if (NILP (frame)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
264 { |
25679
8b09c5927f1c
(QCfile): Moved to xdisp.c.
Gerd Moellmann <gerd@gnu.org>
parents:
25646
diff
changeset
|
265 struct frame *sf = XFRAME (selected_frame); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
266 |
25679
8b09c5927f1c
(QCfile): Moved to xdisp.c.
Gerd Moellmann <gerd@gnu.org>
parents:
25646
diff
changeset
|
267 if (FRAME_X_P (sf) && FRAME_LIVE_P (sf)) |
31543
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
268 dpyinfo = FRAME_X_DISPLAY_INFO (sf); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
269 else if (x_display_list != 0) |
31543
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
270 dpyinfo = x_display_list; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
271 else |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
272 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
|
273 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
274 else if (STRINGP (frame)) |
31543
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
275 dpyinfo = x_display_info_for_name (frame); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
276 else |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
277 { |
45968
6bf20f37b7c7
(check_x_display_info): Use check_x_frame.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
45603
diff
changeset
|
278 FRAME_PTR f = check_x_frame (frame); |
31543
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
279 dpyinfo = FRAME_X_DISPLAY_INFO (f); |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
280 } |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
281 |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
282 return dpyinfo; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
283 } |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
284 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
285 |
771 | 286 /* Return the Emacs frame-object corresponding to an X window. |
287 It could be the frame's main window or an icon window. */ | |
288 | |
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 /* 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
|
290 |
771 | 291 struct frame * |
11197
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
292 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
|
293 struct x_display_info *dpyinfo; |
389 | 294 int wdesc; |
295 { | |
771 | 296 Lisp_Object tail, frame; |
297 struct frame *f; | |
298 | |
56781
c54fa35b4ded
* xfns.c (x_window_to_frame, x_any_window_to_frame)
Jan Djärv <jan.h.d@swipnet.se>
parents:
56718
diff
changeset
|
299 if (wdesc == None) return 0; |
c54fa35b4ded
* xfns.c (x_window_to_frame, x_any_window_to_frame)
Jan Djärv <jan.h.d@swipnet.se>
parents:
56718
diff
changeset
|
300 |
25646
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
301 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) |
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
302 { |
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
303 frame = XCAR (tail); |
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
|
304 if (!GC_FRAMEP (frame)) |
389 | 305 continue; |
771 | 306 f = XFRAME (frame); |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26571
diff
changeset
|
307 if (!FRAME_X_P (f) || 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
|
308 continue; |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
309 if (f->output_data.x->hourglass_window == wdesc) |
27798
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
310 return f; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
311 #ifdef USE_X_TOOLKIT |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
312 if ((f->output_data.x->edit_widget |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
313 && XtWindow (f->output_data.x->edit_widget) == wdesc) |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
314 /* A tooltip frame? */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
315 || (!f->output_data.x->edit_widget |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
316 && 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
|
317 || f->output_data.x->icon_desc == wdesc) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
318 return f; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
319 #else /* not USE_X_TOOLKIT */ |
49322 | 320 #ifdef USE_GTK |
321 if (f->output_data.x->edit_widget) | |
322 { | |
53069
1218a42792ea
Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
53027
diff
changeset
|
323 GtkWidget *gwdesc = xg_win_to_widget (dpyinfo->display, wdesc); |
49322 | 324 struct x_output *x = f->output_data.x; |
325 if (gwdesc != 0 && gwdesc == x->edit_widget) | |
326 return f; | |
327 } | |
328 #endif /* USE_GTK */ | |
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
|
329 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
|
330 || f->output_data.x->icon_desc == wdesc) |
771 | 331 return f; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
332 #endif /* not USE_X_TOOLKIT */ |
389 | 333 } |
334 return 0; | |
335 } | |
336 | |
49322 | 337 #if defined (USE_X_TOOLKIT) || defined (USE_GTK) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
338 /* 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
|
339 windows. */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
340 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
341 struct frame * |
11197
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
342 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
|
343 struct x_display_info *dpyinfo; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
344 int wdesc; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
345 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
346 Lisp_Object tail, frame; |
27798
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
347 struct frame *f, *found; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
348 struct x_output *x; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
349 |
56781
c54fa35b4ded
* xfns.c (x_window_to_frame, x_any_window_to_frame)
Jan Djärv <jan.h.d@swipnet.se>
parents:
56718
diff
changeset
|
350 if (wdesc == None) return NULL; |
c54fa35b4ded
* xfns.c (x_window_to_frame, x_any_window_to_frame)
Jan Djärv <jan.h.d@swipnet.se>
parents:
56718
diff
changeset
|
351 |
27798
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
352 found = NULL; |
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
353 for (tail = Vframe_list; GC_CONSP (tail) && !found; tail = XCDR (tail)) |
25646
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
354 { |
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
355 frame = XCAR (tail); |
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
|
356 if (!GC_FRAMEP (frame)) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
357 continue; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
358 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
359 f = XFRAME (frame); |
27798
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
360 if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo) |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
361 { |
27798
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
362 /* This frame matches if the window is any of its widgets. */ |
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
363 x = f->output_data.x; |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
364 if (x->hourglass_window == wdesc) |
27798
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
365 found = f; |
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
366 else if (x->widget) |
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
367 { |
49322 | 368 #ifdef USE_GTK |
53069
1218a42792ea
Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
53027
diff
changeset
|
369 GtkWidget *gwdesc = xg_win_to_widget (dpyinfo->display, wdesc); |
49322 | 370 if (gwdesc != 0 |
371 && (gwdesc == x->widget | |
372 || gwdesc == x->edit_widget | |
373 || gwdesc == x->vbox_widget | |
374 || gwdesc == x->menubar_widget)) | |
375 found = f; | |
376 #else | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
377 if (wdesc == XtWindow (x->widget) |
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
378 || wdesc == XtWindow (x->column_widget) |
27798
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
379 || wdesc == XtWindow (x->edit_widget)) |
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
380 found = f; |
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
381 /* Match if the window is this frame's menubar. */ |
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
382 else if (lw_window_is_in_menubar (wdesc, x->menubar_widget)) |
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
383 found = f; |
49322 | 384 #endif |
27798
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
385 } |
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
386 else if (FRAME_X_WINDOW (f) == wdesc) |
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
387 /* A tooltip frame. */ |
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
388 found = f; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
389 } |
27798
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
390 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
391 |
27798
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
392 return found; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
393 } |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
394 |
11611
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
395 /* 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
|
396 |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
397 struct frame * |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
398 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
|
399 struct x_display_info *dpyinfo; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
400 int wdesc; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
401 { |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
402 Lisp_Object tail, frame; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
403 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
|
404 struct x_output *x; |
11611
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
405 |
56781
c54fa35b4ded
* xfns.c (x_window_to_frame, x_any_window_to_frame)
Jan Djärv <jan.h.d@swipnet.se>
parents:
56718
diff
changeset
|
406 if (wdesc == None) return 0; |
c54fa35b4ded
* xfns.c (x_window_to_frame, x_any_window_to_frame)
Jan Djärv <jan.h.d@swipnet.se>
parents:
56718
diff
changeset
|
407 |
25646
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
408 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) |
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
409 { |
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
410 frame = XCAR (tail); |
11611
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
411 if (!GC_FRAMEP (frame)) |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
412 continue; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
413 f = XFRAME (frame); |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26571
diff
changeset
|
414 if (!FRAME_X_P (f) || 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
|
415 continue; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
416 x = f->output_data.x; |
11611
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
417 /* This frame matches if the window is any of its widgets. */ |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
418 if (x->hourglass_window == wdesc) |
27798
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
419 return f; |
d00730392332
(x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents:
27659
diff
changeset
|
420 else if (x->widget) |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
421 { |
49322 | 422 #ifdef USE_GTK |
53069
1218a42792ea
Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
53027
diff
changeset
|
423 GtkWidget *gwdesc = xg_win_to_widget (dpyinfo->display, wdesc); |
49322 | 424 if (gwdesc != 0 |
425 && (gwdesc == x->widget | |
426 || gwdesc == x->edit_widget | |
427 || gwdesc == x->vbox_widget)) | |
428 return f; | |
429 #else | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
430 if (wdesc == XtWindow (x->widget) |
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
431 || wdesc == XtWindow (x->column_widget) |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
432 || wdesc == XtWindow (x->edit_widget)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
433 return f; |
49322 | 434 #endif |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
435 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
436 else if (FRAME_X_WINDOW (f) == wdesc) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
437 /* A tooltip frame. */ |
11611
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
438 return f; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
439 } |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
440 return 0; |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
441 } |
bf53e9945a3c
(x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11537
diff
changeset
|
442 |
12656
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
443 /* 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
|
444 |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
445 struct frame * |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
446 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
|
447 struct x_display_info *dpyinfo; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
448 int wdesc; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
449 { |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
450 Lisp_Object tail, frame; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
451 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
|
452 struct x_output *x; |
12656
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
453 |
56781
c54fa35b4ded
* xfns.c (x_window_to_frame, x_any_window_to_frame)
Jan Djärv <jan.h.d@swipnet.se>
parents:
56718
diff
changeset
|
454 if (wdesc == None) return 0; |
c54fa35b4ded
* xfns.c (x_window_to_frame, x_any_window_to_frame)
Jan Djärv <jan.h.d@swipnet.se>
parents:
56718
diff
changeset
|
455 |
25646
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
456 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) |
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
457 { |
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
458 frame = XCAR (tail); |
12656
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
459 if (!GC_FRAMEP (frame)) |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
460 continue; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
461 f = XFRAME (frame); |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26571
diff
changeset
|
462 if (!FRAME_X_P (f) || 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
|
463 continue; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
464 x = f->output_data.x; |
12656
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
465 /* Match if the window is this frame's menubar. */ |
49322 | 466 #ifdef USE_GTK |
467 if (x->menubar_widget) | |
468 { | |
53069
1218a42792ea
Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
53027
diff
changeset
|
469 GtkWidget *gwdesc = xg_win_to_widget (dpyinfo->display, wdesc); |
49322 | 470 int found = 0; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
471 |
49322 | 472 BLOCK_INPUT; |
473 if (gwdesc != 0 | |
474 && (gwdesc == x->menubar_widget | |
475 || gtk_widget_get_parent (gwdesc) == x->menubar_widget)) | |
476 found = 1; | |
477 UNBLOCK_INPUT; | |
478 if (found) return f; | |
479 } | |
480 #else | |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
481 if (x->menubar_widget |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
482 && lw_window_is_in_menubar (wdesc, x->menubar_widget)) |
12656
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
483 return f; |
49322 | 484 #endif |
12656
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
485 } |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
486 return 0; |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
487 } |
5beb1d2be5c1
(x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
12616
diff
changeset
|
488 |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
489 /* 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
|
490 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
|
491 |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
492 struct frame * |
11197
1bdc265aab86
(x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11060
diff
changeset
|
493 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
|
494 struct x_display_info *dpyinfo; |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
495 int wdesc; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
496 { |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
497 Lisp_Object tail, frame; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
498 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
|
499 struct x_output *x; |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
500 |
56781
c54fa35b4ded
* xfns.c (x_window_to_frame, x_any_window_to_frame)
Jan Djärv <jan.h.d@swipnet.se>
parents:
56718
diff
changeset
|
501 if (wdesc == None) return 0; |
c54fa35b4ded
* xfns.c (x_window_to_frame, x_any_window_to_frame)
Jan Djärv <jan.h.d@swipnet.se>
parents:
56718
diff
changeset
|
502 |
25646
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
503 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) |
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
504 { |
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
505 frame = XCAR (tail); |
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
|
506 if (!GC_FRAMEP (frame)) |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
507 continue; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
508 f = XFRAME (frame); |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26571
diff
changeset
|
509 if (!FRAME_X_P (f) || 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
|
510 continue; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
511 x = f->output_data.x; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
512 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
513 if (x->widget) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
514 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
515 /* This frame matches if the window is its topmost widget. */ |
49322 | 516 #ifdef USE_GTK |
53069
1218a42792ea
Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
53027
diff
changeset
|
517 GtkWidget *gwdesc = xg_win_to_widget (dpyinfo->display, wdesc); |
49322 | 518 if (gwdesc == x->widget) |
519 return f; | |
520 #else | |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
521 if (wdesc == XtWindow (x->widget)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
522 return f; |
12019
63ee64941021
(x_top_window_to_frame): Don't match menu-bar widget.
Karl Heuer <kwzh@gnu.org>
parents:
12011
diff
changeset
|
523 #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
|
524 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
|
525 and it causes trouble for MapNotify events. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
526 /* Match if the window is this frame's menubar. */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
527 if (x->menubar_widget |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
528 && wdesc == XtWindow (x->menubar_widget)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
529 return f; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
530 #endif |
49322 | 531 #endif |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
532 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
533 else if (FRAME_X_WINDOW (f) == wdesc) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
534 /* Tooltip frame. */ |
7040
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
535 return f; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
536 } |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
537 return 0; |
cd4dd38925f9
(x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents:
6940
diff
changeset
|
538 } |
49322 | 539 #endif /* USE_X_TOOLKIT || USE_GTK */ |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
540 |
389 | 541 |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
542 |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
543 static Lisp_Object unwind_create_frame P_ ((Lisp_Object)); |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
544 static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object)); |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
545 |
25528
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
546 void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
38183
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
547 static void x_set_wait_for_wm P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
25528
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
548 void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
549 void x_set_mouse_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
550 void x_set_cursor_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
551 void x_set_border_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
552 void x_set_cursor_type P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
553 void x_set_icon_type P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
554 void x_set_icon_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
555 void x_explicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
556 void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
557 void x_set_title P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
25544
693ca9ba497a
Change spelling of `toolbar' to `tool_bar' or `tool-bar'.
Gerd Moellmann <gerd@gnu.org>
parents:
25528
diff
changeset
|
558 void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
559 void x_set_scroll_bar_foreground P_ ((struct frame *, Lisp_Object, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
560 Lisp_Object)); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
561 void x_set_scroll_bar_background P_ ((struct frame *, Lisp_Object, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
562 Lisp_Object)); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
563 static Lisp_Object x_default_scroll_bar_color_parameter P_ ((struct frame *, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
564 Lisp_Object, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
565 Lisp_Object, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
566 char *, char *, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
567 int)); |
389 | 568 |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
569 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
570 /* 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
|
571 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
|
572 not Emacs's own window. */ |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
573 |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
574 void |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
575 x_real_positions (f, xptr, yptr) |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
576 FRAME_PTR f; |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
577 int *xptr, *yptr; |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
578 { |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
579 int win_x, win_y, outer_x, outer_y; |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
580 int real_x = 0, real_y = 0; |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
581 int had_errors = 0; |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
582 Window win = f->output_data.x->parent_desc; |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
583 |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
584 BLOCK_INPUT; |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
585 |
69152
f2147c1027b6
* xterm.h (x_catch_errors) Return value changed to void.
Chong Yidong <cyd@stupidchicken.com>
parents:
69065
diff
changeset
|
586 x_catch_errors (FRAME_X_DISPLAY (f)); |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
587 |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
588 if (win == FRAME_X_DISPLAY_INFO (f)->root_window) |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
589 win = FRAME_OUTER_WINDOW (f); |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
590 |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
591 /* This loop traverses up the containment tree until we hit the root |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
592 window. Window managers may intersect many windows between our window |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
593 and the root window. The window we find just before the root window |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
594 should be the outer WM window. */ |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
595 for (;;) |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
596 { |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
597 Window wm_window, rootw; |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
598 Window *tmp_children; |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
599 unsigned int tmp_nchildren; |
43914
fed15ed090bc
(x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents:
43670
diff
changeset
|
600 int success; |
fed15ed090bc
(x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents:
43670
diff
changeset
|
601 |
fed15ed090bc
(x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents:
43670
diff
changeset
|
602 success = XQueryTree (FRAME_X_DISPLAY (f), win, &rootw, |
fed15ed090bc
(x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents:
43670
diff
changeset
|
603 &wm_window, &tmp_children, &tmp_nchildren); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
604 |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
605 had_errors = x_had_errors_p (FRAME_X_DISPLAY (f)); |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
606 |
43914
fed15ed090bc
(x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents:
43670
diff
changeset
|
607 /* Don't free tmp_children if XQueryTree failed. */ |
fed15ed090bc
(x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents:
43670
diff
changeset
|
608 if (! success) |
fed15ed090bc
(x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents:
43670
diff
changeset
|
609 break; |
fed15ed090bc
(x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents:
43670
diff
changeset
|
610 |
fed15ed090bc
(x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents:
43670
diff
changeset
|
611 XFree ((char *) tmp_children); |
fed15ed090bc
(x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents:
43670
diff
changeset
|
612 |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
613 if (wm_window == rootw || had_errors) |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
614 break; |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
615 |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
616 win = wm_window; |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
617 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
618 |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
619 if (! had_errors) |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
620 { |
67264
d50a6a8cfd1e
* xfns.c (x_real_positions): int ign => unsigned int.
Jan Djärv <jan.h.d@swipnet.se>
parents:
66931
diff
changeset
|
621 unsigned int ign; |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
622 Window child, rootw; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
623 |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
624 /* Get the real coordinates for the WM window upper left corner */ |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
625 XGetGeometry (FRAME_X_DISPLAY (f), win, |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
626 &rootw, &real_x, &real_y, &ign, &ign, &ign, &ign); |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
627 |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
628 /* Translate real coordinates to coordinates relative to our |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
629 window. For our window, the upper left corner is 0, 0. |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
630 Since the upper left corner of the WM window is outside |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
631 our window, win_x and win_y will be negative: |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
632 |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
633 ------------------ ---> x |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
634 | title | |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
635 | ----------------- v y |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
636 | | our window |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
637 */ |
17954
7c919d7f8217
(x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents:
17836
diff
changeset
|
638 XTranslateCoordinates (FRAME_X_DISPLAY (f), |
7c919d7f8217
(x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents:
17836
diff
changeset
|
639 |
7c919d7f8217
(x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents:
17836
diff
changeset
|
640 /* From-window, to-window. */ |
7c919d7f8217
(x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents:
17836
diff
changeset
|
641 FRAME_X_DISPLAY_INFO (f)->root_window, |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
642 FRAME_X_WINDOW (f), |
17954
7c919d7f8217
(x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents:
17836
diff
changeset
|
643 |
7c919d7f8217
(x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents:
17836
diff
changeset
|
644 /* From-position, to-position. */ |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
645 real_x, real_y, &win_x, &win_y, |
17954
7c919d7f8217
(x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents:
17836
diff
changeset
|
646 |
7c919d7f8217
(x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents:
17836
diff
changeset
|
647 /* Child of win. */ |
7c919d7f8217
(x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents:
17836
diff
changeset
|
648 &child); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
649 |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
650 if (FRAME_X_WINDOW (f) == FRAME_OUTER_WINDOW (f)) |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
651 { |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
652 outer_x = win_x; |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
653 outer_y = win_y; |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
654 } |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
655 else |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
656 { |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
657 XTranslateCoordinates (FRAME_X_DISPLAY (f), |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
658 |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
659 /* From-window, to-window. */ |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
660 FRAME_X_DISPLAY_INFO (f)->root_window, |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
661 FRAME_OUTER_WINDOW (f), |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
662 |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
663 /* From-position, to-position. */ |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
664 real_x, real_y, &outer_x, &outer_y, |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
665 |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
666 /* Child of win. */ |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
667 &child); |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
668 } |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
669 |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
670 had_errors = x_had_errors_p (FRAME_X_DISPLAY (f)); |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
671 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
672 |
69173
fdee8318ddc9
* xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary
Chong Yidong <cyd@stupidchicken.com>
parents:
69152
diff
changeset
|
673 x_uncatch_errors (); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
674 |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
675 UNBLOCK_INPUT; |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
676 |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
677 if (had_errors) return; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
678 |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
679 f->x_pixels_diff = -win_x; |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
680 f->y_pixels_diff = -win_y; |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
681 |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
682 FRAME_X_OUTPUT (f)->x_pixels_outer_diff = -outer_x; |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
683 FRAME_X_OUTPUT (f)->y_pixels_outer_diff = -outer_y; |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
684 |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
685 *xptr = real_x; |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
686 *yptr = real_y; |
7408
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
687 } |
65c133b66371
(x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7308
diff
changeset
|
688 |
389 | 689 |
10920
bb3f9aaf0e46
(defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents:
10742
diff
changeset
|
690 |
25528
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
691 |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
692 /* Gamma-correct COLOR on frame F. */ |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
693 |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
694 void |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
695 gamma_correct (f, color) |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
696 struct frame *f; |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
697 XColor *color; |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
698 { |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
699 if (f->gamma) |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
700 { |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
701 color->red = pow (color->red / 65535.0, f->gamma) * 65535.0 + 0.5; |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
702 color->green = pow (color->green / 65535.0, f->gamma) * 65535.0 + 0.5; |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
703 color->blue = pow (color->blue / 65535.0, f->gamma) * 65535.0 + 0.5; |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
704 } |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
705 } |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
706 |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
707 |
28096
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
708 /* Decide if color named COLOR_NAME is valid for use on frame F. If |
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
709 so, return the RGB values in COLOR. If ALLOC_P is non-zero, |
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
710 allocate the color. Value is zero if COLOR_NAME is invalid, or |
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
711 no color could be allocated. */ |
8675
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
712 |
389 | 713 int |
28096
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
714 x_defined_color (f, color_name, color, alloc_p) |
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
715 struct frame *f; |
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
716 char *color_name; |
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
717 XColor *color; |
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
718 int alloc_p; |
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
719 { |
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
720 int success_p; |
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
721 Display *dpy = FRAME_X_DISPLAY (f); |
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
722 Colormap cmap = FRAME_X_COLORMAP (f); |
389 | 723 |
724 BLOCK_INPUT; | |
28096
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
725 success_p = XParseColor (dpy, cmap, color_name, color); |
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
726 if (success_p && alloc_p) |
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
727 success_p = x_alloc_nearest_color (f, cmap, color); |
389 | 728 UNBLOCK_INPUT; |
729 | |
28096
244f283b3d03
(x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents:
28050
diff
changeset
|
730 return success_p; |
389 | 731 } |
732 | |
27987
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
733 |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
734 /* Return the pixel color value for color COLOR_NAME on frame F. If F |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
735 is a monochrome frame, return MONO_COLOR regardless of what ARG says. |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
736 Signal an error if color can't be allocated. */ |
389 | 737 |
738 int | |
27987
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
739 x_decode_color (f, color_name, mono_color) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
740 FRAME_PTR f; |
27987
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
741 Lisp_Object color_name; |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
742 int mono_color; |
389 | 743 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
744 XColor cdef; |
389 | 745 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
746 CHECK_STRING (color_name); |
27987
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
747 |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
748 #if 0 /* Don't do this. It's wrong when we're not using the default |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
749 colormap, it makes freeing difficult, and it's probably not |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
750 an important optimization. */ |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
751 if (strcmp (SDATA (color_name), "black") == 0) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
752 return BLACK_PIX_DEFAULT (f); |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
753 else if (strcmp (SDATA (color_name), "white") == 0) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
754 return WHITE_PIX_DEFAULT (f); |
27987
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
755 #endif |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
756 |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
757 /* Return MONO_COLOR for monochrome frames. */ |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
758 if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1) |
27987
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
759 return mono_color; |
389 | 760 |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26571
diff
changeset
|
761 /* x_defined_color is responsible for coping with failures |
11060
0a7048d331e6
(x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents:
11014
diff
changeset
|
762 by looking for a near-miss. */ |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
763 if (x_defined_color (f, SDATA (color_name), &cdef, 1)) |
11060
0a7048d331e6
(x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents:
11014
diff
changeset
|
764 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
|
765 |
71993
3f1637b3adcb
(x_decode_color): Use signal_error.
Kim F. Storm <storm@cua.dk>
parents:
71577
diff
changeset
|
766 signal_error ("Undefined color", color_name); |
27987
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
767 } |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
768 |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
769 |
389 | 770 |
38183
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
771 /* Change the `wait-for-wm' frame parameter of frame F. OLD_VALUE is |
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
772 the previous value of that parameter, NEW_VALUE is the new value. |
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
773 See also the comment of wait_for_wm in struct x_output. */ |
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
774 |
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
775 static void |
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
776 x_set_wait_for_wm (f, new_value, old_value) |
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
777 struct frame *f; |
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
778 Lisp_Object new_value, old_value; |
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
779 { |
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
780 f->output_data.x->wait_for_wm = !NILP (new_value); |
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
781 } |
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
782 |
51898
b65c743ccded
(x_bitmap_mask, x_create_bitmap_mask): New functions to handle mask of bitmaps.
Juanma Barranquero <lekktu@gmail.com>
parents:
51876
diff
changeset
|
783 #ifdef USE_GTK |
b65c743ccded
(x_bitmap_mask, x_create_bitmap_mask): New functions to handle mask of bitmaps.
Juanma Barranquero <lekktu@gmail.com>
parents:
51876
diff
changeset
|
784 |
52095
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
785 /* Set icon from FILE for frame F. By using GTK functions the icon |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
786 may be any format that GdkPixbuf knows about, i.e. not just bitmaps. */ |
51898
b65c743ccded
(x_bitmap_mask, x_create_bitmap_mask): New functions to handle mask of bitmaps.
Juanma Barranquero <lekktu@gmail.com>
parents:
51876
diff
changeset
|
787 |
b65c743ccded
(x_bitmap_mask, x_create_bitmap_mask): New functions to handle mask of bitmaps.
Juanma Barranquero <lekktu@gmail.com>
parents:
51876
diff
changeset
|
788 int |
53069
1218a42792ea
Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
53027
diff
changeset
|
789 xg_set_icon (f, file) |
52095
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
790 FRAME_PTR f; |
51898
b65c743ccded
(x_bitmap_mask, x_create_bitmap_mask): New functions to handle mask of bitmaps.
Juanma Barranquero <lekktu@gmail.com>
parents:
51876
diff
changeset
|
791 Lisp_Object file; |
b65c743ccded
(x_bitmap_mask, x_create_bitmap_mask): New functions to handle mask of bitmaps.
Juanma Barranquero <lekktu@gmail.com>
parents:
51876
diff
changeset
|
792 { |
52095
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
793 int result = 0; |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
794 Lisp_Object found; |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
795 |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
796 found = x_find_image_file (file); |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
797 |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
798 if (! NILP (found)) |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
799 { |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
800 GdkPixbuf *pixbuf; |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
801 GError *err = NULL; |
67264
d50a6a8cfd1e
* xfns.c (x_real_positions): int ign => unsigned int.
Jan Djärv <jan.h.d@swipnet.se>
parents:
66931
diff
changeset
|
802 char *filename = (char *) SDATA (found); |
52095
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
803 BLOCK_INPUT; |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
804 |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
805 pixbuf = gdk_pixbuf_new_from_file (filename, &err); |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
806 |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
807 if (pixbuf) |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
808 { |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
809 gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
810 pixbuf); |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
811 g_object_unref (pixbuf); |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
812 |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
813 result = 1; |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
814 } |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
815 else |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
816 g_error_free (err); |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
817 |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
818 UNBLOCK_INPUT; |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
819 } |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
820 |
a2208fe45c36
* xfns.c (xg_set_icon): Rewrite to compile with GTK 2.0 and 2.2.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52091
diff
changeset
|
821 return result; |
51898
b65c743ccded
(x_bitmap_mask, x_create_bitmap_mask): New functions to handle mask of bitmaps.
Juanma Barranquero <lekktu@gmail.com>
parents:
51876
diff
changeset
|
822 } |
66931
1a573209abf9
* xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents:
66502
diff
changeset
|
823 |
1a573209abf9
* xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents:
66502
diff
changeset
|
824 int |
1a573209abf9
* xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents:
66502
diff
changeset
|
825 xg_set_icon_from_xpm_data (f, data) |
1a573209abf9
* xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents:
66502
diff
changeset
|
826 FRAME_PTR f; |
1a573209abf9
* xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents:
66502
diff
changeset
|
827 char **data; |
1a573209abf9
* xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents:
66502
diff
changeset
|
828 { |
1a573209abf9
* xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents:
66502
diff
changeset
|
829 int result = 0; |
67264
d50a6a8cfd1e
* xfns.c (x_real_positions): int ign => unsigned int.
Jan Djärv <jan.h.d@swipnet.se>
parents:
66931
diff
changeset
|
830 GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) data); |
66931
1a573209abf9
* xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents:
66502
diff
changeset
|
831 |
1a573209abf9
* xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents:
66502
diff
changeset
|
832 if (!pixbuf) |
67264
d50a6a8cfd1e
* xfns.c (x_real_positions): int ign => unsigned int.
Jan Djärv <jan.h.d@swipnet.se>
parents:
66931
diff
changeset
|
833 return 0; |
d50a6a8cfd1e
* xfns.c (x_real_positions): int ign => unsigned int.
Jan Djärv <jan.h.d@swipnet.se>
parents:
66931
diff
changeset
|
834 |
d50a6a8cfd1e
* xfns.c (x_real_positions): int ign => unsigned int.
Jan Djärv <jan.h.d@swipnet.se>
parents:
66931
diff
changeset
|
835 gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), pixbuf); |
66931
1a573209abf9
* xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents:
66502
diff
changeset
|
836 g_object_unref (pixbuf); |
1a573209abf9
* xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents:
66502
diff
changeset
|
837 return 1; |
1a573209abf9
* xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents:
66502
diff
changeset
|
838 } |
51898
b65c743ccded
(x_bitmap_mask, x_create_bitmap_mask): New functions to handle mask of bitmaps.
Juanma Barranquero <lekktu@gmail.com>
parents:
51876
diff
changeset
|
839 #endif /* USE_GTK */ |
b65c743ccded
(x_bitmap_mask, x_create_bitmap_mask): New functions to handle mask of bitmaps.
Juanma Barranquero <lekktu@gmail.com>
parents:
51876
diff
changeset
|
840 |
38183
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
841 |
771 | 842 /* Functions called only from `x_set_frame_param' |
389 | 843 to set individual parameters. |
844 | |
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
|
845 If FRAME_X_WINDOW (f) is 0, |
771 | 846 the frame is being created and its X-window does not exist yet. |
389 | 847 In that case, just record the parameter's new value |
848 in the standard place; do not attempt to change the window. */ | |
849 | |
850 void | |
771 | 851 x_set_foreground_color (f, arg, oldval) |
852 struct frame *f; | |
389 | 853 Lisp_Object arg, oldval; |
854 { | |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
855 struct x_output *x = f->output_data.x; |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
856 unsigned long fg, old_fg; |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
857 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
858 fg = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
859 old_fg = x->foreground_pixel; |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
860 x->foreground_pixel = fg; |
21779
6aaa0268fe91
(x_set_foreground_color, x_set_background_color)
Richard M. Stallman <rms@gnu.org>
parents:
21555
diff
changeset
|
861 |
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
|
862 if (FRAME_X_WINDOW (f) != 0) |
389 | 863 { |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
864 Display *dpy = FRAME_X_DISPLAY (f); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
865 |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
866 BLOCK_INPUT; |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
867 XSetForeground (dpy, x->normal_gc, fg); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
868 XSetBackground (dpy, x->reverse_gc, fg); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
869 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
870 if (x->cursor_pixel == old_fg) |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
871 { |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
872 unload_color (f, x->cursor_pixel); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
873 x->cursor_pixel = x_copy_color (f, fg); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
874 XSetBackground (dpy, x->cursor_gc, x->cursor_pixel); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
875 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
876 |
389 | 877 UNBLOCK_INPUT; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
878 |
25593
9aecfcf3cb43
(x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents:
25550
diff
changeset
|
879 update_face_from_frame_parameter (f, Qforeground_color, arg); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
880 |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
881 if (FRAME_VISIBLE_P (f)) |
771 | 882 redraw_frame (f); |
389 | 883 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
884 |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
885 unload_color (f, old_fg); |
389 | 886 } |
887 | |
888 void | |
771 | 889 x_set_background_color (f, arg, oldval) |
890 struct frame *f; | |
389 | 891 Lisp_Object arg, oldval; |
892 { | |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
893 struct x_output *x = f->output_data.x; |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
894 unsigned long bg; |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
895 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
896 bg = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
897 unload_color (f, x->background_pixel); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
898 x->background_pixel = bg; |
21779
6aaa0268fe91
(x_set_foreground_color, x_set_background_color)
Richard M. Stallman <rms@gnu.org>
parents:
21555
diff
changeset
|
899 |
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
|
900 if (FRAME_X_WINDOW (f) != 0) |
389 | 901 { |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
902 Display *dpy = FRAME_X_DISPLAY (f); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
903 |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
904 BLOCK_INPUT; |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
905 XSetBackground (dpy, x->normal_gc, bg); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
906 XSetForeground (dpy, x->reverse_gc, bg); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
907 XSetWindowBackground (dpy, FRAME_X_WINDOW (f), bg); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
908 XSetForeground (dpy, x->cursor_gc, bg); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
909 |
49322 | 910 #ifdef USE_GTK |
911 xg_set_background_color (f, bg); | |
912 #endif | |
913 | |
39159
2c7a6a1b047e
(x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents:
38749
diff
changeset
|
914 #ifndef USE_TOOLKIT_SCROLL_BARS /* Turns out to be annoying with |
2c7a6a1b047e
(x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents:
38749
diff
changeset
|
915 toolkit scroll bars. */ |
2c7a6a1b047e
(x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents:
38749
diff
changeset
|
916 { |
2c7a6a1b047e
(x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents:
38749
diff
changeset
|
917 Lisp_Object bar; |
2c7a6a1b047e
(x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents:
38749
diff
changeset
|
918 for (bar = FRAME_SCROLL_BARS (f); |
2c7a6a1b047e
(x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents:
38749
diff
changeset
|
919 !NILP (bar); |
2c7a6a1b047e
(x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents:
38749
diff
changeset
|
920 bar = XSCROLL_BAR (bar)->next) |
2c7a6a1b047e
(x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents:
38749
diff
changeset
|
921 { |
2c7a6a1b047e
(x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents:
38749
diff
changeset
|
922 Window window = SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)); |
2c7a6a1b047e
(x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents:
38749
diff
changeset
|
923 XSetWindowBackground (dpy, window, bg); |
2c7a6a1b047e
(x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents:
38749
diff
changeset
|
924 } |
2c7a6a1b047e
(x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents:
38749
diff
changeset
|
925 } |
2c7a6a1b047e
(x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents:
38749
diff
changeset
|
926 #endif /* USE_TOOLKIT_SCROLL_BARS */ |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
927 |
389 | 928 UNBLOCK_INPUT; |
25593
9aecfcf3cb43
(x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents:
25550
diff
changeset
|
929 update_face_from_frame_parameter (f, Qbackground_color, arg); |
3075
878381e48b0d
* xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents:
3048
diff
changeset
|
930 |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
931 if (FRAME_VISIBLE_P (f)) |
771 | 932 redraw_frame (f); |
389 | 933 } |
934 } | |
935 | |
936 void | |
771 | 937 x_set_mouse_color (f, arg, oldval) |
938 struct frame *f; | |
389 | 939 Lisp_Object arg, oldval; |
940 { | |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
941 struct x_output *x = f->output_data.x; |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
942 Display *dpy = FRAME_X_DISPLAY (f); |
50236
156baddab173
Setup and use hand_cursor instead of cross_cursor.
Kim F. Storm <storm@cua.dk>
parents:
50099
diff
changeset
|
943 Cursor cursor, nontext_cursor, mode_cursor, hand_cursor; |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
944 Cursor hourglass_cursor, horizontal_drag_cursor; |
25075
9f5d679349e9
(x_set_mouse_color): Always unload the old color.
Karl Heuer <kwzh@gnu.org>
parents:
24994
diff
changeset
|
945 unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
946 unsigned long mask_color = x->background_pixel; |
25075
9f5d679349e9
(x_set_mouse_color): Always unload the old color.
Karl Heuer <kwzh@gnu.org>
parents:
24994
diff
changeset
|
947 |
9f5d679349e9
(x_set_mouse_color): Always unload the old color.
Karl Heuer <kwzh@gnu.org>
parents:
24994
diff
changeset
|
948 /* Don't let pointers be invisible. */ |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
949 if (mask_color == pixel) |
35261
ba1f849f9381
(x_set_mouse_color): Fix color allocation.
Gerd Moellmann <gerd@gnu.org>
parents:
35191
diff
changeset
|
950 { |
ba1f849f9381
(x_set_mouse_color): Fix color allocation.
Gerd Moellmann <gerd@gnu.org>
parents:
35191
diff
changeset
|
951 x_free_colors (f, &pixel, 1); |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
952 pixel = x_copy_color (f, x->foreground_pixel); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
953 } |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
954 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
955 unload_color (f, x->mouse_pixel); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
956 x->mouse_pixel = pixel; |
389 | 957 |
958 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
|
959 |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3512
diff
changeset
|
960 /* It's not okay to crash if the user selects a screwy cursor. */ |
69152
f2147c1027b6
* xterm.h (x_catch_errors) Return value changed to void.
Chong Yidong <cyd@stupidchicken.com>
parents:
69065
diff
changeset
|
961 x_catch_errors (dpy); |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
962 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
963 if (!NILP (Vx_pointer_shape)) |
389 | 964 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
965 CHECK_NUMBER (Vx_pointer_shape); |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
966 cursor = XCreateFontCursor (dpy, XINT (Vx_pointer_shape)); |
389 | 967 } |
968 else | |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
969 cursor = XCreateFontCursor (dpy, XC_xterm); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
970 x_check_errors (dpy, "bad text pointer cursor: %s"); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
971 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
972 if (!NILP (Vx_nontext_pointer_shape)) |
389 | 973 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
974 CHECK_NUMBER (Vx_nontext_pointer_shape); |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
975 nontext_cursor |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
976 = XCreateFontCursor (dpy, XINT (Vx_nontext_pointer_shape)); |
389 | 977 } |
978 else | |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
979 nontext_cursor = XCreateFontCursor (dpy, XC_left_ptr); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
980 x_check_errors (dpy, "bad nontext pointer cursor: %s"); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
981 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
982 if (!NILP (Vx_hourglass_pointer_shape)) |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
983 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
984 CHECK_NUMBER (Vx_hourglass_pointer_shape); |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
985 hourglass_cursor |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
986 = XCreateFontCursor (dpy, XINT (Vx_hourglass_pointer_shape)); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
987 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
988 else |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
989 hourglass_cursor = XCreateFontCursor (dpy, XC_watch); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
990 x_check_errors (dpy, "bad hourglass pointer cursor: %s"); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
991 |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
992 if (!NILP (Vx_mode_pointer_shape)) |
389 | 993 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
994 CHECK_NUMBER (Vx_mode_pointer_shape); |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
995 mode_cursor = XCreateFontCursor (dpy, XINT (Vx_mode_pointer_shape)); |
389 | 996 } |
997 else | |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
998 mode_cursor = XCreateFontCursor (dpy, XC_xterm); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
999 x_check_errors (dpy, "bad modeline pointer cursor: %s"); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1000 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1001 if (!NILP (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
|
1002 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
1003 CHECK_NUMBER (Vx_sensitive_text_pointer_shape); |
50236
156baddab173
Setup and use hand_cursor instead of cross_cursor.
Kim F. Storm <storm@cua.dk>
parents:
50099
diff
changeset
|
1004 hand_cursor |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1005 = XCreateFontCursor (dpy, 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
|
1006 } |
e0938c42218c
(syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6610
diff
changeset
|
1007 else |
50236
156baddab173
Setup and use hand_cursor instead of cross_cursor.
Kim F. Storm <storm@cua.dk>
parents:
50099
diff
changeset
|
1008 hand_cursor = XCreateFontCursor (dpy, XC_hand2); |
389 | 1009 |
33960
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
1010 if (!NILP (Vx_window_horizontal_drag_shape)) |
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
1011 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
1012 CHECK_NUMBER (Vx_window_horizontal_drag_shape); |
33960
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
1013 horizontal_drag_cursor |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1014 = XCreateFontCursor (dpy, XINT (Vx_window_horizontal_drag_shape)); |
33960
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
1015 } |
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
1016 else |
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
1017 horizontal_drag_cursor |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1018 = XCreateFontCursor (dpy, XC_sb_h_double_arrow); |
33960
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
1019 |
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
|
1020 /* Check and report errors with the above calls. */ |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1021 x_check_errors (dpy, "can't set cursor shape: %s"); |
69173
fdee8318ddc9
* xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary
Chong Yidong <cyd@stupidchicken.com>
parents:
69152
diff
changeset
|
1022 x_uncatch_errors (); |
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
|
1023 |
389 | 1024 { |
1025 XColor fore_color, back_color; | |
1026 | |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1027 fore_color.pixel = x->mouse_pixel; |
32606
78b4e9f31087
(x_to_xcolors, x_set_mouse_color, lookup_pixel_color)
Gerd Moellmann <gerd@gnu.org>
parents:
32549
diff
changeset
|
1028 x_query_color (f, &fore_color); |
389 | 1029 back_color.pixel = mask_color; |
32606
78b4e9f31087
(x_to_xcolors, x_set_mouse_color, lookup_pixel_color)
Gerd Moellmann <gerd@gnu.org>
parents:
32549
diff
changeset
|
1030 x_query_color (f, &back_color); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1031 |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1032 XRecolorCursor (dpy, cursor, &fore_color, &back_color); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1033 XRecolorCursor (dpy, nontext_cursor, &fore_color, &back_color); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1034 XRecolorCursor (dpy, mode_cursor, &fore_color, &back_color); |
50236
156baddab173
Setup and use hand_cursor instead of cross_cursor.
Kim F. Storm <storm@cua.dk>
parents:
50099
diff
changeset
|
1035 XRecolorCursor (dpy, hand_cursor, &fore_color, &back_color); |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1036 XRecolorCursor (dpy, hourglass_cursor, &fore_color, &back_color); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1037 XRecolorCursor (dpy, horizontal_drag_cursor, &fore_color, &back_color); |
389 | 1038 } |
1039 | |
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
|
1040 if (FRAME_X_WINDOW (f) != 0) |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1041 XDefineCursor (dpy, FRAME_X_WINDOW (f), cursor); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1042 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1043 if (cursor != x->text_cursor |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1044 && x->text_cursor != 0) |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1045 XFreeCursor (dpy, x->text_cursor); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1046 x->text_cursor = cursor; |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1047 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1048 if (nontext_cursor != x->nontext_cursor |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1049 && x->nontext_cursor != 0) |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1050 XFreeCursor (dpy, x->nontext_cursor); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1051 x->nontext_cursor = nontext_cursor; |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1052 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1053 if (hourglass_cursor != x->hourglass_cursor |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1054 && x->hourglass_cursor != 0) |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1055 XFreeCursor (dpy, x->hourglass_cursor); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1056 x->hourglass_cursor = hourglass_cursor; |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1057 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1058 if (mode_cursor != x->modeline_cursor |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1059 && x->modeline_cursor != 0) |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1060 XFreeCursor (dpy, f->output_data.x->modeline_cursor); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1061 x->modeline_cursor = mode_cursor; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1062 |
50236
156baddab173
Setup and use hand_cursor instead of cross_cursor.
Kim F. Storm <storm@cua.dk>
parents:
50099
diff
changeset
|
1063 if (hand_cursor != x->hand_cursor |
156baddab173
Setup and use hand_cursor instead of cross_cursor.
Kim F. Storm <storm@cua.dk>
parents:
50099
diff
changeset
|
1064 && x->hand_cursor != 0) |
156baddab173
Setup and use hand_cursor instead of cross_cursor.
Kim F. Storm <storm@cua.dk>
parents:
50099
diff
changeset
|
1065 XFreeCursor (dpy, x->hand_cursor); |
156baddab173
Setup and use hand_cursor instead of cross_cursor.
Kim F. Storm <storm@cua.dk>
parents:
50099
diff
changeset
|
1066 x->hand_cursor = hand_cursor; |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1067 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1068 if (horizontal_drag_cursor != x->horizontal_drag_cursor |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1069 && x->horizontal_drag_cursor != 0) |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1070 XFreeCursor (dpy, x->horizontal_drag_cursor); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1071 x->horizontal_drag_cursor = horizontal_drag_cursor; |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1072 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1073 XFlush (dpy); |
389 | 1074 UNBLOCK_INPUT; |
25593
9aecfcf3cb43
(x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents:
25550
diff
changeset
|
1075 |
9aecfcf3cb43
(x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents:
25550
diff
changeset
|
1076 update_face_from_frame_parameter (f, Qmouse_color, arg); |
389 | 1077 } |
1078 | |
1079 void | |
771 | 1080 x_set_cursor_color (f, arg, oldval) |
1081 struct frame *f; | |
389 | 1082 Lisp_Object arg, oldval; |
1083 { | |
21779
6aaa0268fe91
(x_set_foreground_color, x_set_background_color)
Richard M. Stallman <rms@gnu.org>
parents:
21555
diff
changeset
|
1084 unsigned long fore_pixel, pixel; |
28355
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1085 int fore_pixel_allocated_p = 0, pixel_allocated_p = 0; |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1086 struct x_output *x = f->output_data.x; |
28355
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1087 |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1088 if (!NILP (Vx_cursor_fore_pixel)) |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1089 { |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1090 fore_pixel = x_decode_color (f, Vx_cursor_fore_pixel, |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1091 WHITE_PIX_DEFAULT (f)); |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1092 fore_pixel_allocated_p = 1; |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1093 } |
389 | 1094 else |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1095 fore_pixel = x->background_pixel; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1096 |
21779
6aaa0268fe91
(x_set_foreground_color, x_set_background_color)
Richard M. Stallman <rms@gnu.org>
parents:
21555
diff
changeset
|
1097 pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
28355
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1098 pixel_allocated_p = 1; |
21779
6aaa0268fe91
(x_set_foreground_color, x_set_background_color)
Richard M. Stallman <rms@gnu.org>
parents:
21555
diff
changeset
|
1099 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1100 /* Make sure that the cursor color differs from the background color. */ |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1101 if (pixel == x->background_pixel) |
389 | 1102 { |
28355
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1103 if (pixel_allocated_p) |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1104 { |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1105 x_free_colors (f, &pixel, 1); |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1106 pixel_allocated_p = 0; |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1107 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1108 |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1109 pixel = x->mouse_pixel; |
21779
6aaa0268fe91
(x_set_foreground_color, x_set_background_color)
Richard M. Stallman <rms@gnu.org>
parents:
21555
diff
changeset
|
1110 if (pixel == fore_pixel) |
28355
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1111 { |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1112 if (fore_pixel_allocated_p) |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1113 { |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1114 x_free_colors (f, &fore_pixel, 1); |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1115 fore_pixel_allocated_p = 0; |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1116 } |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1117 fore_pixel = x->background_pixel; |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1118 } |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1119 } |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1120 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1121 unload_color (f, x->cursor_foreground_pixel); |
28355
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1122 if (!fore_pixel_allocated_p) |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1123 fore_pixel = x_copy_color (f, fore_pixel); |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1124 x->cursor_foreground_pixel = fore_pixel; |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1125 |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1126 unload_color (f, x->cursor_pixel); |
28355
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1127 if (!pixel_allocated_p) |
11d7a6fdad5f
(x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents:
28347
diff
changeset
|
1128 pixel = x_copy_color (f, pixel); |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1129 x->cursor_pixel = pixel; |
21779
6aaa0268fe91
(x_set_foreground_color, x_set_background_color)
Richard M. Stallman <rms@gnu.org>
parents:
21555
diff
changeset
|
1130 |
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
|
1131 if (FRAME_X_WINDOW (f) != 0) |
389 | 1132 { |
1133 BLOCK_INPUT; | |
37762
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1134 XSetBackground (FRAME_X_DISPLAY (f), x->cursor_gc, x->cursor_pixel); |
ddf0a963805f
(x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents:
37608
diff
changeset
|
1135 XSetForeground (FRAME_X_DISPLAY (f), x->cursor_gc, fore_pixel); |
389 | 1136 UNBLOCK_INPUT; |
1137 | |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1138 if (FRAME_VISIBLE_P (f)) |
389 | 1139 { |
15999
0e148af7d4ec
(x_set_cursor_color): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15942
diff
changeset
|
1140 x_update_cursor (f, 0); |
0e148af7d4ec
(x_set_cursor_color): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents:
15942
diff
changeset
|
1141 x_update_cursor (f, 1); |
389 | 1142 } |
1143 } | |
25593
9aecfcf3cb43
(x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents:
25550
diff
changeset
|
1144 |
9aecfcf3cb43
(x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents:
25550
diff
changeset
|
1145 update_face_from_frame_parameter (f, Qcursor_color, arg); |
389 | 1146 } |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1147 |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1148 /* Set the border-color of frame F to pixel value PIX. |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1149 Note that this does not fully take effect if done before |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1150 F has an x-window. */ |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1151 |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1152 void |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1153 x_set_border_pixel (f, pix) |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1154 struct frame *f; |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1155 int pix; |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1156 { |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1157 unload_color (f, f->output_data.x->border_pixel); |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1158 f->output_data.x->border_pixel = pix; |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1159 |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
1160 if (FRAME_X_WINDOW (f) != 0 && f->border_width > 0) |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1161 { |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1162 BLOCK_INPUT; |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1163 XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1164 (unsigned long)pix); |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1165 UNBLOCK_INPUT; |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1166 |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1167 if (FRAME_VISIBLE_P (f)) |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1168 redraw_frame (f); |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1169 } |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1170 } |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1171 |
771 | 1172 /* Set the border-color of frame F to value described by ARG. |
389 | 1173 ARG can be a string naming a color. |
1174 The border-color is used for the border that is drawn by the X server. | |
1175 Note that this does not fully take effect if done before | |
771 | 1176 F has an x-window; it must be redone when the window is created. |
389 | 1177 |
1178 Note: this is done in two routines because of the way X10 works. | |
1179 | |
1180 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
|
1181 and so emacs' border colors may be overridden. */ |
389 | 1182 |
1183 void | |
771 | 1184 x_set_border_color (f, arg, oldval) |
1185 struct frame *f; | |
389 | 1186 Lisp_Object arg, oldval; |
1187 { | |
1188 int pix; | |
1189 | |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
1190 CHECK_STRING (arg); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1191 pix = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); |
771 | 1192 x_set_border_pixel (f, pix); |
25593
9aecfcf3cb43
(x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents:
25550
diff
changeset
|
1193 update_face_from_frame_parameter (f, Qborder_color, arg); |
389 | 1194 } |
1195 | |
28347
ce7dddf6dfb7
(x_specified_cursor_type): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
28229
diff
changeset
|
1196 |
ce7dddf6dfb7
(x_specified_cursor_type): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
28229
diff
changeset
|
1197 void |
ce7dddf6dfb7
(x_specified_cursor_type): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
28229
diff
changeset
|
1198 x_set_cursor_type (f, arg, oldval) |
ce7dddf6dfb7
(x_specified_cursor_type): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
28229
diff
changeset
|
1199 FRAME_PTR f; |
ce7dddf6dfb7
(x_specified_cursor_type): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
28229
diff
changeset
|
1200 Lisp_Object arg, oldval; |
ce7dddf6dfb7
(x_specified_cursor_type): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
28229
diff
changeset
|
1201 { |
47142
21cac7a2dcb9
(Vblink_cursor_alist): Removed.
Kim F. Storm <storm@cua.dk>
parents:
47086
diff
changeset
|
1202 set_frame_cursor_types (f, arg); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1203 |
43987
ea6530f23937
(x_set_cursor_type): Set cursor_type_changed,
Richard M. Stallman <rms@gnu.org>
parents:
43917
diff
changeset
|
1204 /* Make sure the cursor gets redrawn. */ |
ea6530f23937
(x_set_cursor_type): Set cursor_type_changed,
Richard M. Stallman <rms@gnu.org>
parents:
43917
diff
changeset
|
1205 cursor_type_changed = 1; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1206 } |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1207 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
1208 void |
771 | 1209 x_set_icon_type (f, arg, oldval) |
1210 struct frame *f; | |
389 | 1211 Lisp_Object arg, oldval; |
1212 { | |
1213 int result; | |
1214 | |
9543
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1215 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
|
1216 { |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1217 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
|
1218 return; |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1219 } |
3cf8aa53c4cf
(x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents:
9528
diff
changeset
|
1220 else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil)) |
389 | 1221 return; |
1222 | |
1223 BLOCK_INPUT; | |
485 | 1224 if (NILP (arg)) |
12073 | 1225 result = x_text_icon (f, |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
1226 (char *) SDATA ((!NILP (f->icon_name) |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
1227 ? f->icon_name |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
1228 : f->name))); |
9563 | 1229 else |
1230 result = x_bitmap_icon (f, arg); | |
389 | 1231 |
1232 if (result) | |
1233 { | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
1234 UNBLOCK_INPUT; |
9353
30659ed71a1b
(x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents:
9329
diff
changeset
|
1235 error ("No icon window available"); |
389 | 1236 } |
1237 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1238 XFlush (FRAME_X_DISPLAY (f)); |
389 | 1239 UNBLOCK_INPUT; |
1240 } | |
1241 | |
12073 | 1242 void |
1243 x_set_icon_name (f, arg, oldval) | |
1244 struct frame *f; | |
1245 Lisp_Object arg, oldval; | |
1246 { | |
1247 int result; | |
1248 | |
1249 if (STRINGP (arg)) | |
1250 { | |
1251 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) | |
1252 return; | |
1253 } | |
71166
54189ea7ad2a
* xfns.c (x_set_icon_name): No-op if arg is non-nil and not a
Chong Yidong <cyd@stupidchicken.com>
parents:
69729
diff
changeset
|
1254 else if (!NILP (arg) || NILP (oldval)) |
12073 | 1255 return; |
1256 | |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
1257 f->icon_name = arg; |
12073 | 1258 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
1259 if (f->output_data.x->icon_bitmap != 0) |
12073 | 1260 return; |
1261 | |
1262 BLOCK_INPUT; | |
1263 | |
1264 result = x_text_icon (f, | |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
1265 (char *) SDATA ((!NILP (f->icon_name) |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
1266 ? f->icon_name |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
1267 : !NILP (f->title) |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
1268 ? f->title |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
1269 : f->name))); |
12073 | 1270 |
1271 if (result) | |
1272 { | |
1273 UNBLOCK_INPUT; | |
1274 error ("No icon window available"); | |
1275 } | |
1276 | |
1277 XFlush (FRAME_X_DISPLAY (f)); | |
1278 UNBLOCK_INPUT; | |
1279 } | |
31930
9c779861abff
(x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents:
31902
diff
changeset
|
1280 |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1281 |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1282 void |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1283 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
|
1284 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
|
1285 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
|
1286 { |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1287 int nlines; |
53825
6635e77a2c09
* xfns.c (x_create_bitmap_mask): Removed unused variable depth.
Jan Djärv <jan.h.d@swipnet.se>
parents:
53787
diff
changeset
|
1288 #if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK) |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1289 int olines = FRAME_MENU_BAR_LINES (f); |
25715
feaedc03dbc8
(x_set_background_color): Remove unused variable(s).
Gerd Moellmann <gerd@gnu.org>
parents:
25691
diff
changeset
|
1290 #endif |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1291 |
2880
9a78169e44df
* xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents:
2842
diff
changeset
|
1292 /* 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
|
1293 most of the commands try to apply themselves to the minibuffer |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1294 frame itself, and get an error because you can't switch buffers |
2880
9a78169e44df
* xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents:
2842
diff
changeset
|
1295 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
|
1296 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
|
1297 return; |
9a78169e44df
* xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents:
2842
diff
changeset
|
1298 |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
1299 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
|
1300 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
|
1301 else |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1302 nlines = 0; |
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1303 |
17556
c0f8f4264f7a
(x_set_menu_bar_lines): Increment windows_or_buffers_changed.
Richard M. Stallman <rms@gnu.org>
parents:
17106
diff
changeset
|
1304 /* Make sure we redisplay all windows in this frame. */ |
c0f8f4264f7a
(x_set_menu_bar_lines): Increment windows_or_buffers_changed.
Richard M. Stallman <rms@gnu.org>
parents:
17106
diff
changeset
|
1305 windows_or_buffers_changed++; |
c0f8f4264f7a
(x_set_menu_bar_lines): Increment windows_or_buffers_changed.
Richard M. Stallman <rms@gnu.org>
parents:
17106
diff
changeset
|
1306 |
49322 | 1307 #if defined (USE_X_TOOLKIT) || defined (USE_GTK) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1308 FRAME_MENU_BAR_LINES (f) = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1309 if (nlines) |
12832
0d750e41c4f2
(x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents:
12773
diff
changeset
|
1310 { |
0d750e41c4f2
(x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents:
12773
diff
changeset
|
1311 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
|
1312 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
|
1313 /* 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
|
1314 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
|
1315 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1316 else |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1317 { |
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
|
1318 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
|
1319 free_frame_menubar (f); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1320 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
|
1321 if (FRAME_X_P (f)) |
714433bead7f
(x_set_menu_bar_lines) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents:
13508
diff
changeset
|
1322 f->output_data.x->menubar_widget = 0; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1323 } |
49322 | 1324 #else /* not USE_X_TOOLKIT && not USE_GTK */ |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
1325 FRAME_MENU_BAR_LINES (f) = nlines; |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1326 change_window_heights (f->root_window, nlines - olines); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1327 #endif /* not USE_X_TOOLKIT */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1328 adjust_glyphs (f); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1329 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1330 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1331 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1332 /* Set the number of lines used for the tool bar of frame F to VALUE. |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1333 VALUE not an integer, or < 0 means set the lines to zero. OLDVAL |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1334 is the old number of tool bar lines. This function changes the |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1335 height of all windows on frame F to match the new tool bar height. |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1336 The frame's height doesn't change. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1337 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1338 void |
25544
693ca9ba497a
Change spelling of `toolbar' to `tool_bar' or `tool-bar'.
Gerd Moellmann <gerd@gnu.org>
parents:
25528
diff
changeset
|
1339 x_set_tool_bar_lines (f, value, oldval) |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1340 struct frame *f; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1341 Lisp_Object value, oldval; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1342 { |
31930
9c779861abff
(x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents:
31902
diff
changeset
|
1343 int delta, nlines, root_height; |
9c779861abff
(x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents:
31902
diff
changeset
|
1344 Lisp_Object root_window; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1345 |
35819
74e2d9de2fc1
(x_set_tool_bar_lines): Do nothing If frame is
Gerd Moellmann <gerd@gnu.org>
parents:
35733
diff
changeset
|
1346 /* Treat tool bars like menu bars. */ |
74e2d9de2fc1
(x_set_tool_bar_lines): Do nothing If frame is
Gerd Moellmann <gerd@gnu.org>
parents:
35733
diff
changeset
|
1347 if (FRAME_MINIBUF_ONLY_P (f)) |
74e2d9de2fc1
(x_set_tool_bar_lines): Do nothing If frame is
Gerd Moellmann <gerd@gnu.org>
parents:
35733
diff
changeset
|
1348 return; |
74e2d9de2fc1
(x_set_tool_bar_lines): Do nothing If frame is
Gerd Moellmann <gerd@gnu.org>
parents:
35733
diff
changeset
|
1349 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1350 /* Use VALUE only if an integer >= 0. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1351 if (INTEGERP (value) && XINT (value) >= 0) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1352 nlines = XFASTINT (value); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1353 else |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1354 nlines = 0; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1355 |
49322 | 1356 #ifdef USE_GTK |
1357 FRAME_TOOL_BAR_LINES (f) = 0; | |
1358 if (nlines) | |
1359 { | |
1360 FRAME_EXTERNAL_TOOL_BAR (f) = 1; | |
1361 if (FRAME_X_P (f) && f->output_data.x->toolbar_widget == 0) | |
1362 /* Make sure next redisplay shows the tool bar. */ | |
1363 XWINDOW (FRAME_SELECTED_WINDOW (f))->update_mode_line = Qt; | |
1364 update_frame_tool_bar (f); | |
1365 } | |
1366 else | |
1367 { | |
1368 if (FRAME_EXTERNAL_TOOL_BAR (f)) | |
1369 free_frame_tool_bar (f); | |
1370 FRAME_EXTERNAL_TOOL_BAR (f) = 0; | |
1371 } | |
1372 | |
1373 return; | |
1374 #endif | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1375 |
49322 | 1376 /* Make sure we redisplay all windows in this frame. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1377 ++windows_or_buffers_changed; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1378 |
25544
693ca9ba497a
Change spelling of `toolbar' to `tool_bar' or `tool-bar'.
Gerd Moellmann <gerd@gnu.org>
parents:
25528
diff
changeset
|
1379 delta = nlines - FRAME_TOOL_BAR_LINES (f); |
31930
9c779861abff
(x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents:
31902
diff
changeset
|
1380 |
9c779861abff
(x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents:
31902
diff
changeset
|
1381 /* Don't resize the tool-bar to more than we have room for. */ |
9c779861abff
(x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents:
31902
diff
changeset
|
1382 root_window = FRAME_ROOT_WINDOW (f); |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
1383 root_height = WINDOW_TOTAL_LINES (XWINDOW (root_window)); |
31930
9c779861abff
(x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents:
31902
diff
changeset
|
1384 if (root_height - delta < 1) |
9c779861abff
(x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents:
31902
diff
changeset
|
1385 { |
9c779861abff
(x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents:
31902
diff
changeset
|
1386 delta = root_height - 1; |
9c779861abff
(x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents:
31902
diff
changeset
|
1387 nlines = FRAME_TOOL_BAR_LINES (f) + delta; |
9c779861abff
(x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents:
31902
diff
changeset
|
1388 } |
9c779861abff
(x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents:
31902
diff
changeset
|
1389 |
25544
693ca9ba497a
Change spelling of `toolbar' to `tool_bar' or `tool-bar'.
Gerd Moellmann <gerd@gnu.org>
parents:
25528
diff
changeset
|
1390 FRAME_TOOL_BAR_LINES (f) = nlines; |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1391 change_window_heights (root_window, delta); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1392 adjust_glyphs (f); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1393 |
31999
d862c73ea0d5
(x_set_tool_bar_lines): Clear frame when tool bar
Gerd Moellmann <gerd@gnu.org>
parents:
31930
diff
changeset
|
1394 /* We also have to make sure that the internal border at the top of |
d862c73ea0d5
(x_set_tool_bar_lines): Clear frame when tool bar
Gerd Moellmann <gerd@gnu.org>
parents:
31930
diff
changeset
|
1395 the frame, below the menu bar or tool bar, is redrawn when the |
d862c73ea0d5
(x_set_tool_bar_lines): Clear frame when tool bar
Gerd Moellmann <gerd@gnu.org>
parents:
31930
diff
changeset
|
1396 tool bar disappears. This is so because the internal border is |
d862c73ea0d5
(x_set_tool_bar_lines): Clear frame when tool bar
Gerd Moellmann <gerd@gnu.org>
parents:
31930
diff
changeset
|
1397 below the tool bar if one is displayed, but is below the menu bar |
d862c73ea0d5
(x_set_tool_bar_lines): Clear frame when tool bar
Gerd Moellmann <gerd@gnu.org>
parents:
31930
diff
changeset
|
1398 if there isn't a tool bar. The tool bar draws into the area |
d862c73ea0d5
(x_set_tool_bar_lines): Clear frame when tool bar
Gerd Moellmann <gerd@gnu.org>
parents:
31930
diff
changeset
|
1399 below the menu bar. */ |
d862c73ea0d5
(x_set_tool_bar_lines): Clear frame when tool bar
Gerd Moellmann <gerd@gnu.org>
parents:
31930
diff
changeset
|
1400 if (FRAME_X_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0) |
d862c73ea0d5
(x_set_tool_bar_lines): Clear frame when tool bar
Gerd Moellmann <gerd@gnu.org>
parents:
31930
diff
changeset
|
1401 { |
d862c73ea0d5
(x_set_tool_bar_lines): Clear frame when tool bar
Gerd Moellmann <gerd@gnu.org>
parents:
31930
diff
changeset
|
1402 updating_frame = f; |
d862c73ea0d5
(x_set_tool_bar_lines): Clear frame when tool bar
Gerd Moellmann <gerd@gnu.org>
parents:
31930
diff
changeset
|
1403 clear_frame (); |
33601
1ee8ea329b7b
(x_set_tool_bar_lines): When clearing the frame, also
Gerd Moellmann <gerd@gnu.org>
parents:
33589
diff
changeset
|
1404 clear_current_matrices (f); |
31999
d862c73ea0d5
(x_set_tool_bar_lines): Clear frame when tool bar
Gerd Moellmann <gerd@gnu.org>
parents:
31930
diff
changeset
|
1405 updating_frame = NULL; |
d862c73ea0d5
(x_set_tool_bar_lines): Clear frame when tool bar
Gerd Moellmann <gerd@gnu.org>
parents:
31930
diff
changeset
|
1406 } |
33747
e0e2461a24fe
(x_set_tool_bar_lines): Clear internal border when
Gerd Moellmann <gerd@gnu.org>
parents:
33713
diff
changeset
|
1407 |
e0e2461a24fe
(x_set_tool_bar_lines): Clear internal border when
Gerd Moellmann <gerd@gnu.org>
parents:
33713
diff
changeset
|
1408 /* If the tool bar gets smaller, the internal border below it |
e0e2461a24fe
(x_set_tool_bar_lines): Clear internal border when
Gerd Moellmann <gerd@gnu.org>
parents:
33713
diff
changeset
|
1409 has to be cleared. It was formerly part of the display |
e0e2461a24fe
(x_set_tool_bar_lines): Clear internal border when
Gerd Moellmann <gerd@gnu.org>
parents:
33713
diff
changeset
|
1410 of the larger tool bar, and updating windows won't clear it. */ |
e0e2461a24fe
(x_set_tool_bar_lines): Clear internal border when
Gerd Moellmann <gerd@gnu.org>
parents:
33713
diff
changeset
|
1411 if (delta < 0) |
e0e2461a24fe
(x_set_tool_bar_lines): Clear internal border when
Gerd Moellmann <gerd@gnu.org>
parents:
33713
diff
changeset
|
1412 { |
e0e2461a24fe
(x_set_tool_bar_lines): Clear internal border when
Gerd Moellmann <gerd@gnu.org>
parents:
33713
diff
changeset
|
1413 int height = FRAME_INTERNAL_BORDER_WIDTH (f); |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
1414 int width = FRAME_PIXEL_WIDTH (f); |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
1415 int y = nlines * FRAME_LINE_HEIGHT (f); |
33747
e0e2461a24fe
(x_set_tool_bar_lines): Clear internal border when
Gerd Moellmann <gerd@gnu.org>
parents:
33713
diff
changeset
|
1416 |
59980
7f8e4c715b72
(x_set_tool_bar_lines): Check that width and height is greater than
Jan Djärv <jan.h.d@swipnet.se>
parents:
59976
diff
changeset
|
1417 /* height can be zero here. */ |
7f8e4c715b72
(x_set_tool_bar_lines): Check that width and height is greater than
Jan Djärv <jan.h.d@swipnet.se>
parents:
59976
diff
changeset
|
1418 if (height > 0 && width > 0) |
7f8e4c715b72
(x_set_tool_bar_lines): Check that width and height is greater than
Jan Djärv <jan.h.d@swipnet.se>
parents:
59976
diff
changeset
|
1419 { |
7f8e4c715b72
(x_set_tool_bar_lines): Check that width and height is greater than
Jan Djärv <jan.h.d@swipnet.se>
parents:
59976
diff
changeset
|
1420 BLOCK_INPUT; |
7f8e4c715b72
(x_set_tool_bar_lines): Check that width and height is greater than
Jan Djärv <jan.h.d@swipnet.se>
parents:
59976
diff
changeset
|
1421 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
7f8e4c715b72
(x_set_tool_bar_lines): Check that width and height is greater than
Jan Djärv <jan.h.d@swipnet.se>
parents:
59976
diff
changeset
|
1422 0, y, width, height, False); |
7f8e4c715b72
(x_set_tool_bar_lines): Check that width and height is greater than
Jan Djärv <jan.h.d@swipnet.se>
parents:
59976
diff
changeset
|
1423 UNBLOCK_INPUT; |
7f8e4c715b72
(x_set_tool_bar_lines): Check that width and height is greater than
Jan Djärv <jan.h.d@swipnet.se>
parents:
59976
diff
changeset
|
1424 } |
38625
0bfdfd449f4a
(x_set_tool_bar_lines): Clear the tool bar window's
Gerd Moellmann <gerd@gnu.org>
parents:
38575
diff
changeset
|
1425 |
0bfdfd449f4a
(x_set_tool_bar_lines): Clear the tool bar window's
Gerd Moellmann <gerd@gnu.org>
parents:
38575
diff
changeset
|
1426 if (WINDOWP (f->tool_bar_window)) |
0bfdfd449f4a
(x_set_tool_bar_lines): Clear the tool bar window's
Gerd Moellmann <gerd@gnu.org>
parents:
38575
diff
changeset
|
1427 clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix); |
33747
e0e2461a24fe
(x_set_tool_bar_lines): Clear internal border when
Gerd Moellmann <gerd@gnu.org>
parents:
33713
diff
changeset
|
1428 } |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1429 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1430 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1431 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1432 /* Set the foreground color for scroll bars on frame F to VALUE. |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1433 VALUE should be a string, a color name. If it isn't a string or |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1434 isn't a valid color name, do nothing. OLDVAL is the old value of |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1435 the frame parameter. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1436 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1437 void |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1438 x_set_scroll_bar_foreground (f, value, oldval) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1439 struct frame *f; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1440 Lisp_Object value, oldval; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1441 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1442 unsigned long pixel; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1443 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1444 if (STRINGP (value)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1445 pixel = x_decode_color (f, value, BLACK_PIX_DEFAULT (f)); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1446 else |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1447 pixel = -1; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1448 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1449 if (f->output_data.x->scroll_bar_foreground_pixel != -1) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1450 unload_color (f, f->output_data.x->scroll_bar_foreground_pixel); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1451 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1452 f->output_data.x->scroll_bar_foreground_pixel = pixel; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1453 if (FRAME_X_WINDOW (f) && FRAME_VISIBLE_P (f)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1454 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1455 /* Remove all scroll bars because they have wrong colors. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1456 if (condemn_scroll_bars_hook) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1457 (*condemn_scroll_bars_hook) (f); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1458 if (judge_scroll_bars_hook) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1459 (*judge_scroll_bars_hook) (f); |
25593
9aecfcf3cb43
(x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents:
25550
diff
changeset
|
1460 |
9aecfcf3cb43
(x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents:
25550
diff
changeset
|
1461 update_face_from_frame_parameter (f, Qscroll_bar_foreground, value); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1462 redraw_frame (f); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1463 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1464 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1465 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1466 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1467 /* Set the background color for scroll bars on frame F to VALUE VALUE |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1468 should be a string, a color name. If it isn't a string or isn't a |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1469 valid color name, do nothing. OLDVAL is the old value of the frame |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1470 parameter. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1471 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1472 void |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1473 x_set_scroll_bar_background (f, value, oldval) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1474 struct frame *f; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1475 Lisp_Object value, oldval; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1476 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1477 unsigned long pixel; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1478 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1479 if (STRINGP (value)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1480 pixel = x_decode_color (f, value, WHITE_PIX_DEFAULT (f)); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1481 else |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1482 pixel = -1; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1483 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1484 if (f->output_data.x->scroll_bar_background_pixel != -1) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1485 unload_color (f, f->output_data.x->scroll_bar_background_pixel); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1486 |
39619
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
1487 #ifdef USE_TOOLKIT_SCROLL_BARS |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
1488 /* Scrollbar shadow colors. */ |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
1489 if (f->output_data.x->scroll_bar_top_shadow_pixel != -1) |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
1490 { |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
1491 unload_color (f, f->output_data.x->scroll_bar_top_shadow_pixel); |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
1492 f->output_data.x->scroll_bar_top_shadow_pixel = -1; |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
1493 } |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
1494 if (f->output_data.x->scroll_bar_bottom_shadow_pixel != -1) |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
1495 { |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
1496 unload_color (f, f->output_data.x->scroll_bar_bottom_shadow_pixel); |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
1497 f->output_data.x->scroll_bar_bottom_shadow_pixel = -1; |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
1498 } |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
1499 #endif /* USE_TOOLKIT_SCROLL_BARS */ |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
1500 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1501 f->output_data.x->scroll_bar_background_pixel = pixel; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1502 if (FRAME_X_WINDOW (f) && FRAME_VISIBLE_P (f)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1503 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1504 /* Remove all scroll bars because they have wrong colors. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1505 if (condemn_scroll_bars_hook) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1506 (*condemn_scroll_bars_hook) (f); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1507 if (judge_scroll_bars_hook) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1508 (*judge_scroll_bars_hook) (f); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1509 |
25593
9aecfcf3cb43
(x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents:
25550
diff
changeset
|
1510 update_face_from_frame_parameter (f, Qscroll_bar_background, value); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1511 redraw_frame (f); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1512 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1513 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1514 |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1515 |
30383 | 1516 /* Encode Lisp string STRING as a text in a format appropriate for |
30351
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1517 XICCC (X Inter Client Communication Conventions). |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1518 |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1519 If STRING contains only ASCII characters, do no conversion and |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1520 return the string data of STRING. Otherwise, encode the text by |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1521 CODING_SYSTEM, and return a newly allocated memory area which |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1522 should be freed by `xfree' by a caller. |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1523 |
43452
75677c801c26
(x_encode_text): Accept additional arg SELECTIONP; all
Eli Zaretskii <eliz@gnu.org>
parents:
43426
diff
changeset
|
1524 SELECTIONP non-zero means the string is being encoded for an X |
75677c801c26
(x_encode_text): Accept additional arg SELECTIONP; all
Eli Zaretskii <eliz@gnu.org>
parents:
43426
diff
changeset
|
1525 selection, so it is safe to run pre-write conversions (which |
75677c801c26
(x_encode_text): Accept additional arg SELECTIONP; all
Eli Zaretskii <eliz@gnu.org>
parents:
43426
diff
changeset
|
1526 may run Lisp code). |
75677c801c26
(x_encode_text): Accept additional arg SELECTIONP; all
Eli Zaretskii <eliz@gnu.org>
parents:
43426
diff
changeset
|
1527 |
30351
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1528 Store the byte length of resulting text in *TEXT_BYTES. |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1529 |
30354 | 1530 If the text contains only ASCII and Latin-1, store 1 in *STRING_P, |
30351
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1531 which means that the `encoding' of the result can be `STRING'. |
30354 | 1532 Otherwise store 0 in *STRINGP, which means that the `encoding' of |
30351
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1533 the result should be `COMPOUND_TEXT'. */ |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1534 |
65459
41f88837ca5b
(x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents:
64770
diff
changeset
|
1535 static unsigned char * |
41f88837ca5b
(x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents:
64770
diff
changeset
|
1536 x_encode_text (string, coding_system, selectionp, text_bytes, stringp, freep) |
30351
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1537 Lisp_Object string, coding_system; |
30354 | 1538 int *text_bytes, *stringp; |
43452
75677c801c26
(x_encode_text): Accept additional arg SELECTIONP; all
Eli Zaretskii <eliz@gnu.org>
parents:
43426
diff
changeset
|
1539 int selectionp; |
65459
41f88837ca5b
(x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents:
64770
diff
changeset
|
1540 int *freep; |
30351
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1541 { |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
1542 unsigned char *str = SDATA (string); |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
1543 int chars = SCHARS (string); |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
1544 int bytes = SBYTES (string); |
30351
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1545 int charset_info; |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1546 int bufsize; |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1547 unsigned char *buf; |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1548 struct coding_system coding; |
45603
97212b1039e9
(x_encode_text): Return stringp non-NULL if coding_system
Eli Zaretskii <eliz@gnu.org>
parents:
45413
diff
changeset
|
1549 extern Lisp_Object Qcompound_text_with_extensions; |
30351
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1550 |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1551 charset_info = find_charset_in_text (str, chars, bytes, NULL, Qnil); |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1552 if (charset_info == 0) |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1553 { |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1554 /* No multibyte character in OBJ. We need not encode it. */ |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1555 *text_bytes = bytes; |
30354 | 1556 *stringp = 1; |
65459
41f88837ca5b
(x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents:
64770
diff
changeset
|
1557 *freep = 0; |
30351
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1558 return str; |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1559 } |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1560 |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1561 setup_coding_system (coding_system, &coding); |
43452
75677c801c26
(x_encode_text): Accept additional arg SELECTIONP; all
Eli Zaretskii <eliz@gnu.org>
parents:
43426
diff
changeset
|
1562 if (selectionp |
75677c801c26
(x_encode_text): Accept additional arg SELECTIONP; all
Eli Zaretskii <eliz@gnu.org>
parents:
43426
diff
changeset
|
1563 && SYMBOLP (coding.pre_write_conversion) |
75677c801c26
(x_encode_text): Accept additional arg SELECTIONP; all
Eli Zaretskii <eliz@gnu.org>
parents:
43426
diff
changeset
|
1564 && !NILP (Ffboundp (coding.pre_write_conversion))) |
75677c801c26
(x_encode_text): Accept additional arg SELECTIONP; all
Eli Zaretskii <eliz@gnu.org>
parents:
43426
diff
changeset
|
1565 { |
75677c801c26
(x_encode_text): Accept additional arg SELECTIONP; all
Eli Zaretskii <eliz@gnu.org>
parents:
43426
diff
changeset
|
1566 string = run_pre_post_conversion_on_str (string, &coding, 1); |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
1567 str = SDATA (string); |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
1568 chars = SCHARS (string); |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
1569 bytes = SBYTES (string); |
43452
75677c801c26
(x_encode_text): Accept additional arg SELECTIONP; all
Eli Zaretskii <eliz@gnu.org>
parents:
43426
diff
changeset
|
1570 } |
30351
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1571 coding.src_multibyte = 1; |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1572 coding.dst_multibyte = 0; |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1573 coding.mode |= CODING_MODE_LAST_BLOCK; |
30354 | 1574 if (coding.type == coding_type_iso2022) |
1575 coding.flags |= CODING_FLAG_ISO_SAFE; | |
33242
421e3db4e24e
(x_encode_text): Suppress producing escape sequences for composition.
Kenichi Handa <handa@m17n.org>
parents:
32606
diff
changeset
|
1576 /* We suppress producing escape sequences for composition. */ |
421e3db4e24e
(x_encode_text): Suppress producing escape sequences for composition.
Kenichi Handa <handa@m17n.org>
parents:
32606
diff
changeset
|
1577 coding.composing = COMPOSITION_DISABLED; |
30351
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1578 bufsize = encoding_buffer_size (&coding, bytes); |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1579 buf = (unsigned char *) xmalloc (bufsize); |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1580 encode_coding (&coding, str, buf, bytes, bufsize); |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1581 *text_bytes = coding.produced; |
45603
97212b1039e9
(x_encode_text): Return stringp non-NULL if coding_system
Eli Zaretskii <eliz@gnu.org>
parents:
45413
diff
changeset
|
1582 *stringp = (charset_info == 1 |
97212b1039e9
(x_encode_text): Return stringp non-NULL if coding_system
Eli Zaretskii <eliz@gnu.org>
parents:
45413
diff
changeset
|
1583 || (!EQ (coding_system, Qcompound_text) |
97212b1039e9
(x_encode_text): Return stringp non-NULL if coding_system
Eli Zaretskii <eliz@gnu.org>
parents:
45413
diff
changeset
|
1584 && !EQ (coding_system, Qcompound_text_with_extensions))); |
65459
41f88837ca5b
(x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents:
64770
diff
changeset
|
1585 *freep = 1; |
30351
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1586 return buf; |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1587 } |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1588 |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
1589 |
56879
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1590 /* Set the WM name to NAME for frame F. Also set the icon name. |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1591 If the frame already has an icon name, use that, otherwise set the |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1592 icon name to NAME. */ |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1593 |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1594 static void |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1595 x_set_name_internal (f, name) |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1596 FRAME_PTR f; |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1597 Lisp_Object name; |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1598 { |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1599 if (FRAME_X_WINDOW (f)) |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1600 { |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1601 BLOCK_INPUT; |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1602 #ifdef HAVE_X11R4 |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1603 { |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1604 XTextProperty text, icon; |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1605 int bytes, stringp; |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1606 int do_free_icon_value = 0, do_free_text_value = 0; |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1607 Lisp_Object coding_system; |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1608 |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1609 coding_system = Qcompound_text; |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1610 /* Note: Encoding strategy |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1611 |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1612 We encode NAME by compound-text and use "COMPOUND-TEXT" in |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1613 text.encoding. But, there are non-internationalized window |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1614 managers which don't support that encoding. So, if NAME |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1615 contains only ASCII and 8859-1 characters, encode it by |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1616 iso-latin-1, and use "STRING" in text.encoding hoping that |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1617 such window managers at least analyze this format correctly, |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1618 i.e. treat 8-bit bytes as 8859-1 characters. |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1619 |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1620 We may also be able to use "UTF8_STRING" in text.encoding |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1621 in the future which can encode all Unicode characters. |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1622 But, for the moment, there's no way to know that the |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1623 current window manager supports it or not. */ |
65459
41f88837ca5b
(x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents:
64770
diff
changeset
|
1624 text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp, |
41f88837ca5b
(x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents:
64770
diff
changeset
|
1625 &do_free_text_value); |
56879
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1626 text.encoding = (stringp ? XA_STRING |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1627 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1628 text.format = 8; |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1629 text.nitems = bytes; |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1630 |
71173
ac5b57ff4647
(x_set_name_internal): Set icon to `text', derived from name, when
John Paul Wallington <jpw@pobox.com>
parents:
71166
diff
changeset
|
1631 if (!STRINGP (f->icon_name)) |
56879
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1632 { |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1633 icon = text; |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1634 } |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1635 else |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1636 { |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1637 /* See the above comment "Note: Encoding strategy". */ |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1638 icon.value = x_encode_text (f->icon_name, coding_system, 0, |
65459
41f88837ca5b
(x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents:
64770
diff
changeset
|
1639 &bytes, &stringp, &do_free_icon_value); |
56879
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1640 icon.encoding = (stringp ? XA_STRING |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1641 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1642 icon.format = 8; |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1643 icon.nitems = bytes; |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1644 } |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1645 |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1646 #ifdef USE_GTK |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1647 gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), |
67264
d50a6a8cfd1e
* xfns.c (x_real_positions): int ign => unsigned int.
Jan Djärv <jan.h.d@swipnet.se>
parents:
66931
diff
changeset
|
1648 (char *) SDATA (ENCODE_UTF_8 (name))); |
56879
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1649 #else /* not USE_GTK */ |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1650 XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text); |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1651 #endif /* not USE_GTK */ |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1652 |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1653 XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &icon); |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1654 |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1655 if (do_free_icon_value) |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1656 xfree (icon.value); |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1657 if (do_free_text_value) |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1658 xfree (text.value); |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1659 } |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1660 #else /* not HAVE_X11R4 */ |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1661 XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1662 SDATA (name)); |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1663 XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1664 SDATA (name)); |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1665 #endif /* not HAVE_X11R4 */ |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1666 UNBLOCK_INPUT; |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1667 } |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1668 } |
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1669 |
4650 | 1670 /* 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
|
1671 x_id_name. |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1672 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1673 If EXPLICIT is non-zero, that indicates that lisp code is setting the |
4650 | 1674 name; if NAME is a string, set F's name to NAME and set |
1675 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
|
1676 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1677 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
|
1678 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
|
1679 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
|
1680 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1681 void |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1682 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
|
1683 struct frame *f; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1684 Lisp_Object name; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1685 int explicit; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1686 { |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1687 /* Make sure that requests from lisp code override requests from |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1688 Emacs redisplay code. */ |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1689 if (explicit) |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1690 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1691 /* 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
|
1692 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
|
1693 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
|
1694 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
|
1695 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1696 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
|
1697 } |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1698 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
|
1699 return; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1700 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1701 /* 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
|
1702 if (NILP (name)) |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
1703 { |
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
1704 /* 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
|
1705 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
|
1706 if (!strcmp (FRAME_X_DISPLAY_INFO (f)->x_id_name, |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
1707 SDATA (f->name))) |
8090
bb03e344f07e
(x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents:
7989
diff
changeset
|
1708 return; |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
1709 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
|
1710 } |
833 | 1711 else |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
1712 CHECK_STRING (name); |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1713 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1714 /* 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
|
1715 if (! NILP (Fstring_equal (name, f->name))) |
727 | 1716 return; |
1717 | |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1718 f->name = name; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1719 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1720 /* 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
|
1721 the name parameter. */ |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1722 if (! NILP (f->title)) |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1723 name = f->title; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1724 |
56879
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1725 x_set_name_internal (f, name); |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1726 } |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1727 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1728 /* 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
|
1729 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
|
1730 redisplay code. */ |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1731 void |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1732 x_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
|
1733 FRAME_PTR f; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1734 Lisp_Object arg, oldval; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1735 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1736 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
|
1737 } |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1738 |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1739 /* 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
|
1740 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
|
1741 lisp code. */ |
1125
059624bf9bf0
Declare x_implicitly_set_name to be void.
Jim Blandy <jimb@redhat.com>
parents:
1096
diff
changeset
|
1742 void |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1743 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
|
1744 FRAME_PTR 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 arg, oldval; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1746 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
1747 x_set_name (f, arg, 0); |
389 | 1748 } |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1749 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1750 /* 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
|
1751 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
|
1752 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1753 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
|
1754 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
|
1755 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
|
1756 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1757 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
|
1758 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
|
1759 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
|
1760 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1761 void |
25528
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
1762 x_set_title (f, name, old_name) |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1763 struct frame *f; |
25528
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
1764 Lisp_Object name, old_name; |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1765 { |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1766 /* 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
|
1767 if (EQ (name, f->title)) |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1768 return; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1769 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1770 update_mode_lines = 1; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1771 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1772 f->title = name; |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1773 |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1774 if (NILP (name)) |
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1775 name = f->name; |
16732
f52c4fd47f03
(x_set_title): Check data type of NAME.
Richard M. Stallman <rms@gnu.org>
parents:
16682
diff
changeset
|
1776 else |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
1777 CHECK_STRING (name); |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1778 |
56879
fcda7ee97ef5
* xfns.c (x_set_name_internal): New function. Check if we shall call
Jan Djärv <jan.h.d@swipnet.se>
parents:
56781
diff
changeset
|
1779 x_set_name_internal (f, name); |
14482
479987ba2c8d
(x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents:
14439
diff
changeset
|
1780 } |
9580
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1781 |
bcc9342cf633
(x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents:
9563
diff
changeset
|
1782 void |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1783 x_set_scroll_bar_default_width (f) |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
1784 struct frame *f; |
8942
a43f3b56ed47
(x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents:
8845
diff
changeset
|
1785 { |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
1786 int wid = FRAME_COLUMN_WIDTH (f); |
18594
5ca5ff1c74eb
(x_set_scroll_bar_width): By default, use enough
Richard M. Stallman <rms@gnu.org>
parents:
18114
diff
changeset
|
1787 |
25511
9bc9d4d6c716
(x_set_scroll_bar_width): Change conditional compilation
Gerd Moellmann <gerd@gnu.org>
parents:
25464
diff
changeset
|
1788 #ifdef USE_TOOLKIT_SCROLL_BARS |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1789 /* A minimum width of 14 doesn't look good for toolkit scroll bars. */ |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1790 int width = 16 + 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM; |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
1791 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (width + wid - 1) / wid; |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
1792 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = width; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1793 #else |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1794 /* Make the actual width at least 14 pixels and a multiple of a |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1795 character width. */ |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
1796 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid; |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1797 |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1798 /* Use all of that space (aside from required margins) for the |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1799 scroll bar. */ |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
1800 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 0; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1801 #endif |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
1802 } |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1803 |
389 | 1804 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1805 /* Record in frame F the specified or default value according to ALIST |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1806 of the parameter named PROP (a Lisp symbol). If no value is |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1807 specified for PROP, look for an X default for XPROP on the frame |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1808 named NAME. If that is not found either, use the value DEFLT. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1809 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1810 static Lisp_Object |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1811 x_default_scroll_bar_color_parameter (f, alist, prop, xprop, xclass, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1812 foreground_p) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1813 struct frame *f; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1814 Lisp_Object alist; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1815 Lisp_Object prop; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1816 char *xprop; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1817 char *xclass; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1818 int foreground_p; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1819 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1820 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1821 Lisp_Object tem; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1822 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1823 tem = x_get_arg (dpyinfo, alist, prop, xprop, xclass, RES_TYPE_STRING); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1824 if (EQ (tem, Qunbound)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1825 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1826 #ifdef USE_TOOLKIT_SCROLL_BARS |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1827 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1828 /* See if an X resource for the scroll bar color has been |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1829 specified. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1830 tem = display_x_get_resource (dpyinfo, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1831 build_string (foreground_p |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1832 ? "foreground" |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1833 : "background"), |
39812
66e0816837a8
Update calls to openp.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39682
diff
changeset
|
1834 empty_string, |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1835 build_string ("verticalScrollBar"), |
39812
66e0816837a8
Update calls to openp.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39682
diff
changeset
|
1836 empty_string); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1837 if (!STRINGP (tem)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1838 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1839 /* If nothing has been specified, scroll bars will use a |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1840 toolkit-dependent default. Because these defaults are |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1841 difficult to get at without actually creating a scroll |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1842 bar, use nil to indicate that no color has been |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1843 specified. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1844 tem = Qnil; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1845 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1846 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1847 #else /* not USE_TOOLKIT_SCROLL_BARS */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1848 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1849 tem = Qnil; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
1850 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1851 #endif /* not USE_TOOLKIT_SCROLL_BARS */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1852 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1853 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1854 x_set_frame_parameters (f, Fcons (Fcons (prop, tem), Qnil)); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1855 return tem; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1856 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1857 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
1858 |
389 | 1859 |
5229
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1860 #if !defined (HAVE_X11R4) && !defined (HAVE_XSETWMPROTOCOLS) |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1861 |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1862 Status |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1863 XSetWMProtocols (dpy, w, protocols, count) |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1864 Display *dpy; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1865 Window w; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1866 Atom *protocols; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1867 int count; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1868 { |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1869 Atom prop; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1870 prop = XInternAtom (dpy, "WM_PROTOCOLS", False); |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1871 if (prop == None) return False; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1872 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
|
1873 (unsigned char *) protocols, count); |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1874 return True; |
110539a25499
(Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents:
5193
diff
changeset
|
1875 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1876 #endif /* not HAVE_X11R4 && not HAVE_XSETWMPROTOCOLS */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1877 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1878 #ifdef USE_X_TOOLKIT |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1879 |
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
|
1880 /* 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
|
1881 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
|
1882 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
|
1883 for example, but Xt doesn't). */ |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1884 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1885 static void |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1886 hack_wm_protocols (f, widget) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1887 FRAME_PTR f; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1888 Widget widget; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1889 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1890 Display *dpy = XtDisplay (widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1891 Window w = XtWindow (widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1892 int need_delete = 1; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1893 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
|
1894 int need_save = 1; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1895 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1896 BLOCK_INPUT; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1897 { |
60133
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1898 Atom type; |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1899 unsigned char *catoms; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1900 int format = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1901 unsigned long nitems = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1902 unsigned long bytes_after; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1903 |
11882
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
1904 if ((XGetWindowProperty (dpy, w, |
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
1905 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
|
1906 (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
|
1907 &type, &format, &nitems, &bytes_after, |
60133
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1908 &catoms) |
11882
8b3575269610
(hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents:
11774
diff
changeset
|
1909 == Success) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1910 && format == 32 && type == XA_ATOM) |
60133
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1911 { |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1912 Atom *atoms = (Atom *) catoms; |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1913 while (nitems > 0) |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1914 { |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1915 nitems--; |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1916 if (atoms[nitems] |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1917 == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_delete_window) |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1918 need_delete = 0; |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1919 else if (atoms[nitems] |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1920 == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_take_focus) |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1921 need_focus = 0; |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1922 else if (atoms[nitems] |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1923 == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_save_yourself) |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1924 need_save = 0; |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1925 } |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1926 } |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1927 if (catoms) |
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
1928 XFree (catoms); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1929 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1930 { |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1931 Atom props [10]; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1932 int count = 0; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1933 if (need_delete) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1934 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
|
1935 if (need_focus) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1936 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
|
1937 if (need_save) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1938 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
|
1939 if (count) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
1940 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
|
1941 XA_ATOM, 32, PropModeAppend, |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1942 (unsigned char *) props, count); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1943 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1944 UNBLOCK_INPUT; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1945 } |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
1946 #endif |
27157
3dafddaefc2c
(x_create_im): New function to set IM and IC of a frame.
Gerd Moellmann <gerd@gnu.org>
parents:
27153
diff
changeset
|
1947 |
3dafddaefc2c
(x_create_im): New function to set IM and IC of a frame.
Gerd Moellmann <gerd@gnu.org>
parents:
27153
diff
changeset
|
1948 |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1949 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1950 /* Support routines for XIC (X Input Context). */ |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1951 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1952 #ifdef HAVE_X_I18N |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1953 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1954 static XFontSet xic_create_xfontset P_ ((struct frame *, char *)); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1955 static XIMStyle best_xim_style P_ ((XIMStyles *, XIMStyles *)); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1956 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1957 |
51130
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
1958 /* Supported XIM styles, ordered by preference. */ |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1959 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1960 static XIMStyle supported_xim_styles[] = |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1961 { |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1962 XIMPreeditPosition | XIMStatusArea, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1963 XIMPreeditPosition | XIMStatusNothing, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1964 XIMPreeditPosition | XIMStatusNone, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1965 XIMPreeditNothing | XIMStatusArea, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1966 XIMPreeditNothing | XIMStatusNothing, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1967 XIMPreeditNothing | XIMStatusNone, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1968 XIMPreeditNone | XIMStatusArea, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1969 XIMPreeditNone | XIMStatusNothing, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1970 XIMPreeditNone | XIMStatusNone, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1971 0, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1972 }; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1973 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1974 |
57633
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
1975 /* Create an X fontset on frame F with base font name BASE_FONTNAME. */ |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
1976 |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
1977 char xic_defaut_fontset[] = "-*-*-*-r-normal--14-*-*-*-*-*-*-*"; |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
1978 |
60668
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
1979 /* Create an Xt fontset spec from the name of a base font. |
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
1980 If `motif' is True use the Motif syntax. */ |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
1981 char * |
60668
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
1982 xic_create_fontsetname (base_fontname, motif) |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
1983 char *base_fontname; |
60668
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
1984 Bool motif; |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
1985 { |
60668
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
1986 const char *sep = motif ? ";" : ","; |
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
1987 char *fontsetname; |
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
1988 |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
1989 /* Make a fontset name from the base font name. */ |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
1990 if (xic_defaut_fontset == base_fontname) |
60668
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
1991 { /* There is no base font name, use the default. */ |
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
1992 int len = strlen (base_fontname) + 2; |
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
1993 fontsetname = xmalloc (len); |
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
1994 bzero (fontsetname, len); |
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
1995 strcpy (fontsetname, base_fontname); |
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
1996 } |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
1997 else |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
1998 { |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
1999 /* Make a fontset name from the base font name. |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2000 The font set will be made of the following elements: |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2001 - the base font. |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2002 - the base font where the charset spec is replaced by -*-*. |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2003 - the same but with the family also replaced with -*-*-. */ |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2004 char *p = base_fontname; |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2005 int i; |
65459
41f88837ca5b
(x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents:
64770
diff
changeset
|
2006 |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2007 for (i = 0; *p; p++) |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2008 if (*p == '-') i++; |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2009 if (i != 14) |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2010 { /* As the font name doesn't conform to XLFD, we can't |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2011 modify it to generalize it to allcs and allfamilies. |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2012 Use the specified font plus the default. */ |
60668
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
2013 int len = strlen (base_fontname) + strlen (xic_defaut_fontset) + 3; |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2014 fontsetname = xmalloc (len); |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2015 bzero (fontsetname, len); |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2016 strcpy (fontsetname, base_fontname); |
60668
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
2017 strcat (fontsetname, sep); |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2018 strcat (fontsetname, xic_defaut_fontset); |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2019 } |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2020 else |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2021 { |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2022 int len; |
60695
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2023 char *p1 = NULL, *p2 = NULL; |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2024 char *font_allcs = NULL; |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2025 char *font_allfamilies = NULL; |
60695
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2026 char *font_all = NULL; |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2027 char *allcs = "*-*-*-*-*-*-*"; |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2028 char *allfamilies = "-*-*-"; |
60695
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2029 char *all = "*-*-*-*-"; |
65459
41f88837ca5b
(x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents:
64770
diff
changeset
|
2030 |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2031 for (i = 0, p = base_fontname; i < 8; p++) |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2032 { |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2033 if (*p == '-') |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2034 { |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2035 i++; |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2036 if (i == 3) |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2037 p1 = p + 1; |
60695
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2038 else if (i == 7) |
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2039 p2 = p + 1; |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2040 } |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2041 } |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2042 /* Build the font spec that matches all charsets. */ |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2043 len = p - base_fontname + strlen (allcs) + 1; |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2044 font_allcs = (char *) alloca (len); |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2045 bzero (font_allcs, len); |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2046 bcopy (base_fontname, font_allcs, p - base_fontname); |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2047 strcat (font_allcs, allcs); |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2048 |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2049 /* Build the font spec that matches all families. */ |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2050 len = p - p1 + strlen (allcs) + strlen (allfamilies) + 1; |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2051 font_allfamilies = (char *) alloca (len); |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2052 bzero (font_allfamilies, len); |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2053 strcpy (font_allfamilies, allfamilies); |
60695
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2054 bcopy (p1, font_allfamilies + strlen (allfamilies), p - p1); |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2055 strcat (font_allfamilies, allcs); |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2056 |
60695
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2057 /* Build the font spec that matches all. */ |
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2058 len = p - p2 + strlen (allcs) + strlen (all) + strlen (allfamilies) + 1; |
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2059 font_all = (char *) alloca (len); |
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2060 bzero (font_all, len); |
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2061 strcpy (font_all, allfamilies); |
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2062 strcat (font_all, all); |
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2063 bcopy (p2, font_all + strlen (all) + strlen (allfamilies), p - p2); |
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2064 strcat (font_all, allcs); |
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2065 |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2066 /* Build the actual font set name. */ |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2067 len = strlen (base_fontname) + strlen (font_allcs) |
60695
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2068 + strlen (font_allfamilies) + strlen (font_all) + 5; |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2069 fontsetname = xmalloc (len); |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2070 bzero (fontsetname, len); |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2071 strcpy (fontsetname, base_fontname); |
60668
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
2072 strcat (fontsetname, sep); |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2073 strcat (fontsetname, font_allcs); |
60668
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
2074 strcat (fontsetname, sep); |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2075 strcat (fontsetname, font_allfamilies); |
60695
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2076 strcat (fontsetname, sep); |
d8c3512bc427
(xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60668
diff
changeset
|
2077 strcat (fontsetname, font_all); |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2078 } |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2079 } |
60668
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
2080 if (motif) |
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
2081 strcat (fontsetname, ":"); |
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
2082 return fontsetname; |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2083 } |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2084 |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2085 static XFontSet |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2086 xic_create_xfontset (f, base_fontname) |
27157
3dafddaefc2c
(x_create_im): New function to set IM and IC of a frame.
Gerd Moellmann <gerd@gnu.org>
parents:
27153
diff
changeset
|
2087 struct frame *f; |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2088 char *base_fontname; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2089 { |
57633
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2090 XFontSet xfs = NULL; |
57643
3b8eabf02bad
* xfns.c (xic_create_xfontset): Initialize missing_list to NULL.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57633
diff
changeset
|
2091 char **missing_list = NULL; |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2092 int missing_count; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2093 char *def_string; |
57633
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2094 Lisp_Object rest, frame; |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2095 |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2096 if (!base_fontname) |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2097 base_fontname = xic_defaut_fontset; |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2098 |
57633
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2099 /* See if there is another frame already using same fontset. */ |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2100 FOR_EACH_FRAME (rest, frame) |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2101 { |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2102 struct frame *cf = XFRAME (frame); |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2103 if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf) |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2104 && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f) |
57714
7920b90a583c
* xfns.c (xic_create_xfontset): Check that FRAME_XIC_BASE_FONTNAME
Jan Djärv <jan.h.d@swipnet.se>
parents:
57643
diff
changeset
|
2105 && FRAME_XIC_BASE_FONTNAME (cf) |
57633
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2106 && !strcmp (FRAME_XIC_BASE_FONTNAME (cf), base_fontname)) |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2107 { |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2108 xfs = FRAME_XIC_FONTSET (cf); |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2109 break; |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2110 } |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2111 } |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2112 |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2113 if (!xfs) |
57643
3b8eabf02bad
* xfns.c (xic_create_xfontset): Initialize missing_list to NULL.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57633
diff
changeset
|
2114 { |
60668
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
2115 char *fontsetname = xic_create_fontsetname (base_fontname, False); |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2116 |
57643
3b8eabf02bad
* xfns.c (xic_create_xfontset): Initialize missing_list to NULL.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57633
diff
changeset
|
2117 /* New fontset. */ |
3b8eabf02bad
* xfns.c (xic_create_xfontset): Initialize missing_list to NULL.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57633
diff
changeset
|
2118 xfs = XCreateFontSet (FRAME_X_DISPLAY (f), |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2119 fontsetname, &missing_list, |
57643
3b8eabf02bad
* xfns.c (xic_create_xfontset): Initialize missing_list to NULL.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57633
diff
changeset
|
2120 &missing_count, &def_string); |
3b8eabf02bad
* xfns.c (xic_create_xfontset): Initialize missing_list to NULL.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57633
diff
changeset
|
2121 if (missing_list) |
3b8eabf02bad
* xfns.c (xic_create_xfontset): Initialize missing_list to NULL.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57633
diff
changeset
|
2122 XFreeStringList (missing_list); |
60668
34f4b9f0b40d
(xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60582
diff
changeset
|
2123 xfree (fontsetname); |
57643
3b8eabf02bad
* xfns.c (xic_create_xfontset): Initialize missing_list to NULL.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57633
diff
changeset
|
2124 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2125 |
57633
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2126 if (FRAME_XIC_BASE_FONTNAME (f)) |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2127 xfree (FRAME_XIC_BASE_FONTNAME (f)); |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2128 FRAME_XIC_BASE_FONTNAME (f) = xstrdup (base_fontname); |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2129 |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2130 /* No need to free def_string. */ |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2131 return xfs; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2132 } |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2133 |
57633
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2134 /* Free the X fontset of frame F if it is the last frame using it. */ |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2135 |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2136 void |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2137 xic_free_xfontset (f) |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2138 struct frame *f; |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2139 { |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2140 Lisp_Object rest, frame; |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2141 int shared_p = 0; |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2142 |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2143 if (!FRAME_XIC_FONTSET (f)) |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2144 return; |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2145 |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2146 /* See if there is another frame sharing the same fontset. */ |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2147 FOR_EACH_FRAME (rest, frame) |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2148 { |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2149 struct frame *cf = XFRAME (frame); |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2150 if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf) |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2151 && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f) |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2152 && FRAME_XIC_FONTSET (cf) == FRAME_XIC_FONTSET (f)) |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2153 { |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2154 shared_p = 1; |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2155 break; |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2156 } |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2157 } |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2158 |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2159 if (!shared_p) |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2160 /* The fontset is not used anymore. It is safe to free it. */ |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2161 XFreeFontSet (FRAME_X_DISPLAY (f), FRAME_XIC_FONTSET (f)); |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2162 |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2163 if (FRAME_XIC_BASE_FONTNAME (f)) |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2164 xfree (FRAME_XIC_BASE_FONTNAME (f)); |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2165 FRAME_XIC_BASE_FONTNAME (f) = NULL; |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2166 FRAME_XIC_FONTSET (f) = NULL; |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2167 } |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2168 |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2169 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2170 /* Value is the best input style, given user preferences USER (already |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2171 checked to be supported by Emacs), and styles supported by the |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2172 input method XIM. */ |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2173 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2174 static XIMStyle |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2175 best_xim_style (user, xim) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2176 XIMStyles *user; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2177 XIMStyles *xim; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2178 { |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2179 int i, j; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2180 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2181 for (i = 0; i < user->count_styles; ++i) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2182 for (j = 0; j < xim->count_styles; ++j) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2183 if (user->supported_styles[i] == xim->supported_styles[j]) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2184 return user->supported_styles[i]; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2185 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2186 /* Return the default style. */ |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2187 return XIMPreeditNothing | XIMStatusNothing; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2188 } |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2189 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2190 /* Create XIC for frame F. */ |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2191 |
35592 | 2192 static XIMStyle xic_style; |
2193 | |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2194 void |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2195 create_frame_xic (f) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2196 struct frame *f; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2197 { |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2198 XIM xim; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2199 XIC xic = NULL; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2200 XFontSet xfs = NULL; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2201 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2202 if (FRAME_XIC (f)) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2203 return; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2204 |
60582
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2205 /* Create X fontset. */ |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2206 xfs = xic_create_xfontset |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2207 (f, (FRAME_FONTSET (f) < 0) ? NULL |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2208 : (char *) SDATA (fontset_ascii (FRAME_FONTSET (f)))); |
c2a74bfb2e79
(xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60555
diff
changeset
|
2209 |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2210 xim = FRAME_X_XIM (f); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2211 if (xim) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2212 { |
27659
4137c807296b
(create_frame_xic): Fix initialization of automatic aggregates for pcc.
Dave Love <fx@gnu.org>
parents:
27502
diff
changeset
|
2213 XRectangle s_area; |
4137c807296b
(create_frame_xic): Fix initialization of automatic aggregates for pcc.
Dave Love <fx@gnu.org>
parents:
27502
diff
changeset
|
2214 XPoint spot; |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2215 XVaNestedList preedit_attr; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2216 XVaNestedList status_attr; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2217 |
27659
4137c807296b
(create_frame_xic): Fix initialization of automatic aggregates for pcc.
Dave Love <fx@gnu.org>
parents:
27502
diff
changeset
|
2218 s_area.x = 0; s_area.y = 0; s_area.width = 1; s_area.height = 1; |
4137c807296b
(create_frame_xic): Fix initialization of automatic aggregates for pcc.
Dave Love <fx@gnu.org>
parents:
27502
diff
changeset
|
2219 spot.x = 0; spot.y = 1; |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2220 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2221 /* Determine XIC style. */ |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2222 if (xic_style == 0) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2223 { |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2224 XIMStyles supported_list; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2225 supported_list.count_styles = (sizeof supported_xim_styles |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2226 / sizeof supported_xim_styles[0]); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2227 supported_list.supported_styles = supported_xim_styles; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2228 xic_style = best_xim_style (&supported_list, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2229 FRAME_X_XIM_STYLES (f)); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2230 } |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2231 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2232 preedit_attr = XVaCreateNestedList (0, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2233 XNFontSet, xfs, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2234 XNForeground, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2235 FRAME_FOREGROUND_PIXEL (f), |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2236 XNBackground, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2237 FRAME_BACKGROUND_PIXEL (f), |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2238 (xic_style & XIMPreeditPosition |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2239 ? XNSpotLocation |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2240 : NULL), |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2241 &spot, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2242 NULL); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2243 status_attr = XVaCreateNestedList (0, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2244 XNArea, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2245 &s_area, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2246 XNFontSet, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2247 xfs, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2248 XNForeground, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2249 FRAME_FOREGROUND_PIXEL (f), |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2250 XNBackground, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2251 FRAME_BACKGROUND_PIXEL (f), |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2252 NULL); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2253 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2254 xic = XCreateIC (xim, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2255 XNInputStyle, xic_style, |
53069
1218a42792ea
Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
53027
diff
changeset
|
2256 XNClientWindow, FRAME_X_WINDOW (f), |
1218a42792ea
Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
53027
diff
changeset
|
2257 XNFocusWindow, FRAME_X_WINDOW (f), |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2258 XNStatusAttributes, status_attr, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2259 XNPreeditAttributes, preedit_attr, |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2260 NULL); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2261 XFree (preedit_attr); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2262 XFree (status_attr); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2263 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2264 |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2265 FRAME_XIC (f) = xic; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2266 FRAME_XIC_STYLE (f) = xic_style; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2267 FRAME_XIC_FONTSET (f) = xfs; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2268 } |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2269 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2270 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2271 /* Destroy XIC and free XIC fontset of frame F, if any. */ |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2272 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2273 void |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2274 free_frame_xic (f) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2275 struct frame *f; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2276 { |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2277 if (FRAME_XIC (f) == NULL) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2278 return; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2279 |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2280 XDestroyIC (FRAME_XIC (f)); |
57633
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2281 xic_free_xfontset (f); |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2282 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2283 FRAME_XIC (f) = NULL; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2284 } |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2285 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2286 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2287 /* Place preedit area for XIC of window W's frame to specified |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2288 pixel position X/Y. X and Y are relative to window W. */ |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2289 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2290 void |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2291 xic_set_preeditarea (w, x, y) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2292 struct window *w; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2293 int x, y; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2294 { |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2295 struct frame *f = XFRAME (w->frame); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2296 XVaNestedList attr; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2297 XPoint spot; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2298 |
52059
4b5692f6703a
(xic_set_preeditarea): Add the left fringe width to spot.x.
Kenichi Handa <handa@m17n.org>
parents:
52015
diff
changeset
|
2299 spot.x = WINDOW_TO_FRAME_PIXEL_X (w, x) + WINDOW_LEFT_FRINGE_WIDTH (w); |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2300 spot.y = WINDOW_TO_FRAME_PIXEL_Y (w, y) + FONT_BASE (FRAME_FONT (f)); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2301 attr = XVaCreateNestedList (0, XNSpotLocation, &spot, NULL); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2302 XSetICValues (FRAME_XIC (f), XNPreeditAttributes, attr, NULL); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2303 XFree (attr); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2304 } |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2305 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2306 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2307 /* Place status area for XIC in bottom right corner of frame F.. */ |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2308 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2309 void |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2310 xic_set_statusarea (f) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2311 struct frame *f; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2312 { |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2313 XIC xic = FRAME_XIC (f); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2314 XVaNestedList attr; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2315 XRectangle area; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2316 XRectangle *needed; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2317 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2318 /* Negotiate geometry of status area. If input method has existing |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2319 status area, use its current size. */ |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2320 area.x = area.y = area.width = area.height = 0; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2321 attr = XVaCreateNestedList (0, XNAreaNeeded, &area, NULL); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2322 XSetICValues (xic, XNStatusAttributes, attr, NULL); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2323 XFree (attr); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2324 |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2325 attr = XVaCreateNestedList (0, XNAreaNeeded, &needed, NULL); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2326 XGetICValues (xic, XNStatusAttributes, attr, NULL); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2327 XFree (attr); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2328 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2329 if (needed->width == 0) /* Use XNArea instead of XNAreaNeeded */ |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2330 { |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2331 attr = XVaCreateNestedList (0, XNArea, &needed, NULL); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2332 XGetICValues (xic, XNStatusAttributes, attr, NULL); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2333 XFree (attr); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2334 } |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2335 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2336 area.width = needed->width; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2337 area.height = needed->height; |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
2338 area.x = FRAME_PIXEL_WIDTH (f) - area.width - FRAME_INTERNAL_BORDER_WIDTH (f); |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
2339 area.y = (FRAME_PIXEL_HEIGHT (f) - area.height |
49322 | 2340 - FRAME_MENUBAR_HEIGHT (f) |
2341 - FRAME_TOOLBAR_HEIGHT (f) | |
2342 - FRAME_INTERNAL_BORDER_WIDTH (f)); | |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2343 XFree (needed); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2344 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2345 attr = XVaCreateNestedList (0, XNArea, &area, NULL); |
53069
1218a42792ea
Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
53027
diff
changeset
|
2346 XSetICValues (xic, XNStatusAttributes, attr, NULL); |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2347 XFree (attr); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2348 } |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2349 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2350 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2351 /* Set X fontset for XIC of frame F, using base font name |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2352 BASE_FONTNAME. Called when a new Emacs fontset is chosen. */ |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2353 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2354 void |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2355 xic_set_xfontset (f, base_fontname) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2356 struct frame *f; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2357 char *base_fontname; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2358 { |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2359 XVaNestedList attr; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2360 XFontSet xfs; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2361 |
57633
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2362 xic_free_xfontset (f); |
ead4249849ac
* xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57432
diff
changeset
|
2363 |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2364 xfs = xic_create_xfontset (f, base_fontname); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2365 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2366 attr = XVaCreateNestedList (0, XNFontSet, xfs, NULL); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2367 if (FRAME_XIC_STYLE (f) & XIMPreeditPosition) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2368 XSetICValues (FRAME_XIC (f), XNPreeditAttributes, attr, NULL); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2369 if (FRAME_XIC_STYLE (f) & XIMStatusArea) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2370 XSetICValues (FRAME_XIC (f), XNStatusAttributes, attr, NULL); |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2371 XFree (attr); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2372 |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2373 FRAME_XIC_FONTSET (f) = xfs; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2374 } |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2375 |
27157
3dafddaefc2c
(x_create_im): New function to set IM and IC of a frame.
Gerd Moellmann <gerd@gnu.org>
parents:
27153
diff
changeset
|
2376 #endif /* HAVE_X_I18N */ |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2377 |
27157
3dafddaefc2c
(x_create_im): New function to set IM and IC of a frame.
Gerd Moellmann <gerd@gnu.org>
parents:
27153
diff
changeset
|
2378 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2379 |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2380 #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
|
2381 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2382 /* 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
|
2383 |
389 | 2384 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
|
2385 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
|
2386 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
|
2387 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
|
2388 int minibuffer_only; |
389 | 2389 { |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2390 XClassHint class_hints; |
6059
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2391 XSetWindowAttributes attributes; |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2392 unsigned long attribute_mask; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2393 Widget shell_widget; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2394 Widget pane_widget; |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2395 Widget frame_widget; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2396 Arg al [25]; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2397 int ac; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2398 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2399 BLOCK_INPUT; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2400 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2401 /* 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
|
2402 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
|
2403 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
|
2404 |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2405 Elsewhere we specify the window name for the window manager. */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2406 |
11496
db02849ee365
(x_window): Use (or reuse) frame's namebuf instead of a
Karl Heuer <kwzh@gnu.org>
parents:
11483
diff
changeset
|
2407 { |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
2408 char *str = (char *) SDATA (Vx_resource_name); |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2409 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
|
2410 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
|
2411 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2412 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2413 ac = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2414 XtSetArg (al[ac], XtNallowShellResize, 1); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2415 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
|
2416 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++; |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
2417 XtSetArg (al[ac], XtNborderWidth, f->border_width); ac++; |
27987
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2418 XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++; |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2419 XtSetArg (al[ac], XtNdepth, FRAME_X_DISPLAY_INFO (f)->n_planes); ac++; |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2420 XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++; |
11496
db02849ee365
(x_window): Use (or reuse) frame's namebuf instead of a
Karl Heuer <kwzh@gnu.org>
parents:
11483
diff
changeset
|
2421 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
|
2422 applicationShellWidgetClass, |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
2423 FRAME_X_DISPLAY (f), al, ac); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2424 |
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->widget = shell_widget; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2426 /* maybe_set_screen_title_format (shell_widget); */ |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2427 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2428 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
|
2429 (widget_value *) NULL, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2430 shell_widget, False, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2431 (lw_callback) NULL, |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2432 (lw_callback) NULL, |
27343
43230463dfcf
(x_window): Call lw_create_widget with new parameter
Gerd Moellmann <gerd@gnu.org>
parents:
27157
diff
changeset
|
2433 (lw_callback) NULL, |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2434 (lw_callback) NULL); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2435 |
27987
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2436 ac = 0; |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2437 XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++; |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2438 XtSetArg (al[ac], XtNdepth, FRAME_X_DISPLAY_INFO (f)->n_planes); ac++; |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2439 XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++; |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2440 XtSetValues (pane_widget, al, ac); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2441 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
|
2442 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2443 /* 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
|
2444 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
|
2445 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2446 ac = 0; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2447 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2448 XtSetArg (al[ac], XtNshowGrip, 0); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2449 XtSetArg (al[ac], XtNallowResize, 1); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2450 XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++; |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2451 XtSetArg (al[ac], XtNemacsFrame, f); ac++; |
27987
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2452 XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++; |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2453 XtSetArg (al[ac], XtNdepth, FRAME_X_DISPLAY_INFO (f)->n_planes); ac++; |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2454 XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++; |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2455 frame_widget = XtCreateWidget (f->namebuf, emacsFrameClass, pane_widget, |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2456 al, ac); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2457 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2458 f->output_data.x->edit_widget = frame_widget; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2459 |
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2460 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
|
2461 |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2462 /* 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
|
2463 { |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2464 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
|
2465 char *tem, shell_position[32]; |
53027
8ea9dad9855f
* xfns.c (x_window): Set XtNx and XtNy in shell widget for
Jan Djärv <jan.h.d@swipnet.se>
parents:
52763
diff
changeset
|
2466 Arg al[10]; |
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
|
2467 int ac = 0; |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2468 int extra_borders = 0; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2469 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
|
2470 = (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
|
2471 ? (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
|
2472 + 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
|
2473 : 0); |
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
|
2474 |
15942
ff30ec8aab54
(x_window): Don't add ibw to menubar_size.
Richard M. Stallman <rms@gnu.org>
parents:
15891
diff
changeset
|
2475 #if 0 /* Experimentally, we now get the right results |
ff30ec8aab54
(x_window): Don't add ibw to menubar_size.
Richard M. Stallman <rms@gnu.org>
parents:
15891
diff
changeset
|
2476 for -geometry -0-0 without this. 24 Aug 96, rms. */ |
7969
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2477 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
|
2478 { |
9808
4c43c9dbe130
(x_window): Make ibw 0 by default.
Richard M. Stallman <rms@gnu.org>
parents:
9742
diff
changeset
|
2479 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
|
2480 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
|
2481 menubar_size += ibw; |
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2482 } |
15942
ff30ec8aab54
(x_window): Don't add ibw to menubar_size.
Richard M. Stallman <rms@gnu.org>
parents:
15891
diff
changeset
|
2483 #endif |
7969
7f15f77cb644
(x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents:
7946
diff
changeset
|
2484 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2485 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
|
2486 |
16305
00e57c8adaba
(x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents:
16302
diff
changeset
|
2487 #ifndef USE_LUCID |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2488 /* 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
|
2489 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
|
2490 Both conclusions reached experimentally. -- rms. */ |
16305
00e57c8adaba
(x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents:
16302
diff
changeset
|
2491 XtVaGetValues (f->output_data.x->edit_widget, XtNinternalBorderWidth, |
00e57c8adaba
(x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents:
16302
diff
changeset
|
2492 &extra_borders, NULL); |
00e57c8adaba
(x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents:
16302
diff
changeset
|
2493 extra_borders *= 2; |
00e57c8adaba
(x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents:
16302
diff
changeset
|
2494 #endif |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2495 |
11707
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2496 /* 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
|
2497 and specify it. |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2498 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
|
2499 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
|
2500 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
|
2501 { |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
2502 int left = f->left_pos; |
11707
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2503 int xneg = window_prompting & XNegative; |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
2504 int top = f->top_pos; |
11707
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2505 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
|
2506 if (xneg) |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2507 left = -left; |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2508 if (yneg) |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2509 top = -top; |
11893
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2510 |
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2511 if (window_prompting & USPosition) |
12190
e0abe30899a9
[USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents:
12111
diff
changeset
|
2512 sprintf (shell_position, "=%dx%d%c%d%c%d", |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
2513 FRAME_PIXEL_WIDTH (f) + extra_borders, |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
2514 FRAME_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
|
2515 (xneg ? '-' : '+'), left, |
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2516 (yneg ? '-' : '+'), top); |
1f70ffad3d6d
[USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents:
11882
diff
changeset
|
2517 else |
53027
8ea9dad9855f
* xfns.c (x_window): Set XtNx and XtNy in shell widget for
Jan Djärv <jan.h.d@swipnet.se>
parents:
52763
diff
changeset
|
2518 { |
8ea9dad9855f
* xfns.c (x_window): Set XtNx and XtNy in shell widget for
Jan Djärv <jan.h.d@swipnet.se>
parents:
52763
diff
changeset
|
2519 sprintf (shell_position, "=%dx%d", |
8ea9dad9855f
* xfns.c (x_window): Set XtNx and XtNy in shell widget for
Jan Djärv <jan.h.d@swipnet.se>
parents:
52763
diff
changeset
|
2520 FRAME_PIXEL_WIDTH (f) + extra_borders, |
8ea9dad9855f
* xfns.c (x_window): Set XtNx and XtNy in shell widget for
Jan Djärv <jan.h.d@swipnet.se>
parents:
52763
diff
changeset
|
2521 FRAME_PIXEL_HEIGHT (f) + menubar_size + extra_borders); |
8ea9dad9855f
* xfns.c (x_window): Set XtNx and XtNy in shell widget for
Jan Djärv <jan.h.d@swipnet.se>
parents:
52763
diff
changeset
|
2522 |
8ea9dad9855f
* xfns.c (x_window): Set XtNx and XtNy in shell widget for
Jan Djärv <jan.h.d@swipnet.se>
parents:
52763
diff
changeset
|
2523 /* Setting x and y when the position is not specified in |
8ea9dad9855f
* xfns.c (x_window): Set XtNx and XtNy in shell widget for
Jan Djärv <jan.h.d@swipnet.se>
parents:
52763
diff
changeset
|
2524 the geometry string will set program position in the WM hints. |
8ea9dad9855f
* xfns.c (x_window): Set XtNx and XtNy in shell widget for
Jan Djärv <jan.h.d@swipnet.se>
parents:
52763
diff
changeset
|
2525 If Emacs had just one program position, we could set it in |
8ea9dad9855f
* xfns.c (x_window): Set XtNx and XtNy in shell widget for
Jan Djärv <jan.h.d@swipnet.se>
parents:
52763
diff
changeset
|
2526 fallback resources, but since each make-frame call can specify |
8ea9dad9855f
* xfns.c (x_window): Set XtNx and XtNy in shell widget for
Jan Djärv <jan.h.d@swipnet.se>
parents:
52763
diff
changeset
|
2527 different program positions, this is easier. */ |
8ea9dad9855f
* xfns.c (x_window): Set XtNx and XtNy in shell widget for
Jan Djärv <jan.h.d@swipnet.se>
parents:
52763
diff
changeset
|
2528 XtSetArg (al[ac], XtNx, left); ac++; |
8ea9dad9855f
* xfns.c (x_window): Set XtNx and XtNy in shell widget for
Jan Djärv <jan.h.d@swipnet.se>
parents:
52763
diff
changeset
|
2529 XtSetArg (al[ac], XtNy, top); ac++; |
8ea9dad9855f
* xfns.c (x_window): Set XtNx and XtNy in shell widget for
Jan Djärv <jan.h.d@swipnet.se>
parents:
52763
diff
changeset
|
2530 } |
11707
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2531 } |
b0cb8129be58
[USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents:
11611
diff
changeset
|
2532 |
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
|
2533 len = strlen (shell_position) + 1; |
17579 | 2534 /* We don't free this because we don't know whether |
2535 it is safe to free it while the frame exists. | |
2536 It isn't worth the trouble of arranging to free it | |
2537 when the frame is deleted. */ | |
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
|
2538 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
|
2539 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
|
2540 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
|
2541 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
|
2542 } |
bb11213734d6
(x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6523
diff
changeset
|
2543 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2544 XtManageChild (pane_widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2545 XtRealizeWidget (shell_widget); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2546 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2547 FRAME_X_WINDOW (f) = XtWindow (frame_widget); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2548 |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2549 validate_x_resource_name (); |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2550 |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
2551 class_hints.res_name = (char *) SDATA (Vx_resource_name); |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
2552 class_hints.res_class = (char *) SDATA (Vx_resource_class); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2553 XSetClassHint (FRAME_X_DISPLAY (f), XtWindow (shell_widget), &class_hints); |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2554 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2555 #ifdef HAVE_X_I18N |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2556 FRAME_XIC (f) = NULL; |
51130
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2557 if (use_xim) |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2558 create_frame_xic (f); |
29947
b7556fa4c05b
(x_window) [!USE_XIM]: Don't call create_frame_ic.
Gerd Moellmann <gerd@gnu.org>
parents:
29938
diff
changeset
|
2559 #endif |
13227
d8af44485b3c
(x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents:
13083
diff
changeset
|
2560 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2561 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
|
2562 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
|
2563 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
|
2564 &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
|
2565 |
9703
85ac0e4030d4
(x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents:
9690
diff
changeset
|
2566 hack_wm_protocols (f, shell_widget); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2567 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2568 #ifdef HACK_EDITRES |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2569 XtAddEventHandler (shell_widget, 0, True, _XEditResCheckMessages, 0); |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2570 #endif |
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2571 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2572 /* Do a stupid property change to force the server to generate a |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
2573 PropertyNotify event so that the event_stream server timestamp will |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2574 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
|
2575 */ |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2576 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
|
2577 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
|
2578 XA_ATOM, 32, PropModeAppend, |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2579 (unsigned char*) NULL, 0); |
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2580 |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2581 /* Make all the standard events reach the Emacs frame. */ |
6059
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2582 attributes.event_mask = STANDARD_EVENT_SET; |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2583 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2584 #ifdef HAVE_X_I18N |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2585 if (FRAME_XIC (f)) |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2586 { |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2587 /* XIM server might require some X events. */ |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2588 unsigned long fevent = NoEventMask; |
53069
1218a42792ea
Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
53027
diff
changeset
|
2589 XGetICValues (FRAME_XIC (f), XNFilterEvents, &fevent, NULL); |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2590 attributes.event_mask |= fevent; |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2591 } |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2592 #endif /* HAVE_X_I18N */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2593 |
6059
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2594 attribute_mask = CWEventMask; |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2595 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
|
2596 attribute_mask, &attributes); |
0021cbdc591b
(x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents:
6011
diff
changeset
|
2597 |
9231
eeb35369e536
(HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents:
9182
diff
changeset
|
2598 XtMapWidget (frame_widget); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2599 |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2600 /* 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
|
2601 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
|
2602 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
|
2603 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
|
2604 { |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2605 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
|
2606 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
|
2607 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2608 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
|
2609 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
|
2610 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
|
2611 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
|
2612 } |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2613 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2614 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
|
2615 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
|
2616 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2617 UNBLOCK_INPUT; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2618 |
25320
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
2619 /* This is a no-op, except under Motif. Make sure main areas are |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
2620 set to something reasonable, in case we get an error later. */ |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
2621 lw_set_main_areas (pane_widget, 0, frame_widget); |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2622 } |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2623 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2624 #else /* not USE_X_TOOLKIT */ |
49322 | 2625 #ifdef USE_GTK |
2626 void | |
2627 x_window (f) | |
2628 FRAME_PTR f; | |
2629 { | |
2630 if (! xg_create_frame_widgets (f)) | |
2631 error ("Unable to create window"); | |
49434
a4d0ee33dcce
Fix input methods for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
49322
diff
changeset
|
2632 |
a4d0ee33dcce
Fix input methods for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
49322
diff
changeset
|
2633 #ifdef HAVE_X_I18N |
a4d0ee33dcce
Fix input methods for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
49322
diff
changeset
|
2634 FRAME_XIC (f) = NULL; |
54185
f6e4e454800a
xfns.c (x_window): Fixed indentation
Jan Djärv <jan.h.d@swipnet.se>
parents:
54142
diff
changeset
|
2635 if (use_xim) |
51130
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2636 { |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2637 BLOCK_INPUT; |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2638 create_frame_xic (f); |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2639 if (FRAME_XIC (f)) |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2640 { |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2641 /* XIM server might require some X events. */ |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2642 unsigned long fevent = NoEventMask; |
53069
1218a42792ea
Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
53027
diff
changeset
|
2643 XGetICValues (FRAME_XIC (f), XNFilterEvents, &fevent, NULL); |
51130
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2644 |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2645 if (fevent != NoEventMask) |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2646 { |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2647 XSetWindowAttributes attributes; |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2648 XWindowAttributes wattr; |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2649 unsigned long attribute_mask; |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2650 |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2651 XGetWindowAttributes (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2652 &wattr); |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2653 attributes.event_mask = wattr.your_event_mask | fevent; |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2654 attribute_mask = CWEventMask; |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2655 XChangeWindowAttributes (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2656 attribute_mask, &attributes); |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2657 } |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2658 } |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2659 UNBLOCK_INPUT; |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2660 } |
49434
a4d0ee33dcce
Fix input methods for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
49322
diff
changeset
|
2661 #endif |
49322 | 2662 } |
2663 | |
2664 #else /*! USE_GTK */ | |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2665 /* 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
|
2666 |
21846 | 2667 void |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2668 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
|
2669 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
|
2670 |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2671 { |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2672 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
|
2673 XSetWindowAttributes attributes; |
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2674 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
|
2675 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2676 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
|
2677 attributes.border_pixel = f->output_data.x->border_pixel; |
389 | 2678 attributes.bit_gravity = StaticGravity; |
2679 attributes.backing_store = NotUseful; | |
2680 attributes.save_under = True; | |
2681 attributes.event_mask = STANDARD_EVENT_SET; | |
27987
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2682 attributes.colormap = FRAME_X_COLORMAP (f); |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2683 attribute_mask = (CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
2684 | CWColormap); |
389 | 2685 |
2686 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
|
2687 FRAME_X_WINDOW (f) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2688 = 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
|
2689 f->output_data.x->parent_desc, |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
2690 f->left_pos, |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
2691 f->top_pos, |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
2692 FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f), |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
2693 f->border_width, |
389 | 2694 CopyFromParent, /* depth */ |
2695 InputOutput, /* class */ | |
28144
71ebba3566ec
(X_I18N_INHIBITED): Don't define.
Gerd Moellmann <gerd@gnu.org>
parents:
28096
diff
changeset
|
2696 FRAME_X_VISUAL (f), |
389 | 2697 attribute_mask, &attributes); |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2698 |
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2699 #ifdef HAVE_X_I18N |
51175 | 2700 if (use_xim) |
51130
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2701 { |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2702 create_frame_xic (f); |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2703 if (FRAME_XIC (f)) |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2704 { |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2705 /* XIM server might require some X events. */ |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2706 unsigned long fevent = NoEventMask; |
53069
1218a42792ea
Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
53027
diff
changeset
|
2707 XGetICValues (FRAME_XIC (f), XNFilterEvents, &fevent, NULL); |
51130
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2708 attributes.event_mask |= fevent; |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2709 attribute_mask = CWEventMask; |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2710 XChangeWindowAttributes (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2711 attribute_mask, &attributes); |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2712 } |
0e2a60d0ca7b
(x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents:
50392
diff
changeset
|
2713 } |
27502
52e8cb1333f2
(xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents:
27343
diff
changeset
|
2714 #endif /* HAVE_X_I18N */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2715 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
2716 validate_x_resource_name (); |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
2717 |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
2718 class_hints.res_name = (char *) SDATA (Vx_resource_name); |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
2719 class_hints.res_class = (char *) SDATA (Vx_resource_class); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2720 XSetClassHint (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &class_hints); |
771 | 2721 |
11897
cbd3724a9696
(x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents:
11894
diff
changeset
|
2722 /* 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
|
2723 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
|
2724 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
|
2725 |
1719
48f539ac6921
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1657
diff
changeset
|
2726 /* 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
|
2727 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
|
2728 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
|
2729 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
|
2730 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2731 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
|
2732 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
|
2733 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
|
2734 &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
|
2735 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
|
2736 |
26a1d7b2670b
(x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents:
7802
diff
changeset
|
2737 /* 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
|
2738 { |
26a1d7b2670b
(x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents:
7802
diff
changeset
|
2739 Atom protocols[2]; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2740 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
|
2741 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
|
2742 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
|
2743 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2744 |
817 | 2745 /* x_set_name normally ignores requests to set the name if the |
2746 requested name is the same as the current name. This is the one | |
2747 place where that assumption isn't correct; f->name is set, but | |
2748 the X server hasn't been told. */ | |
2749 { | |
6519
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
2750 Lisp_Object name; |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2751 int explicit = f->explicit_name; |
817 | 2752 |
6519
22c56514eeb3
(x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
6506
diff
changeset
|
2753 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
|
2754 name = f->name; |
817 | 2755 f->name = Qnil; |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
2756 x_set_name (f, name, explicit); |
817 | 2757 } |
2758 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2759 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
|
2760 f->output_data.x->text_cursor); |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2761 |
389 | 2762 UNBLOCK_INPUT; |
2763 | |
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
|
2764 if (FRAME_X_WINDOW (f) == 0) |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2765 error ("Unable to create window"); |
389 | 2766 } |
2767 | |
49322 | 2768 #endif /* not USE_GTK */ |
6790
ee8090b47ea6
(x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents:
6783
diff
changeset
|
2769 #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
|
2770 |
56513
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2771 /* Verify that the icon position args for this window are valid. */ |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2772 |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2773 static void |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2774 x_icon_verify (f, parms) |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2775 struct frame *f; |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2776 Lisp_Object parms; |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2777 { |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2778 Lisp_Object icon_x, icon_y; |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2779 |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2780 /* Set the position of the icon. Note that twm groups all |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2781 icons in an icon window. */ |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2782 icon_x = x_frame_get_and_record_arg (f, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER); |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2783 icon_y = x_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER); |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2784 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2785 { |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2786 CHECK_NUMBER (icon_x); |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2787 CHECK_NUMBER (icon_y); |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2788 } |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2789 else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound)) |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2790 error ("Both left and top icon corners of icon must be specified"); |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2791 } |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
2792 |
389 | 2793 /* Handle the icon stuff for this window. Perhaps later we might |
2794 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
|
2795 well. */ |
389 | 2796 |
2797 static void | |
771 | 2798 x_icon (f, parms) |
2799 struct frame *f; | |
389 | 2800 Lisp_Object parms; |
2801 { | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2802 Lisp_Object icon_x, icon_y; |
17779
094e5efd262d
(Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents:
17722
diff
changeset
|
2803 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
389 | 2804 |
2805 /* 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
|
2806 icons in an icon window. */ |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
2807 icon_x = x_frame_get_and_record_arg (f, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER); |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
2808 icon_y = x_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2809 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) |
389 | 2810 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
2811 CHECK_NUMBER (icon_x); |
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
2812 CHECK_NUMBER (icon_y); |
389 | 2813 } |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2814 else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound)) |
389 | 2815 error ("Both left and top icon corners of icon must be specified"); |
2816 | |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2817 BLOCK_INPUT; |
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2818 |
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
|
2819 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
|
2820 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
|
2821 |
69428
1b5fec6d607f
(x_icon): Disable redundant call to `x_wm_set_window_state'.
Károly Lőrentey <lorentey@elte.hu>
parents:
69404
diff
changeset
|
2822 #if 0 /* x_get_arg removes the visibility parameter as a side effect, |
1b5fec6d607f
(x_icon): Disable redundant call to `x_wm_set_window_state'.
Károly Lőrentey <lorentey@elte.hu>
parents:
69404
diff
changeset
|
2823 but x_create_frame still needs it. */ |
389 | 2824 /* 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
|
2825 x_wm_set_window_state |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
2826 (f, (EQ (x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL), |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
2827 Qicon) |
2294
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2828 ? IconicState |
9bce20507666
Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents:
2283
diff
changeset
|
2829 : NormalState)); |
69428
1b5fec6d607f
(x_icon): Disable redundant call to `x_wm_set_window_state'.
Károly Lőrentey <lorentey@elte.hu>
parents:
69404
diff
changeset
|
2830 #endif |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
2831 |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
2832 x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name) |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
2833 ? f->icon_name |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
2834 : f->name))); |
12073 | 2835 |
389 | 2836 UNBLOCK_INPUT; |
2837 } | |
2838 | |
31637
c1f4bdbf8465
(ALLOC_XPM_COLORS): Define if we can use Emacs' color
Gerd Moellmann <gerd@gnu.org>
parents:
31633
diff
changeset
|
2839 /* Make the GCs needed for this window, setting the |
389 | 2840 background, border and mouse colors; also create the |
2841 mouse cursor and the gray border tile. */ | |
2842 | |
1018
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2843 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
|
2844 { |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2845 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
|
2846 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
|
2847 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
|
2848 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
|
2849 }; |
5fd29acd3db7
* xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents:
974
diff
changeset
|
2850 |
389 | 2851 static void |
771 | 2852 x_make_gc (f) |
2853 struct frame *f; | |
389 | 2854 { |
2855 XGCValues gc_values; | |
2856 | |
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
|
2857 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
|
2858 |
31637
c1f4bdbf8465
(ALLOC_XPM_COLORS): Define if we can use Emacs' color
Gerd Moellmann <gerd@gnu.org>
parents:
31633
diff
changeset
|
2859 /* Create the GCs of this frame. |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2860 Note that many default values are used. */ |
389 | 2861 |
2862 /* Normal video */ | |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
2863 gc_values.font = FRAME_FONT (f)->fid; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
2864 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
|
2865 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
|
2866 gc_values.line_width = 0; /* Means 1 using fast algorithm. */ |
34321
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2867 f->output_data.x->normal_gc |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2868 = XCreateGC (FRAME_X_DISPLAY (f), |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2869 FRAME_X_WINDOW (f), |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2870 GCLineWidth | GCFont | GCForeground | GCBackground, |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2871 &gc_values); |
389 | 2872 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2873 /* 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
|
2874 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
|
2875 gc_values.background = f->output_data.x->foreground_pixel; |
34321
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2876 f->output_data.x->reverse_gc |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2877 = XCreateGC (FRAME_X_DISPLAY (f), |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2878 FRAME_X_WINDOW (f), |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2879 GCFont | GCForeground | GCBackground | GCLineWidth, |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2880 &gc_values); |
389 | 2881 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
2882 /* 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
|
2883 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
|
2884 gc_values.background = f->output_data.x->cursor_pixel; |
389 | 2885 gc_values.fill_style = FillOpaqueStippled; |
2886 gc_values.stipple | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2887 = XCreateBitmapFromData (FRAME_X_DISPLAY (f), |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
2888 FRAME_X_DISPLAY_INFO (f)->root_window, |
389 | 2889 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
|
2890 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
|
2891 = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
389 | 2892 (GCFont | GCForeground | GCBackground |
24905
2c79eecad64d
(x_make_gc): Turn off GCStipple when setting up cursor_gc.
Richard M. Stallman <rms@gnu.org>
parents:
24677
diff
changeset
|
2893 | GCFillStyle /* | GCStipple */ | GCLineWidth), |
389 | 2894 &gc_values); |
2895 | |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
2896 /* Reliefs. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
2897 f->output_data.x->white_relief.gc = 0; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
2898 f->output_data.x->black_relief.gc = 0; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
2899 |
389 | 2900 /* Create the gray border tile used when the pointer is not in |
771 | 2901 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
|
2902 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
|
2903 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
|
2904 = (XCreatePixmapFromBitmapData |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2905 (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
|
2906 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
|
2907 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
|
2908 f->output_data.x->background_pixel, |
37253
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
2909 DefaultDepth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (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
|
2910 |
1982e2983822
* xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents:
2328
diff
changeset
|
2911 UNBLOCK_INPUT; |
389 | 2912 } |
2913 | |
34321
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2914 |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2915 /* Free what was was allocated in x_make_gc. */ |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2916 |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2917 void |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2918 x_free_gcs (f) |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2919 struct frame *f; |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2920 { |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2921 Display *dpy = FRAME_X_DISPLAY (f); |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2922 |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2923 BLOCK_INPUT; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2924 |
34321
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2925 if (f->output_data.x->normal_gc) |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2926 { |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2927 XFreeGC (dpy, f->output_data.x->normal_gc); |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2928 f->output_data.x->normal_gc = 0; |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2929 } |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2930 |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2931 if (f->output_data.x->reverse_gc) |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2932 { |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2933 XFreeGC (dpy, f->output_data.x->reverse_gc); |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2934 f->output_data.x->reverse_gc = 0; |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2935 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2936 |
34321
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2937 if (f->output_data.x->cursor_gc) |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2938 { |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2939 XFreeGC (dpy, f->output_data.x->cursor_gc); |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2940 f->output_data.x->cursor_gc = 0; |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2941 } |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2942 |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2943 if (f->output_data.x->border_tile) |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2944 { |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2945 XFreePixmap (dpy, f->output_data.x->border_tile); |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2946 f->output_data.x->border_tile = 0; |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2947 } |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2948 |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2949 UNBLOCK_INPUT; |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2950 } |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2951 |
41ecc8525dbc
(x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
33994
diff
changeset
|
2952 |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2953 /* Handler for signals raised during x_create_frame and |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2954 x_create_top_frame. FRAME is the frame which is partially |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2955 constructed. */ |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2956 |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2957 static Lisp_Object |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2958 unwind_create_frame (frame) |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2959 Lisp_Object frame; |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2960 { |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2961 struct frame *f = XFRAME (frame); |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2962 |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2963 /* If frame is ``official'', nothing to do. */ |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2964 if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame)) |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2965 { |
34895
53e52b3525bf
Use #if GLYPH_DEBUG instead of #ifdef GLYPH_DEBUG.
Gerd Moellmann <gerd@gnu.org>
parents:
34662
diff
changeset
|
2966 #if GLYPH_DEBUG |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2967 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2968 #endif |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2969 |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2970 x_free_frame_resources (f); |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2971 |
59904
adc18da68682
(unwind_create_frame) [!GLYPH_DEBUG]: Fix xassert.
Kim F. Storm <storm@cua.dk>
parents:
59789
diff
changeset
|
2972 #if GLYPH_DEBUG |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2973 /* Check that reference counts are indeed correct. */ |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2974 xassert (dpyinfo->reference_count == dpyinfo_refcount); |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2975 xassert (dpyinfo->image_cache->refcount == image_cache_refcount); |
59904
adc18da68682
(unwind_create_frame) [!GLYPH_DEBUG]: Fix xassert.
Kim F. Storm <storm@cua.dk>
parents:
59789
diff
changeset
|
2976 #endif |
34638
abb4510a89f6
(unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents:
34598
diff
changeset
|
2977 return Qt; |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2978 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
2979 |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2980 return Qnil; |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2981 } |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2982 |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
2983 |
771 | 2984 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, |
389 | 2985 1, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
2986 doc: /* Make a new X window, which is called a "frame" in Emacs terms. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
2987 Returns an Emacs frame object. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
2988 ALIST is an alist of frame parameters. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
2989 If the parameters specify that the frame should not have a minibuffer, |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
2990 and do not specify a specific minibuffer window to use, |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
2991 then `default-minibuffer-frame' must be a frame whose minibuffer can |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
2992 be shared by the new frame. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
2993 |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
2994 This function is an internal primitive--use `make-frame' instead. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
2995 (parms) |
389 | 2996 Lisp_Object parms; |
2997 { | |
771 | 2998 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
|
2999 Lisp_Object frame, tem; |
389 | 3000 Lisp_Object name; |
3001 int minibuffer_only = 0; | |
3002 long window_prompting = 0; | |
3003 int width, height; | |
46285
3f111801efb4
Rename BINDING_STACK_SIZE to SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents:
45968
diff
changeset
|
3004 int count = SPECPDL_INDEX (); |
15566
3d03a3fb8757
(Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents:
15495
diff
changeset
|
3005 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3006 Lisp_Object display; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3007 struct x_display_info *dpyinfo = NULL; |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3008 Lisp_Object parent; |
11774
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3009 struct kboard *kb; |
389 | 3010 |
2999
33c820044087
(check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents:
2964
diff
changeset
|
3011 check_x (); |
389 | 3012 |
68396
75dead191600
(Fx_create_frame): Put all specified parms into f->param_alist
Richard M. Stallman <rms@gnu.org>
parents:
67842
diff
changeset
|
3013 parms = Fcopy_alist (parms); |
75dead191600
(Fx_create_frame): Put all specified parms into f->param_alist
Richard M. Stallman <rms@gnu.org>
parents:
67842
diff
changeset
|
3014 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3015 /* 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
|
3016 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
|
3017 Vx_resource_name = Vinvocation_name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3018 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3019 display = x_get_arg (dpyinfo, parms, Qdisplay, 0, 0, RES_TYPE_STRING); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3020 if (EQ (display, Qunbound)) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3021 display = Qnil; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3022 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
|
3023 #ifdef MULTI_KBOARD |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3024 kb = dpyinfo->kboard; |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3025 #else |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3026 kb = &the_only_kboard; |
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3027 #endif |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3028 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3029 name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING); |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
3030 if (!STRINGP (name) |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3031 && ! EQ (name, Qunbound) |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3032 && ! NILP (name)) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3033 error ("Invalid frame name--not a string or nil"); |
398 | 3034 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3035 if (STRINGP (name)) |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3036 Vx_resource_name = name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3037 |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3038 /* See if parent window is specified. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3039 parent = x_get_arg (dpyinfo, parms, Qparent_id, NULL, NULL, RES_TYPE_NUMBER); |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3040 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
|
3041 parent = Qnil; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3042 if (! NILP (parent)) |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
3043 CHECK_NUMBER (parent); |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3044 |
15566
3d03a3fb8757
(Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents:
15495
diff
changeset
|
3045 /* make_frame_without_minibuffer can run Lisp code and garbage collect. */ |
3d03a3fb8757
(Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents:
15495
diff
changeset
|
3046 /* No need to protect DISPLAY because that's not used after passing |
3d03a3fb8757
(Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents:
15495
diff
changeset
|
3047 it to make_frame_without_minibuffer. */ |
3d03a3fb8757
(Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents:
15495
diff
changeset
|
3048 frame = Qnil; |
3d03a3fb8757
(Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents:
15495
diff
changeset
|
3049 GCPRO4 (parms, parent, name, frame); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3050 tem = x_get_arg (dpyinfo, parms, Qminibuffer, "minibuffer", "Minibuffer", |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3051 RES_TYPE_SYMBOL); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3052 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
|
3053 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
|
3054 else if (EQ (tem, Qonly)) |
389 | 3055 { |
771 | 3056 f = make_minibuffer_frame (); |
389 | 3057 minibuffer_only = 1; |
3058 } | |
9103
948e8acb6990
(x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9022
diff
changeset
|
3059 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
|
3060 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
|
3061 else |
771 | 3062 f = make_frame (1); |
3063 | |
15566
3d03a3fb8757
(Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents:
15495
diff
changeset
|
3064 XSETFRAME (frame, f); |
3d03a3fb8757
(Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents:
15495
diff
changeset
|
3065 |
1994
73ce9dd21093
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1932
diff
changeset
|
3066 /* 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
|
3067 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
|
3068 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3069 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
|
3070 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
|
3071 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
|
3072 f->output_data.x->icon_bitmap = -1; |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
3073 FRAME_FONTSET (f) = -1; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3074 f->output_data.x->scroll_bar_foreground_pixel = -1; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3075 f->output_data.x->scroll_bar_background_pixel = -1; |
39619
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
3076 #ifdef USE_TOOLKIT_SCROLL_BARS |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
3077 f->output_data.x->scroll_bar_top_shadow_pixel = -1; |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
3078 f->output_data.x->scroll_bar_bottom_shadow_pixel = -1; |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
3079 #endif /* USE_TOOLKIT_SCROLL_BARS */ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3080 |
12276
2e376a4397bc
(x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents:
12209
diff
changeset
|
3081 f->icon_name |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3082 = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3083 RES_TYPE_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
|
3084 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
|
3085 f->icon_name = Qnil; |
12073 | 3086 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3087 FRAME_X_DISPLAY_INFO (f) = dpyinfo; |
71577
ae1e5666e49f
(Fx_create_frame): Move unwind_create_frame setup down.
Richard M. Stallman <rms@gnu.org>
parents:
71476
diff
changeset
|
3088 |
ae1e5666e49f
(Fx_create_frame): Move unwind_create_frame setup down.
Richard M. Stallman <rms@gnu.org>
parents:
71476
diff
changeset
|
3089 /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */ |
ae1e5666e49f
(Fx_create_frame): Move unwind_create_frame setup down.
Richard M. Stallman <rms@gnu.org>
parents:
71476
diff
changeset
|
3090 record_unwind_protect (unwind_create_frame, frame); |
34895
53e52b3525bf
Use #if GLYPH_DEBUG instead of #ifdef GLYPH_DEBUG.
Gerd Moellmann <gerd@gnu.org>
parents:
34662
diff
changeset
|
3091 #if GLYPH_DEBUG |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
3092 image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount; |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
3093 dpyinfo_refcount = dpyinfo->reference_count; |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
3094 #endif /* GLYPH_DEBUG */ |
11014
634a98104921
(Fx_create_frame): set the frame's kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10920
diff
changeset
|
3095 #ifdef MULTI_KBOARD |
11774
0b5cb5170084
(Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents:
11772
diff
changeset
|
3096 FRAME_KBOARD (f) = kb; |
11014
634a98104921
(Fx_create_frame): set the frame's kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10920
diff
changeset
|
3097 #endif |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3098 |
27987
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3099 /* These colors will be set anyway later, but it's important |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3100 to get the color reference counts right, so initialize them! */ |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3101 { |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3102 Lisp_Object black; |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3103 struct gcpro gcpro1; |
38345
3238db7bdfef
(Fx_create_frame): Initialize frame colors to -1,
Gerd Moellmann <gerd@gnu.org>
parents:
38183
diff
changeset
|
3104 |
3238db7bdfef
(Fx_create_frame): Initialize frame colors to -1,
Gerd Moellmann <gerd@gnu.org>
parents:
38183
diff
changeset
|
3105 /* Function x_decode_color can signal an error. Make |
3238db7bdfef
(Fx_create_frame): Initialize frame colors to -1,
Gerd Moellmann <gerd@gnu.org>
parents:
38183
diff
changeset
|
3106 sure to initialize color slots so that we won't try |
3238db7bdfef
(Fx_create_frame): Initialize frame colors to -1,
Gerd Moellmann <gerd@gnu.org>
parents:
38183
diff
changeset
|
3107 to free colors we haven't allocated. */ |
3238db7bdfef
(Fx_create_frame): Initialize frame colors to -1,
Gerd Moellmann <gerd@gnu.org>
parents:
38183
diff
changeset
|
3108 f->output_data.x->foreground_pixel = -1; |
3238db7bdfef
(Fx_create_frame): Initialize frame colors to -1,
Gerd Moellmann <gerd@gnu.org>
parents:
38183
diff
changeset
|
3109 f->output_data.x->background_pixel = -1; |
3238db7bdfef
(Fx_create_frame): Initialize frame colors to -1,
Gerd Moellmann <gerd@gnu.org>
parents:
38183
diff
changeset
|
3110 f->output_data.x->cursor_pixel = -1; |
3238db7bdfef
(Fx_create_frame): Initialize frame colors to -1,
Gerd Moellmann <gerd@gnu.org>
parents:
38183
diff
changeset
|
3111 f->output_data.x->cursor_foreground_pixel = -1; |
3238db7bdfef
(Fx_create_frame): Initialize frame colors to -1,
Gerd Moellmann <gerd@gnu.org>
parents:
38183
diff
changeset
|
3112 f->output_data.x->border_pixel = -1; |
3238db7bdfef
(Fx_create_frame): Initialize frame colors to -1,
Gerd Moellmann <gerd@gnu.org>
parents:
38183
diff
changeset
|
3113 f->output_data.x->mouse_pixel = -1; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
3114 |
27987
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3115 black = build_string ("black"); |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3116 GCPRO1 (black); |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3117 f->output_data.x->foreground_pixel |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3118 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3119 f->output_data.x->background_pixel |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3120 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3121 f->output_data.x->cursor_pixel |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3122 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3123 f->output_data.x->cursor_foreground_pixel |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3124 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3125 f->output_data.x->border_pixel |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3126 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3127 f->output_data.x->mouse_pixel |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3128 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3129 UNGCPRO; |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3130 } |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
3131 |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3132 /* 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
|
3133 |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3134 if (!NILP (parent)) |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3135 { |
18612
88efccff8970
Fix bugs with inappropriate mixing of Lisp_Object with int.
Richard M. Stallman <rms@gnu.org>
parents:
18594
diff
changeset
|
3136 f->output_data.x->parent_desc = (Window) XFASTINT (parent); |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3137 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
|
3138 } |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3139 else |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3140 { |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3141 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
|
3142 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
|
3143 } |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3144 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3145 /* 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
|
3146 be set. */ |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3147 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
|
3148 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3149 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
|
3150 f->explicit_name = 0; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3151 } |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3152 else |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3153 { |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3154 f->name = name; |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3155 f->explicit_name = 1; |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3156 /* 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
|
3157 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
|
3158 } |
771 | 3159 |
389 | 3160 /* Extract the window parameters from the supplied values |
3161 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
|
3162 { |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
3163 Lisp_Object font; |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
3164 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3165 font = x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING); |
18947
386d68191907
(Fx_create_frame): Don't fail to initialize `font'.
Richard M. Stallman <rms@gnu.org>
parents:
18893
diff
changeset
|
3166 |
4150
e2e92cd737bf
* xfns.c (Fx_create_frame): Block input around call to
Jim Blandy <jimb@redhat.com>
parents:
4146
diff
changeset
|
3167 BLOCK_INPUT; |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3168 /* 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
|
3169 if (STRINGP (font)) |
17048
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
3170 { |
21555
0927f341e390
(x_set_font): Give 2nd arg nil to Fquery_fontset.
Kenichi Handa <handa@m17n.org>
parents:
21549
diff
changeset
|
3171 tem = Fquery_fontset (font, Qnil); |
17722
27df69e20b98
(Fx_create_frame): Delete code for handling the X
Kenichi Handa <handa@m17n.org>
parents:
17629
diff
changeset
|
3172 if (STRINGP (tem)) |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
3173 font = x_new_fontset (f, SDATA (tem)); |
17048
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
3174 else |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
3175 font = x_new_font (f, SDATA (font)); |
17048
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
3176 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
3177 |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3178 /* 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
|
3179 if (!STRINGP (font)) |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3180 font = x_new_font (f, "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1"); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3181 if (!STRINGP (font)) |
8270
1a0af0f4fb1d
(Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents:
8192
diff
changeset
|
3182 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
|
3183 if (! STRINGP (font)) |
8270
1a0af0f4fb1d
(Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents:
8192
diff
changeset
|
3184 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
|
3185 if (! STRINGP (font)) |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3186 /* 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
|
3187 and takes too long. */ |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3188 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
|
3189 /* 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
|
3190 if (! STRINGP (font)) |
8270
1a0af0f4fb1d
(Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents:
8192
diff
changeset
|
3191 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
|
3192 UNBLOCK_INPUT; |
e2e92cd737bf
* xfns.c (Fx_create_frame): Block input around call to
Jim Blandy <jimb@redhat.com>
parents:
4146
diff
changeset
|
3193 if (! STRINGP (font)) |
4259
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3194 font = build_string ("fixed"); |
085095792d99
(Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents:
4195
diff
changeset
|
3195 |
71476
9e62d7b78e51
* xfns.c (Fx_create_frame): Set font parameter directly instead of
Chong Yidong <cyd@stupidchicken.com>
parents:
71173
diff
changeset
|
3196 x_set_frame_parameters (f, Fcons (Fcons (Qfont, font), Qnil)); |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
3197 } |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3198 |
15720
f1549b7501af
(Fx_create_frame): Do xlwmenu hack only if USE_LUCID.
Karl Heuer <kwzh@gnu.org>
parents:
15706
diff
changeset
|
3199 #ifdef USE_LUCID |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
3200 /* 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
|
3201 whereby it fails to get any font. */ |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
3202 xlwmenu_default_font = FRAME_FONT (f); |
9808
4c43c9dbe130
(x_window): Make ibw 0 by default.
Richard M. Stallman <rms@gnu.org>
parents:
9742
diff
changeset
|
3203 #endif |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
3204 |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3205 x_default_parameter (f, parms, Qborder_width, make_number (2), |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3206 "borderWidth", "BorderWidth", RES_TYPE_NUMBER); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
3207 |
40715 | 3208 /* This defaults to 1 in order to match xterm. We recognize either |
3923
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3209 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
|
3210 it). */ |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3211 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
|
3212 { |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3213 Lisp_Object value; |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3214 |
17779
094e5efd262d
(Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents:
17722
diff
changeset
|
3215 value = x_get_arg (dpyinfo, parms, Qinternal_border_width, |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3216 "internalBorder", "internalBorder", RES_TYPE_NUMBER); |
3923
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3217 if (! EQ (value, Qunbound)) |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3218 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
|
3219 parms); |
cb16ebff1c44
* xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents:
3888
diff
changeset
|
3220 } |
16302
025b3dc7a6ba
(Fx_create_frame): Default Qinternal_border_width to 1.
Richard M. Stallman <rms@gnu.org>
parents:
16254
diff
changeset
|
3221 x_default_parameter (f, parms, Qinternal_border_width, make_number (1), |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3222 "internalBorderWidth", "internalBorderWidth", |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3223 RES_TYPE_NUMBER); |
16254
3e8b16badf3d
(Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents:
16156
diff
changeset
|
3224 x_default_parameter (f, parms, Qvertical_scroll_bars, Qleft, |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3225 "verticalScrollBars", "ScrollBars", |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3226 RES_TYPE_SYMBOL); |
389 | 3227 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3228 /* 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
|
3229 x_default_parameter (f, parms, Qforeground_color, build_string ("black"), |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3230 "foreground", "Foreground", RES_TYPE_STRING); |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3231 x_default_parameter (f, parms, Qbackground_color, build_string ("white"), |
26808 | 3232 "background", "Background", RES_TYPE_STRING); |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3233 x_default_parameter (f, parms, Qmouse_color, build_string ("black"), |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3234 "pointerColor", "Foreground", RES_TYPE_STRING); |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3235 x_default_parameter (f, parms, Qcursor_color, build_string ("black"), |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3236 "cursorColor", "Foreground", RES_TYPE_STRING); |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3237 x_default_parameter (f, parms, Qborder_color, build_string ("black"), |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3238 "borderColor", "BorderColor", RES_TYPE_STRING); |
25528
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
3239 x_default_parameter (f, parms, Qscreen_gamma, Qnil, |
b5dd1bafd001
Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents:
25511
diff
changeset
|
3240 "screenGamma", "ScreenGamma", RES_TYPE_FLOAT); |
28690
01a3287bb747
(x_set_line_spacing): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
28597
diff
changeset
|
3241 x_default_parameter (f, parms, Qline_spacing, Qnil, |
01a3287bb747
(x_set_line_spacing): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
28597
diff
changeset
|
3242 "lineSpacing", "LineSpacing", RES_TYPE_NUMBER); |
41722
fd499c5c75d2
(x_frame_parms): Add `left-fringe' and `right-fringe' parms.
Kim F. Storm <storm@cua.dk>
parents:
41449
diff
changeset
|
3243 x_default_parameter (f, parms, Qleft_fringe, Qnil, |
fd499c5c75d2
(x_frame_parms): Add `left-fringe' and `right-fringe' parms.
Kim F. Storm <storm@cua.dk>
parents:
41449
diff
changeset
|
3244 "leftFringe", "LeftFringe", RES_TYPE_NUMBER); |
fd499c5c75d2
(x_frame_parms): Add `left-fringe' and `right-fringe' parms.
Kim F. Storm <storm@cua.dk>
parents:
41449
diff
changeset
|
3245 x_default_parameter (f, parms, Qright_fringe, Qnil, |
fd499c5c75d2
(x_frame_parms): Add `left-fringe' and `right-fringe' parms.
Kim F. Storm <storm@cua.dk>
parents:
41449
diff
changeset
|
3246 "rightFringe", "RightFringe", RES_TYPE_NUMBER); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3247 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3248 x_default_scroll_bar_color_parameter (f, parms, Qscroll_bar_foreground, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3249 "scrollBarForeground", |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3250 "ScrollBarForeground", 1); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3251 x_default_scroll_bar_color_parameter (f, parms, Qscroll_bar_background, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3252 "scrollBarBackground", |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3253 "ScrollBarBackground", 0); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3254 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3255 /* Init faces before x_default_parameter is called for scroll-bar |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3256 parameters because that function calls x_set_scroll_bar_width, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3257 which calls change_frame_size, which calls Fset_window_buffer, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3258 which runs hooks, which call Fvertical_motion. At the end, we |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3259 end up in init_iterator with a null face cache, which should not |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3260 happen. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3261 init_frame_faces (f); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
3262 |
8758
fac1c4722677
(Fx_create_frame): Make 1 the default for menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
8675
diff
changeset
|
3263 x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1), |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3264 "menuBar", "MenuBar", RES_TYPE_NUMBER); |
31824
b3295c7e7a60
(Fx_create_frame): Set default frame parameter value
Gerd Moellmann <gerd@gnu.org>
parents:
31768
diff
changeset
|
3265 x_default_parameter (f, parms, Qtool_bar_lines, make_number (1), |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3266 "toolBar", "ToolBar", RES_TYPE_NUMBER); |
13083
16638ebb209f
(Fx_create_frame): Set up buffer-predicate slot.
Richard M. Stallman <rms@gnu.org>
parents:
12832
diff
changeset
|
3267 x_default_parameter (f, parms, Qbuffer_predicate, Qnil, |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3268 "bufferPredicate", "BufferPredicate", |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3269 RES_TYPE_SYMBOL); |
14381 | 3270 x_default_parameter (f, parms, Qtitle, Qnil, |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3271 "title", "Title", RES_TYPE_STRING); |
38183
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
3272 x_default_parameter (f, parms, Qwait_for_wm, Qt, |
3ef7b5a020b2
(Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37946
diff
changeset
|
3273 "waitForWM", "WaitForWM", RES_TYPE_BOOLEAN); |
42721
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
3274 x_default_parameter (f, parms, Qfullscreen, Qnil, |
462e0bbae65d
(Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents:
42247
diff
changeset
|
3275 "fullscreen", "Fullscreen", RES_TYPE_SYMBOL); |
6882
3096a6f7fffb
(Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents:
6790
diff
changeset
|
3276 |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12656
diff
changeset
|
3277 f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; |
36459
919d77f8d0ff
(Fx_create_frame): Adjust the frame's height for presence
Gerd Moellmann <gerd@gnu.org>
parents:
36448
diff
changeset
|
3278 |
919d77f8d0ff
(Fx_create_frame): Adjust the frame's height for presence
Gerd Moellmann <gerd@gnu.org>
parents:
36448
diff
changeset
|
3279 /* Compute the size of the X window. */ |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
3280 window_prompting = x_figure_window_size (f, parms, 1); |
7263
b7025b4bf659
(Fx_create_frame): Set the size_hint_flags field.
Richard M. Stallman <rms@gnu.org>
parents:
7261
diff
changeset
|
3281 |
25320
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3282 tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3283 f->no_split = minibuffer_only || EQ (tem, Qt); |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3284 |
56513
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
3285 x_icon_verify (f, parms); |
5044b3527ce8
(x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55546
diff
changeset
|
3286 |
35733
4f422aadd415
(Fx_create_frame): Add the tool bar height to the frame
Gerd Moellmann <gerd@gnu.org>
parents:
35592
diff
changeset
|
3287 /* Create the X widget or window. */ |
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
|
3288 #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
|
3289 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
|
3290 #else |
771 | 3291 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
|
3292 #endif |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
3293 |
771 | 3294 x_icon (f, parms); |
3295 x_make_gc (f); | |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3296 |
25320
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3297 /* Now consider the frame official. */ |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3298 FRAME_X_DISPLAY_INFO (f)->reference_count++; |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3299 Vframe_list = Fcons (frame, Vframe_list); |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3300 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3301 /* 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
|
3302 icon-creation functions can say whose icon they're describing. */ |
65936
2c78610a49f1
* xfns.c (Fx_create_frame): Make bitmapIcon have default on.
Jan Djärv <jan.h.d@swipnet.se>
parents:
65459
diff
changeset
|
3303 x_default_parameter (f, parms, Qicon_type, Qt, |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3304 "bitmapIcon", "BitmapIcon", RES_TYPE_SYMBOL); |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3305 |
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3306 x_default_parameter (f, parms, Qauto_raise, Qnil, |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3307 "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN); |
1786
5179baee010b
* xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents:
1733
diff
changeset
|
3308 x_default_parameter (f, parms, Qauto_lower, Qnil, |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3309 "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1786
diff
changeset
|
3310 x_default_parameter (f, parms, Qcursor_type, Qbox, |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3311 "cursorType", "CursorType", RES_TYPE_SYMBOL); |
26978
06f887a1c834
(Fx_create_frame): Move x_default_parameter calls that
Gerd Moellmann <gerd@gnu.org>
parents:
26954
diff
changeset
|
3312 x_default_parameter (f, parms, Qscroll_bar_width, Qnil, |
06f887a1c834
(Fx_create_frame): Move x_default_parameter calls that
Gerd Moellmann <gerd@gnu.org>
parents:
26954
diff
changeset
|
3313 "scrollBarWidth", "ScrollBarWidth", |
06f887a1c834
(Fx_create_frame): Move x_default_parameter calls that
Gerd Moellmann <gerd@gnu.org>
parents:
26954
diff
changeset
|
3314 RES_TYPE_NUMBER); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
3315 |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
3316 /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size. |
389 | 3317 Change will not be effected unless different from the current |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
3318 FRAME_LINES (f). */ |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
3319 width = FRAME_COLS (f); |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
3320 height = FRAME_LINES (f); |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
3321 |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
3322 SET_FRAME_COLS (f, 0); |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
3323 FRAME_LINES (f) = 0; |
25363
bf0488244270
Call change_frame_size and do_pending_window_change with
Gerd Moellmann <gerd@gnu.org>
parents:
25335
diff
changeset
|
3324 change_frame_size (f, height, width, 1, 0, 0); |
2136
17ab6ed0f98b
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2067
diff
changeset
|
3325 |
49322 | 3326 #if defined (USE_X_TOOLKIT) || defined (USE_GTK) |
25320
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3327 /* Create the menu bar. */ |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3328 if (!minibuffer_only && FRAME_EXTERNAL_MENU_BAR (f)) |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3329 { |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3330 /* If this signals an error, we haven't set size hints for the |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3331 frame and we didn't make it visible. */ |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3332 initialize_frame_menubar (f); |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3333 |
49322 | 3334 #ifndef USE_GTK |
25320
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3335 /* This is a no-op, except under Motif where it arranges the |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3336 main window for the widgets on it. */ |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3337 lw_set_main_areas (f->output_data.x->column_widget, |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3338 f->output_data.x->menubar_widget, |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3339 f->output_data.x->edit_widget); |
49322 | 3340 #endif /* not USE_GTK */ |
3341 } | |
3342 #endif /* USE_X_TOOLKIT || USE_GTK */ | |
25320
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3343 |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3344 /* Tell the server what size and position, etc, we want, and how |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3345 badly we want them. This should be done after we have the menu |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3346 bar so that its size can be taken into account. */ |
389 | 3347 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
|
3348 x_wm_set_size_hint (f, window_prompting, 0); |
389 | 3349 UNBLOCK_INPUT; |
3350 | |
25320
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3351 /* Make the window appear on the frame and enable display, unless |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3352 the caller says not to. However, with explicit parent, Emacs |
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3353 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
|
3354 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
|
3355 { |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3356 Lisp_Object visibility; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3357 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3358 visibility = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
3359 RES_TYPE_SYMBOL); |
10222
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3360 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
|
3361 visibility = Qt; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3362 |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3363 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
|
3364 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
|
3365 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
|
3366 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
|
3367 else |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3368 /* 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
|
3369 ; |
617bee0c64f6
(x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents:
10080
diff
changeset
|
3370 } |
771 | 3371 |
52298
1a4bd2bec861
Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents:
52095
diff
changeset
|
3372 /* Set the WM leader property. GTK does this itself, so this is not |
1a4bd2bec861
Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents:
52095
diff
changeset
|
3373 needed when using GTK. */ |
1a4bd2bec861
Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents:
52095
diff
changeset
|
3374 if (dpyinfo->client_leader_window != 0) |
1a4bd2bec861
Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents:
52095
diff
changeset
|
3375 { |
1a4bd2bec861
Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents:
52095
diff
changeset
|
3376 BLOCK_INPUT; |
1a4bd2bec861
Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents:
52095
diff
changeset
|
3377 XChangeProperty (FRAME_X_DISPLAY (f), |
1a4bd2bec861
Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents:
52095
diff
changeset
|
3378 FRAME_OUTER_WINDOW (f), |
1a4bd2bec861
Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents:
52095
diff
changeset
|
3379 dpyinfo->Xatom_wm_client_leader, |
1a4bd2bec861
Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents:
52095
diff
changeset
|
3380 XA_WINDOW, 32, PropModeReplace, |
67264
d50a6a8cfd1e
* xfns.c (x_real_positions): int ign => unsigned int.
Jan Djärv <jan.h.d@swipnet.se>
parents:
66931
diff
changeset
|
3381 (unsigned char *) &dpyinfo->client_leader_window, 1); |
52298
1a4bd2bec861
Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents:
52095
diff
changeset
|
3382 UNBLOCK_INPUT; |
1a4bd2bec861
Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents:
52095
diff
changeset
|
3383 } |
1a4bd2bec861
Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents:
52095
diff
changeset
|
3384 |
67363
87de4735ecc9
(Fx_create_frame): Initialize Vdefault_minibuffer_frame, when needed.
Károly Lőrentey <lorentey@elte.hu>
parents:
67264
diff
changeset
|
3385 /* Initialize `default-minibuffer-frame' in case this is the first |
87de4735ecc9
(Fx_create_frame): Initialize Vdefault_minibuffer_frame, when needed.
Károly Lőrentey <lorentey@elte.hu>
parents:
67264
diff
changeset
|
3386 frame on this display device. */ |
87de4735ecc9
(Fx_create_frame): Initialize Vdefault_minibuffer_frame, when needed.
Károly Lőrentey <lorentey@elte.hu>
parents:
67264
diff
changeset
|
3387 if (FRAME_HAS_MINIBUF_P (f) |
87de4735ecc9
(Fx_create_frame): Initialize Vdefault_minibuffer_frame, when needed.
Károly Lőrentey <lorentey@elte.hu>
parents:
67264
diff
changeset
|
3388 && (!FRAMEP (kb->Vdefault_minibuffer_frame) |
87de4735ecc9
(Fx_create_frame): Initialize Vdefault_minibuffer_frame, when needed.
Károly Lőrentey <lorentey@elte.hu>
parents:
67264
diff
changeset
|
3389 || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame)))) |
87de4735ecc9
(Fx_create_frame): Initialize Vdefault_minibuffer_frame, when needed.
Károly Lőrentey <lorentey@elte.hu>
parents:
67264
diff
changeset
|
3390 kb->Vdefault_minibuffer_frame = frame; |
87de4735ecc9
(Fx_create_frame): Initialize Vdefault_minibuffer_frame, when needed.
Károly Lőrentey <lorentey@elte.hu>
parents:
67264
diff
changeset
|
3391 |
68396
75dead191600
(Fx_create_frame): Put all specified parms into f->param_alist
Richard M. Stallman <rms@gnu.org>
parents:
67842
diff
changeset
|
3392 /* All remaining specified parameters, which have not been "used" |
75dead191600
(Fx_create_frame): Put all specified parms into f->param_alist
Richard M. Stallman <rms@gnu.org>
parents:
67842
diff
changeset
|
3393 by x_get_arg and friends, now go in the misc. alist of the frame. */ |
75dead191600
(Fx_create_frame): Put all specified parms into f->param_alist
Richard M. Stallman <rms@gnu.org>
parents:
67842
diff
changeset
|
3394 for (tem = parms; !NILP (tem); tem = XCDR (tem)) |
75dead191600
(Fx_create_frame): Put all specified parms into f->param_alist
Richard M. Stallman <rms@gnu.org>
parents:
67842
diff
changeset
|
3395 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) |
75dead191600
(Fx_create_frame): Put all specified parms into f->param_alist
Richard M. Stallman <rms@gnu.org>
parents:
67842
diff
changeset
|
3396 f->param_alist = Fcons (XCAR (tem), f->param_alist); |
75dead191600
(Fx_create_frame): Put all specified parms into f->param_alist
Richard M. Stallman <rms@gnu.org>
parents:
67842
diff
changeset
|
3397 |
25320
107c9221181c
(x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents:
25289
diff
changeset
|
3398 UNGCPRO; |
36594
756c28377036
(Fx_create_frame): Clear Vwindow_list.
Gerd Moellmann <gerd@gnu.org>
parents:
36459
diff
changeset
|
3399 |
756c28377036
(Fx_create_frame): Clear Vwindow_list.
Gerd Moellmann <gerd@gnu.org>
parents:
36459
diff
changeset
|
3400 /* Make sure windows on this frame appear in calls to next-window |
756c28377036
(Fx_create_frame): Clear Vwindow_list.
Gerd Moellmann <gerd@gnu.org>
parents:
36459
diff
changeset
|
3401 and similar functions. */ |
756c28377036
(Fx_create_frame): Clear Vwindow_list.
Gerd Moellmann <gerd@gnu.org>
parents:
36459
diff
changeset
|
3402 Vwindow_list = Qnil; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
3403 |
5671
5c597b8fbabe
Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents:
5558
diff
changeset
|
3404 return unbind_to (count, frame); |
389 | 3405 } |
3406 | |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
3407 |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3408 /* 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
|
3409 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
|
3410 know about that structure. */ |
16156
d435199e529d
(x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents:
16041
diff
changeset
|
3411 |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3412 Lisp_Object |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3413 x_get_focus_frame (frame) |
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3414 struct frame *frame; |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3415 { |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3416 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
|
3417 Lisp_Object xfocus; |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3418 if (! dpyinfo->x_focus_frame) |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3419 return Qnil; |
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3420 |
11537
9d4df3cf95b3
(x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents:
11496
diff
changeset
|
3421 XSETFRAME (xfocus, dpyinfo->x_focus_frame); |
6485
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3422 return xfocus; |
b0825eef18b1
(x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6480
diff
changeset
|
3423 } |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3424 |
28044
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3425 |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3426 /* In certain situations, when the window manager follows a |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3427 click-to-focus policy, there seems to be no way around calling |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3428 XSetInputFocus to give another frame the input focus . |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3429 |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3430 In an ideal world, XSetInputFocus should generally be avoided so |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3431 that applications don't interfere with the window manager's focus |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3432 policy. But I think it's okay to use when it's clearly done |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3433 following a user-command. */ |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3434 |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3435 DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3436 doc: /* Set the input focus to FRAME. |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3437 FRAME nil means use the selected frame. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3438 (frame) |
28044
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3439 Lisp_Object frame; |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3440 { |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3441 struct frame *f = check_x_frame (frame); |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3442 Display *dpy = FRAME_X_DISPLAY (f); |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3443 |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3444 BLOCK_INPUT; |
69152
f2147c1027b6
* xterm.h (x_catch_errors) Return value changed to void.
Chong Yidong <cyd@stupidchicken.com>
parents:
69065
diff
changeset
|
3445 x_catch_errors (dpy); |
28044
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3446 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3447 RevertToParent, CurrentTime); |
69173
fdee8318ddc9
* xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary
Chong Yidong <cyd@stupidchicken.com>
parents:
69152
diff
changeset
|
3448 x_uncatch_errors (); |
28044
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3449 UNBLOCK_INPUT; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
3450 |
28044
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3451 return Qnil; |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3452 } |
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3453 |
3048
96ff8e5744b2
* xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents:
3015
diff
changeset
|
3454 |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26571
diff
changeset
|
3455 DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3456 doc: /* Internal function called by `color-defined-p', which see. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3457 (color, frame) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3458 Lisp_Object color, frame; |
389 | 3459 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3460 XColor foo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3461 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
|
3462 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
3463 CHECK_STRING (color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3464 |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
3465 if (x_defined_color (f, SDATA (color), &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
|
3466 return Qt; |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3467 else |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3468 return Qnil; |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3469 } |
1fe413b0a916
(defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents:
8655
diff
changeset
|
3470 |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26571
diff
changeset
|
3471 DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3472 doc: /* Internal function called by `color-values', which see. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3473 (color, frame) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3474 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
|
3475 { |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3476 XColor foo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3477 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
|
3478 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
3479 CHECK_STRING (color); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3480 |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
3481 if (x_defined_color (f, SDATA (color), &foo, 0)) |
72529
892ea79efee6
(Fxw_color_values): Simplify; use list3.
Kim F. Storm <storm@cua.dk>
parents:
71993
diff
changeset
|
3482 return list3 (make_number (foo.red), |
892ea79efee6
(Fxw_color_values): Simplify; use list3.
Kim F. Storm <storm@cua.dk>
parents:
71993
diff
changeset
|
3483 make_number (foo.green), |
892ea79efee6
(Fxw_color_values): Simplify; use list3.
Kim F. Storm <storm@cua.dk>
parents:
71993
diff
changeset
|
3484 make_number (foo.blue)); |
389 | 3485 else |
3486 return Qnil; | |
3487 } | |
3488 | |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26571
diff
changeset
|
3489 DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3490 doc: /* Internal function called by `display-color-p', which see. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3491 (display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3492 Lisp_Object display; |
389 | 3493 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3494 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
|
3495 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3496 if (dpyinfo->n_planes <= 2) |
389 | 3497 return Qnil; |
3498 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3499 switch (dpyinfo->visual->class) |
389 | 3500 { |
3501 case StaticColor: | |
3502 case PseudoColor: | |
3503 case TrueColor: | |
3504 case DirectColor: | |
3505 return Qt; | |
3506 | |
3507 default: | |
3508 return Qnil; | |
3509 } | |
3510 } | |
3511 | |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3512 DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p, |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3513 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3514 doc: /* Return t if the X display supports shades of gray. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3515 Note that color displays do support shades of gray. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3516 The optional argument DISPLAY specifies which display to ask about. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3517 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3518 If omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3519 (display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3520 Lisp_Object display; |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3521 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3522 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
|
3523 |
12347
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3524 if (dpyinfo->n_planes <= 1) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3525 return Qnil; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3526 |
12347
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3527 switch (dpyinfo->visual->class) |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3528 { |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3529 case StaticColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3530 case PseudoColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3531 case TrueColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3532 case DirectColor: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3533 case StaticGray: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3534 case GrayScale: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3535 return Qt; |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3536 |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3537 default: |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3538 return Qnil; |
0731c1ec96ad
(Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents:
12316
diff
changeset
|
3539 } |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3540 } |
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
3541 |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3542 DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width, |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3543 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3544 doc: /* Returns the width in pixels of the X display DISPLAY. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3545 The optional argument DISPLAY specifies which display to ask about. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3546 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3547 If omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3548 (display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3549 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3550 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3551 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
|
3552 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3553 return make_number (dpyinfo->width); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3554 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3555 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3556 DEFUN ("x-display-pixel-height", Fx_display_pixel_height, |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3557 Sx_display_pixel_height, 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3558 doc: /* Returns the height in pixels of the X display DISPLAY. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3559 The optional argument DISPLAY specifies which display to ask about. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3560 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3561 If omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3562 (display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3563 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3564 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3565 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
|
3566 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3567 return make_number (dpyinfo->height); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3568 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3569 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3570 DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes, |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3571 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3572 doc: /* Returns the number of bitplanes of the X display DISPLAY. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3573 The optional argument DISPLAY specifies which display to ask about. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3574 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3575 If omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3576 (display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3577 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3578 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3579 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
|
3580 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3581 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
|
3582 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3583 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3584 DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells, |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3585 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3586 doc: /* Returns the number of color cells of the X display DISPLAY. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3587 The optional argument DISPLAY specifies which display to ask about. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3588 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3589 If omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3590 (display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3591 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3592 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3593 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
|
3594 |
54218
6f75b2135827
* xfns.c (Fx_display_color_cells): Use number of planes to calculate
Jan Djärv <jan.h.d@swipnet.se>
parents:
54185
diff
changeset
|
3595 int nr_planes = DisplayPlanes (dpyinfo->display, |
6f75b2135827
* xfns.c (Fx_display_color_cells): Use number of planes to calculate
Jan Djärv <jan.h.d@swipnet.se>
parents:
54185
diff
changeset
|
3596 XScreenNumberOfScreen (dpyinfo->screen)); |
6f75b2135827
* xfns.c (Fx_display_color_cells): Use number of planes to calculate
Jan Djärv <jan.h.d@swipnet.se>
parents:
54185
diff
changeset
|
3597 |
6f75b2135827
* xfns.c (Fx_display_color_cells): Use number of planes to calculate
Jan Djärv <jan.h.d@swipnet.se>
parents:
54185
diff
changeset
|
3598 /* Truncate nr_planes to 24 to avoid integer overflow. |
6f75b2135827
* xfns.c (Fx_display_color_cells): Use number of planes to calculate
Jan Djärv <jan.h.d@swipnet.se>
parents:
54185
diff
changeset
|
3599 Some displays says 32, but only 24 bits are actually significant. |
6f75b2135827
* xfns.c (Fx_display_color_cells): Use number of planes to calculate
Jan Djärv <jan.h.d@swipnet.se>
parents:
54185
diff
changeset
|
3600 There are only very few and rare video cards that have more than |
6f75b2135827
* xfns.c (Fx_display_color_cells): Use number of planes to calculate
Jan Djärv <jan.h.d@swipnet.se>
parents:
54185
diff
changeset
|
3601 24 significant bits. Also 24 bits is more than 16 million colors, |
6f75b2135827
* xfns.c (Fx_display_color_cells): Use number of planes to calculate
Jan Djärv <jan.h.d@swipnet.se>
parents:
54185
diff
changeset
|
3602 it "should be enough for everyone". */ |
6f75b2135827
* xfns.c (Fx_display_color_cells): Use number of planes to calculate
Jan Djärv <jan.h.d@swipnet.se>
parents:
54185
diff
changeset
|
3603 if (nr_planes > 24) nr_planes = 24; |
6f75b2135827
* xfns.c (Fx_display_color_cells): Use number of planes to calculate
Jan Djärv <jan.h.d@swipnet.se>
parents:
54185
diff
changeset
|
3604 |
6f75b2135827
* xfns.c (Fx_display_color_cells): Use number of planes to calculate
Jan Djärv <jan.h.d@swipnet.se>
parents:
54185
diff
changeset
|
3605 return make_number (1 << nr_planes); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3606 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3607 |
4279 | 3608 DEFUN ("x-server-max-request-size", Fx_server_max_request_size, |
3609 Sx_server_max_request_size, | |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3610 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3611 doc: /* Returns the maximum request size of the X server of display DISPLAY. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3612 The optional argument DISPLAY specifies which display to ask about. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3613 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3614 If omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3615 (display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3616 Lisp_Object display; |
4279 | 3617 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3618 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
|
3619 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3620 return make_number (MAXREQUEST (dpyinfo->display)); |
4279 | 3621 } |
3622 | |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3623 DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, |
57765
77c93cbb1721
(Fx_server_vendor, Fx_server_version): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents:
57714
diff
changeset
|
3624 doc: /* Returns the "vendor ID" string of the X server of display DISPLAY. |
77c93cbb1721
(Fx_server_vendor, Fx_server_version): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents:
57714
diff
changeset
|
3625 \(Labelling every distributor as a "vendor" embodies the false assumption |
77c93cbb1721
(Fx_server_vendor, Fx_server_version): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents:
57714
diff
changeset
|
3626 that operating systems cannot be developed and distributed noncommercially.) |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3627 The optional argument DISPLAY specifies which display to ask about. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3628 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3629 If omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3630 (display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3631 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3632 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3633 struct x_display_info *dpyinfo = check_x_display_info (display); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3634 char *vendor = ServerVendor (dpyinfo->display); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3635 |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3636 if (! vendor) vendor = ""; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3637 return build_string (vendor); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3638 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3639 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3640 DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3641 doc: /* Returns the version numbers of the X server of display DISPLAY. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3642 The value is a list of three integers: the major and minor |
57765
77c93cbb1721
(Fx_server_vendor, Fx_server_version): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents:
57714
diff
changeset
|
3643 version numbers of the X Protocol in use, and the distributor-specific release |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3644 number. See also the function `x-server-vendor'. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3645 |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3646 The optional argument DISPLAY specifies which display to ask about. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3647 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3648 If omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3649 (display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3650 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3651 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3652 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
|
3653 Display *dpy = dpyinfo->display; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3654 |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3655 return Fcons (make_number (ProtocolVersion (dpy)), |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3656 Fcons (make_number (ProtocolRevision (dpy)), |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3657 Fcons (make_number (VendorRelease (dpy)), Qnil))); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3658 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3659 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3660 DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3661 doc: /* Return the number of screens on the X server of display DISPLAY. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3662 The optional argument DISPLAY specifies which display to ask about. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3663 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3664 If omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3665 (display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3666 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3667 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3668 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
|
3669 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3670 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
|
3671 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3672 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3673 DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3674 doc: /* Return the height in millimeters of the X display DISPLAY. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3675 The optional argument DISPLAY specifies which display to ask about. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3676 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3677 If omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3678 (display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3679 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
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 (HeightMMOfScreen (dpyinfo->screen)); |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3684 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3685 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3686 DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3687 doc: /* Return the width in millimeters of the X display DISPLAY. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3688 The optional argument DISPLAY specifies which display to ask about. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3689 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3690 If omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3691 (display) |
9690
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 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3696 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
|
3697 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3698 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3699 DEFUN ("x-display-backing-store", Fx_display_backing_store, |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3700 Sx_display_backing_store, 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3701 doc: /* Returns an indication of whether X display DISPLAY does backing store. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3702 The value may be `always', `when-mapped', or `not-useful'. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3703 The optional argument DISPLAY specifies which display to ask about. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3704 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3705 If omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3706 (display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3707 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3708 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3709 struct x_display_info *dpyinfo = check_x_display_info (display); |
31543
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3710 Lisp_Object result; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3711 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3712 switch (DoesBackingStore (dpyinfo->screen)) |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3713 { |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3714 case Always: |
31543
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3715 result = intern ("always"); |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3716 break; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3717 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3718 case WhenMapped: |
31543
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3719 result = intern ("when-mapped"); |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3720 break; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3721 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3722 case NotUseful: |
31543
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3723 result = intern ("not-useful"); |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3724 break; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3725 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3726 default: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3727 error ("Strange value for BackingStore parameter of screen"); |
31543
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3728 result = Qnil; |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3729 } |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3730 |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3731 return result; |
2276
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 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3734 DEFUN ("x-display-visual-class", Fx_display_visual_class, |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3735 Sx_display_visual_class, 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3736 doc: /* Return the visual class of the X display DISPLAY. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3737 The value is one of the symbols `static-gray', `gray-scale', |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3738 `static-color', `pseudo-color', `true-color', or `direct-color'. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3739 |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3740 The optional argument DISPLAY specifies which display to ask about. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3741 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3742 If omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3743 (display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3744 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3745 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3746 struct x_display_info *dpyinfo = check_x_display_info (display); |
31543
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3747 Lisp_Object result; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3748 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3749 switch (dpyinfo->visual->class) |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3750 { |
31543
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3751 case StaticGray: |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3752 result = intern ("static-gray"); |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3753 break; |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3754 case GrayScale: |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3755 result = intern ("gray-scale"); |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3756 break; |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3757 case StaticColor: |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3758 result = intern ("static-color"); |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3759 break; |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3760 case PseudoColor: |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3761 result = intern ("pseudo-color"); |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3762 break; |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3763 case TrueColor: |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3764 result = intern ("true-color"); |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3765 break; |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3766 case DirectColor: |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3767 result = intern ("direct-color"); |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3768 break; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3769 default: |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3770 error ("Display has an unknown visual class"); |
31543
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3771 result = Qnil; |
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3772 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
3773 |
31543
9c5e42fa3ba5
(png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents:
30601
diff
changeset
|
3774 return result; |
2276
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 |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3777 DEFUN ("x-display-save-under", Fx_display_save_under, |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3778 Sx_display_save_under, 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3779 doc: /* Returns t if the X display DISPLAY supports the save-under feature. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3780 The optional argument DISPLAY specifies which display to ask about. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3781 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3782 If omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
3783 (display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3784 Lisp_Object display; |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3785 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3786 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
|
3787 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3788 if (DoesSaveUnders (dpyinfo->screen) == True) |
2276
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3789 return Qt; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3790 else |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3791 return Qnil; |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3792 } |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
3793 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3794 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3795 x_pixel_width (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3796 register struct frame *f; |
389 | 3797 { |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
3798 return FRAME_PIXEL_WIDTH (f); |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3799 } |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3800 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3801 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3802 x_pixel_height (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3803 register struct frame *f; |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3804 { |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
3805 return FRAME_PIXEL_HEIGHT (f); |
389 | 3806 } |
3807 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3808 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3809 x_char_width (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3810 register struct frame *f; |
389 | 3811 { |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
3812 return FRAME_COLUMN_WIDTH (f); |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3813 } |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3814 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3815 int |
2067
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3816 x_char_height (f) |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3817 register struct frame *f; |
0a353ddd4bf4
(Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents:
1994
diff
changeset
|
3818 { |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
3819 return FRAME_LINE_HEIGHT (f); |
389 | 3820 } |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3821 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3822 int |
19825
cdfaf8ce5208
(x_screen_planes): Fix type of argument.
Richard M. Stallman <rms@gnu.org>
parents:
19095
diff
changeset
|
3823 x_screen_planes (f) |
cdfaf8ce5208
(x_screen_planes): Fix type of argument.
Richard M. Stallman <rms@gnu.org>
parents:
19095
diff
changeset
|
3824 register struct frame *f; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3825 { |
19825
cdfaf8ce5208
(x_screen_planes): Fix type of argument.
Richard M. Stallman <rms@gnu.org>
parents:
19095
diff
changeset
|
3826 return FRAME_X_DISPLAY_INFO (f)->n_planes; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3827 } |
28044
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
3828 |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3829 |
389 | 3830 |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3831 /************************************************************************ |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3832 X Displays |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3833 ************************************************************************/ |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3834 |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3835 |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3836 /* Mapping visual names to visuals. */ |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3837 |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3838 static struct visual_class |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3839 { |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3840 char *name; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3841 int class; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3842 } |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3843 visual_classes[] = |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3844 { |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3845 {"StaticGray", StaticGray}, |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3846 {"GrayScale", GrayScale}, |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3847 {"StaticColor", StaticColor}, |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3848 {"PseudoColor", PseudoColor}, |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3849 {"TrueColor", TrueColor}, |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3850 {"DirectColor", DirectColor}, |
42123
7f5f06b97bfc
(x_frame_parms): Add missing braces around initializer.
Pavel Janík <Pavel@Janik.cz>
parents:
42006
diff
changeset
|
3851 {NULL, 0} |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3852 }; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3853 |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3854 |
4606
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
3855 #ifndef HAVE_XSCREENNUMBEROFSCREEN |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3856 |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3857 /* Value is the screen number of screen SCR. This is a substitute for |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3858 the X function with the same name when that doesn't exist. */ |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3859 |
4606
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
3860 int |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
3861 XScreenNumberOfScreen (scr) |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
3862 register Screen *scr; |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
3863 { |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3864 Display *dpy = scr->display; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3865 int i; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3866 |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3867 for (i = 0; i < dpy->nscreens; ++i) |
40325
2eb0395c1697
(XScreenNumberOfScreen): Fix struct to pointer
Gerd Moellmann <gerd@gnu.org>
parents:
40279
diff
changeset
|
3868 if (scr == dpy->screens + i) |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3869 break; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3870 |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3871 return i; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3872 } |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3873 |
4606
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
3874 #endif /* not HAVE_XSCREENNUMBEROFSCREEN */ |
0866f021a2cc
(XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents:
4571
diff
changeset
|
3875 |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3876 |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3877 /* Select the visual that should be used on display DPYINFO. Set |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3878 members of DPYINFO appropriately. Called from x_term_init. */ |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3879 |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3880 void |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3881 select_visual (dpyinfo) |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3882 struct x_display_info *dpyinfo; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3883 { |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3884 Display *dpy = dpyinfo->display; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3885 Screen *screen = dpyinfo->screen; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3886 Lisp_Object value; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3887 |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3888 /* See if a visual is specified. */ |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3889 value = display_x_get_resource (dpyinfo, |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3890 build_string ("visualClass"), |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3891 build_string ("VisualClass"), |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3892 Qnil, Qnil); |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3893 if (STRINGP (value)) |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3894 { |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3895 /* VALUE should be of the form CLASS-DEPTH, where CLASS is one |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3896 of `PseudoColor', `TrueColor' etc. and DEPTH is the color |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3897 depth, a decimal number. NAME is compared with case ignored. */ |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
3898 char *s = (char *) alloca (SBYTES (value) + 1); |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3899 char *dash; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3900 int i, class = -1; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3901 XVisualInfo vinfo; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3902 |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
3903 strcpy (s, SDATA (value)); |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3904 dash = index (s, '-'); |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3905 if (dash) |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3906 { |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3907 dpyinfo->n_planes = atoi (dash + 1); |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3908 *dash = '\0'; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3909 } |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3910 else |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3911 /* We won't find a matching visual with depth 0, so that |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3912 an error will be printed below. */ |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3913 dpyinfo->n_planes = 0; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3914 |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3915 /* Determine the visual class. */ |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3916 for (i = 0; visual_classes[i].name; ++i) |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3917 if (xstricmp (s, visual_classes[i].name) == 0) |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3918 { |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3919 class = visual_classes[i].class; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3920 break; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3921 } |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3922 |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3923 /* Look up a matching visual for the specified class. */ |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3924 if (class == -1 |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3925 || !XMatchVisualInfo (dpy, XScreenNumberOfScreen (screen), |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3926 dpyinfo->n_planes, class, &vinfo)) |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
3927 fatal ("Invalid visual specification `%s'", SDATA (value)); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
3928 |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3929 dpyinfo->visual = vinfo.visual; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3930 } |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3931 else |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3932 { |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3933 int n_visuals; |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3934 XVisualInfo *vinfo, vinfo_template; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
3935 |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3936 dpyinfo->visual = 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
|
3937 |
133bad38bde1
* xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents:
1018
diff
changeset
|
3938 #ifdef HAVE_X11R4 |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3939 vinfo_template.visualid = XVisualIDFromVisual (dpyinfo->visual); |
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
|
3940 #else |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3941 vinfo_template.visualid = dpyinfo->visual->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
|
3942 #endif |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3943 vinfo_template.screen = XScreenNumberOfScreen (screen); |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3944 vinfo = XGetVisualInfo (dpy, VisualIDMask | VisualScreenMask, |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3945 &vinfo_template, &n_visuals); |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3946 if (n_visuals != 1) |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3947 fatal ("Can't get proper X visual info"); |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3948 |
28199
56a776500341
* xfns.c (select_visual): Don't set dpyinfo->n_planes to the
Gerd Moellmann <gerd@gnu.org>
parents:
28144
diff
changeset
|
3949 dpyinfo->n_planes = vinfo->depth; |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3950 XFree ((char *) vinfo); |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3951 } |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3952 } |
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3953 |
389 | 3954 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3955 /* 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
|
3956 Open a new connection if necessary. */ |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3957 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3958 struct x_display_info * |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3959 x_display_info_for_name (name) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3960 Lisp_Object name; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3961 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3962 Lisp_Object names; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3963 struct x_display_info *dpyinfo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3964 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
3965 CHECK_STRING (name); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3966 |
12381
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
3967 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
|
3968 error ("Not using X Windows"); |
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
3969 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3970 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
|
3971 dpyinfo; |
25646
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
3972 dpyinfo = dpyinfo->next, names = XCDR (names)) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3973 { |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3974 Lisp_Object tem; |
25646
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
3975 tem = Fstring_equal (XCAR (XCAR (names)), name); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3976 if (!NILP (tem)) |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3977 return dpyinfo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3978 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3979 |
11917
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3980 /* 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
|
3981 Vx_resource_name = Vinvocation_name; |
2314b62ca4ab
(Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents:
11900
diff
changeset
|
3982 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3983 validate_x_resource_name (); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3984 |
34976
05c36b1fa618
(x_display_info_for_name): Cast 0 to "char *" in the call
Eli Zaretskii <eliz@gnu.org>
parents:
34911
diff
changeset
|
3985 dpyinfo = x_term_init (name, (char *)0, |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
3986 (char *) SDATA (Vx_resource_name)); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3987 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3988 if (dpyinfo == 0) |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
3989 error ("Cannot connect to X server %s", SDATA (name)); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
3990 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3991 x_in_use = 1; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3992 XSETFASTINT (Vwindow_system_version, 11); |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3993 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3994 return dpyinfo; |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3995 } |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
3996 |
27993
3a34e2d1bf3c
(select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents:
27987
diff
changeset
|
3997 |
389 | 3998 DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection, |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
3999 1, 3, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4000 doc: /* Open a connection to an X server. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4001 DISPLAY is the name of the display to connect to. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4002 Optional second arg XRM-STRING is a string of resources in xrdb format. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4003 If the optional third arg MUST-SUCCEED is non-nil, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4004 terminate Emacs if we can't open the connection. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4005 (display, xrm_string, must_succeed) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4006 Lisp_Object display, xrm_string, must_succeed; |
389 | 4007 { |
4008 unsigned char *xrm_option; | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4009 struct x_display_info *dpyinfo; |
389 | 4010 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
4011 CHECK_STRING (display); |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4012 if (! NILP (xrm_string)) |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
4013 CHECK_STRING (xrm_string); |
389 | 4014 |
12381
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4015 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
|
4016 error ("Not using X Windows"); |
67cb86bbdb55
(Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents:
12347
diff
changeset
|
4017 |
4146
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4018 if (! NILP (xrm_string)) |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
4019 xrm_option = (unsigned char *) SDATA (xrm_string); |
389 | 4020 else |
4021 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
|
4022 |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4023 validate_x_resource_name (); |
0c681748d0ce
* xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents:
3923
diff
changeset
|
4024 |
7802
d687e885fa6a
(Fx_open_connection): Set up Vx_resource_name and xrm_option
Richard M. Stallman <rms@gnu.org>
parents:
7797
diff
changeset
|
4025 /* 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
|
4026 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
|
4027 dpyinfo = x_term_init (display, xrm_option, |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
4028 (char *) SDATA (Vx_resource_name)); |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4029 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4030 if (dpyinfo == 0) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4031 { |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4032 if (!NILP (must_succeed)) |
39907 | 4033 fatal ("Cannot connect to X server %s.\n\ |
4034 Check the DISPLAY environment variable or use `-d'.\n\ | |
47159
23b87fbdd685
(Fx_open_connection): Fix docstring. Patch from Rune Kleveland <runekl@viewpoint.no>.
Juanma Barranquero <lekktu@gmail.com>
parents:
47142
diff
changeset
|
4035 Also use the `xauth' program to verify that you have the proper\n\ |
23b87fbdd685
(Fx_open_connection): Fix docstring. Patch from Rune Kleveland <runekl@viewpoint.no>.
Juanma Barranquero <lekktu@gmail.com>
parents:
47142
diff
changeset
|
4036 authorization information needed to connect the X server.\n\ |
47086
527c24dbb2b1
(Fx_open_connection): Improve help when X connection
Simon Josefsson <jas@extundo.com>
parents:
47058
diff
changeset
|
4037 An insecure way to solve the problem may be to use `xhost'.\n", |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
4038 SDATA (display)); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4039 else |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
4040 error ("Cannot connect to X server %s", SDATA (display)); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4041 } |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4042 |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4043 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
|
4044 |
9327
b3398cf56fba
(Fx_open_connection): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents:
9285
diff
changeset
|
4045 XSETFASTINT (Vwindow_system_version, 11); |
389 | 4046 return Qnil; |
4047 } | |
4048 | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4049 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
|
4050 Sx_close_connection, 1, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4051 doc: /* Close the connection to DISPLAY's X server. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4052 For DISPLAY, specify either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4053 If DISPLAY is nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4054 (display) |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4055 Lisp_Object display; |
389 | 4056 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4057 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
|
4058 int i; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4059 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4060 if (dpyinfo->reference_count > 0) |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4061 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
|
4062 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4063 BLOCK_INPUT; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4064 /* 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
|
4065 for (i = 0; i < dpyinfo->n_fonts; i++) |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4066 if (dpyinfo->font_table[i].name) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4067 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4068 XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4069 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4070 |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4071 x_destroy_all_bitmaps (dpyinfo); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4072 XSetCloseDownMode (dpyinfo->display, DestroyAll); |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4073 |
72777
049cdc4ea1a1
* xfns.c (Fx_close_connection): Call xg_display_close when USE_GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
72774
diff
changeset
|
4074 #ifdef USE_GTK |
049cdc4ea1a1
* xfns.c (Fx_close_connection): Call xg_display_close when USE_GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
72774
diff
changeset
|
4075 xg_display_close (dpyinfo->display); |
049cdc4ea1a1
* xfns.c (Fx_close_connection): Call xg_display_close when USE_GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
72774
diff
changeset
|
4076 #else |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4077 #ifdef USE_X_TOOLKIT |
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4078 XtCloseDisplay (dpyinfo->display); |
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4079 #else |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4080 XCloseDisplay (dpyinfo->display); |
9742
fe7653791d28
(Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents:
9703
diff
changeset
|
4081 #endif |
72777
049cdc4ea1a1
* xfns.c (Fx_close_connection): Call xg_display_close when USE_GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
72774
diff
changeset
|
4082 #endif /* ! USE_GTK */ |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4083 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4084 x_delete_display (dpyinfo); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4085 UNBLOCK_INPUT; |
8782
51241477cfc5
Delete X11 conditionals.
Richard M. Stallman <rms@gnu.org>
parents:
8780
diff
changeset
|
4086 |
389 | 4087 return Qnil; |
4088 } | |
4089 | |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4090 DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4091 doc: /* Return the list of display names that Emacs has connections to. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4092 () |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4093 { |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4094 Lisp_Object tail, result; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4095 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4096 result = Qnil; |
25646
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
4097 for (tail = x_display_name_list; ! NILP (tail); tail = XCDR (tail)) |
9154af188477
Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents:
25628
diff
changeset
|
4098 result = Fcons (XCAR (XCAR (tail)), result); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4099 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4100 return result; |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4101 } |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4102 |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4103 DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4104 doc: /* If ON is non-nil, report X errors as soon as the erring request is made. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4105 If ON is nil, allow buffering of requests. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4106 Turning on synchronization prohibits the Xlib routines from buffering |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4107 requests and seriously degrades performance, but makes debugging much |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4108 easier. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4109 The optional second argument DISPLAY specifies which display to act on. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4110 DISPLAY should be either a frame or a display name (a string). |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4111 If DISPLAY is omitted or nil, that stands for the selected frame's display. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4112 (on, display) |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4113 Lisp_Object display, on; |
389 | 4114 { |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
4115 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
|
4116 |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4117 XSynchronize (dpyinfo->display, !EQ (on, Qnil)); |
389 | 4118 |
4119 return Qnil; | |
4120 } | |
4121 | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4122 /* Wait for responses to all X commands issued so far for frame F. */ |
5536 | 4123 |
4124 void | |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4125 x_sync (f) |
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4126 FRAME_PTR f; |
5536 | 4127 { |
5558 | 4128 BLOCK_INPUT; |
9653
cfc5e15e0baf
(x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents:
9580
diff
changeset
|
4129 XSync (FRAME_X_DISPLAY (f), False); |
5558 | 4130 UNBLOCK_INPUT; |
5536 | 4131 } |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4132 |
389 | 4133 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4134 /*********************************************************************** |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4135 Window properties |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4136 ***********************************************************************/ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4137 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4138 DEFUN ("x-change-window-property", Fx_change_window_property, |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4139 Sx_change_window_property, 2, 6, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4140 doc: /* Change window property PROP to VALUE on the X window of FRAME. |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4141 PROP must be a string. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4142 VALUE may be a string or a list of conses, numbers and/or strings. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4143 If an element in the list is a string, it is converted to |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4144 an Atom and the value of the Atom is used. If an element is a cons, |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4145 it is converted to a 32 bit number where the car is the 16 top bits and the |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4146 cdr is the lower 16 bits. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4147 FRAME nil or omitted means use the selected frame. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4148 If TYPE is given and non-nil, it is the name of the type of VALUE. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4149 If TYPE is not given or nil, the type is STRING. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4150 FORMAT gives the size in bits of each element if VALUE is a list. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4151 It must be one of 8, 16 or 32. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4152 If VALUE is a string or FORMAT is nil or not given, FORMAT defaults to 8. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4153 If OUTER_P is non-nil, the property is changed for the outer X window of |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4154 FRAME. Default is to change on the edit X window. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4155 |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4156 Value is VALUE. */) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4157 (prop, value, frame, type, format, outer_p) |
53825
6635e77a2c09
* xfns.c (x_create_bitmap_mask): Removed unused variable depth.
Jan Djärv <jan.h.d@swipnet.se>
parents:
53787
diff
changeset
|
4158 Lisp_Object prop, value, frame, type, format, outer_p; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4159 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4160 struct frame *f = check_x_frame (frame); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4161 Atom prop_atom; |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4162 Atom target_type = XA_STRING; |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4163 int element_format = 8; |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4164 unsigned char *data; |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4165 int nelements; |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4166 Window w; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4167 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
4168 CHECK_STRING (prop); |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4169 |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4170 if (! NILP (format)) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4171 { |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4172 CHECK_NUMBER (format); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4173 element_format = XFASTINT (format); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4174 |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4175 if (element_format != 8 && element_format != 16 |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4176 && element_format != 32) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4177 error ("FORMAT must be one of 8, 16 or 32"); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4178 } |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4179 |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4180 if (CONSP (value)) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4181 { |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4182 nelements = x_check_property_data (value); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4183 if (nelements == -1) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4184 error ("Bad data in VALUE, must be number, string or cons"); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4185 |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4186 if (element_format == 8) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4187 data = (unsigned char *) xmalloc (nelements); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4188 else if (element_format == 16) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4189 data = (unsigned char *) xmalloc (nelements*2); |
59976
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4190 else /* format == 32 */ |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4191 /* The man page for XChangeProperty: |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4192 "If the specified format is 32, the property data must be a |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4193 long array." |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4194 This applies even if long is more than 64 bits. The X library |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4195 converts to 32 bits before sending to the X server. */ |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4196 data = (unsigned char *) xmalloc (nelements * sizeof(long)); |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4197 |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4198 x_fill_property_data (FRAME_X_DISPLAY (f), value, data, element_format); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4199 } |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4200 else |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4201 { |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4202 CHECK_STRING (value); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4203 data = SDATA (value); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4204 nelements = SCHARS (value); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4205 } |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4206 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4207 BLOCK_INPUT; |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
4208 prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SDATA (prop), False); |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4209 if (! NILP (type)) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4210 { |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4211 CHECK_STRING (type); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4212 target_type = XInternAtom (FRAME_X_DISPLAY (f), SDATA (type), False); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4213 } |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4214 |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4215 if (! NILP (outer_p)) w = FRAME_OUTER_WINDOW (f); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4216 else w = FRAME_X_WINDOW (f); |
59904
adc18da68682
(unwind_create_frame) [!GLYPH_DEBUG]: Fix xassert.
Kim F. Storm <storm@cua.dk>
parents:
59789
diff
changeset
|
4217 |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4218 XChangeProperty (FRAME_X_DISPLAY (f), w, |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4219 prop_atom, target_type, element_format, PropModeReplace, |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4220 data, nelements); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4221 |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4222 if (CONSP (value)) xfree (data); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4223 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4224 /* Make sure the property is set when we return. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4225 XFlush (FRAME_X_DISPLAY (f)); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4226 UNBLOCK_INPUT; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4227 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4228 return value; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4229 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4230 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4231 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4232 DEFUN ("x-delete-window-property", Fx_delete_window_property, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4233 Sx_delete_window_property, 1, 2, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4234 doc: /* Remove window property PROP from X window of FRAME. |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4235 FRAME nil or omitted means use the selected frame. Value is PROP. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4236 (prop, frame) |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4237 Lisp_Object prop, frame; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4238 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4239 struct frame *f = check_x_frame (frame); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4240 Atom prop_atom; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4241 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
4242 CHECK_STRING (prop); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4243 BLOCK_INPUT; |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
4244 prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SDATA (prop), False); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4245 XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), prop_atom); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4246 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4247 /* Make sure the property is removed when we return. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4248 XFlush (FRAME_X_DISPLAY (f)); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4249 UNBLOCK_INPUT; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4250 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4251 return prop; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4252 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4253 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4254 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4255 DEFUN ("x-window-property", Fx_window_property, Sx_window_property, |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4256 1, 6, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4257 doc: /* Value is the value of window property PROP on FRAME. |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4258 If FRAME is nil or omitted, use the selected frame. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4259 If TYPE is nil or omitted, get the property as a string. Otherwise TYPE |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4260 is the name of the Atom that denotes the type expected. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4261 If SOURCE is non-nil, get the property on that window instead of from |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4262 FRAME. The number 0 denotes the root window. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4263 If DELETE_P is non-nil, delete the property after retreiving it. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4264 If VECTOR_RET_P is non-nil, don't return a string but a vector of values. |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4265 |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4266 Value is nil if FRAME hasn't a property with name PROP or if PROP has |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4267 no value of TYPE. */) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4268 (prop, frame, type, source, delete_p, vector_ret_p) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4269 Lisp_Object prop, frame, type, source, delete_p, vector_ret_p; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4270 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4271 struct frame *f = check_x_frame (frame); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4272 Atom prop_atom; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4273 int rc; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4274 Lisp_Object prop_value = Qnil; |
60133
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
4275 unsigned char *tmp_data = NULL; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4276 Atom actual_type; |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4277 Atom target_type = XA_STRING; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4278 int actual_format; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4279 unsigned long actual_size, bytes_remaining; |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4280 Window target_window = FRAME_X_WINDOW (f); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4281 struct gcpro gcpro1; |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4282 |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4283 GCPRO1 (prop_value); |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
4284 CHECK_STRING (prop); |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4285 |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4286 if (! NILP (source)) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4287 { |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4288 if (NUMBERP (source)) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4289 { |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4290 if (FLOATP (source)) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4291 target_window = (Window) XFLOAT (source); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4292 else |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4293 target_window = XFASTINT (source); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4294 |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4295 if (target_window == 0) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4296 target_window = FRAME_X_DISPLAY_INFO (f)->root_window; |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4297 } |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4298 else if (CONSP (source)) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4299 target_window = cons_to_long (source); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4300 } |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4301 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4302 BLOCK_INPUT; |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4303 if (STRINGP (type)) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4304 { |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4305 if (strcmp ("AnyPropertyType", SDATA (type)) == 0) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4306 target_type = AnyPropertyType; |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4307 else |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4308 target_type = XInternAtom (FRAME_X_DISPLAY (f), SDATA (type), False); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4309 } |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4310 |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
4311 prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SDATA (prop), False); |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4312 rc = XGetWindowProperty (FRAME_X_DISPLAY (f), target_window, |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4313 prop_atom, 0, 0, False, target_type, |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4314 &actual_type, &actual_format, &actual_size, |
60133
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
4315 &bytes_remaining, &tmp_data); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4316 if (rc == Success) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4317 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4318 int size = bytes_remaining; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4319 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4320 XFree (tmp_data); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4321 tmp_data = NULL; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4322 |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4323 rc = XGetWindowProperty (FRAME_X_DISPLAY (f), target_window, |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4324 prop_atom, 0, bytes_remaining, |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4325 ! NILP (delete_p), target_type, |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4326 &actual_type, &actual_format, |
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4327 &actual_size, &bytes_remaining, |
60133
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
4328 &tmp_data); |
39277
df33715cdcf8
(Fx_window_property): Handle case that property gets
Gerd Moellmann <gerd@gnu.org>
parents:
39159
diff
changeset
|
4329 if (rc == Success && tmp_data) |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4330 { |
59976
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4331 /* The man page for XGetWindowProperty says: |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4332 "If the returned format is 32, the returned data is represented |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4333 as a long array and should be cast to that type to obtain the |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4334 elements." |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4335 This applies even if long is more than 32 bits, the X library |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4336 converts from 32 bit elements received from the X server to long |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4337 and passes the long array to us. Thus, for that case bcopy can not |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4338 be used. We convert to a 32 bit type here, because so much code |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4339 assume on that. |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4340 |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4341 The bytes and offsets passed to XGetWindowProperty refers to the |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4342 property and those are indeed in 32 bit quantities if format is |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4343 32. */ |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4344 |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4345 if (actual_format == 32 && actual_format < BITS_PER_LONG) |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4346 { |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4347 unsigned long i; |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4348 int *idata = (int *) tmp_data; |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4349 long *ldata = (long *) tmp_data; |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4350 |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4351 for (i = 0; i < actual_size; ++i) |
60133
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
4352 idata[i] = (int) ldata[i]; |
59976
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4353 } |
10ab4fe55163
* xfns.c (Fx_change_window_property): Use long array when format is 32.
Jan Djärv <jan.h.d@swipnet.se>
parents:
59974
diff
changeset
|
4354 |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4355 if (NILP (vector_ret_p)) |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4356 prop_value = make_string (tmp_data, size); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4357 else |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4358 prop_value = x_property_data_to_lisp (f, |
60133
cfda6afe9273
(hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents:
59980
diff
changeset
|
4359 tmp_data, |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4360 actual_type, |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4361 actual_format, |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4362 actual_size); |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4363 } |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4364 |
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4365 if (tmp_data) XFree (tmp_data); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4366 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4367 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4368 UNBLOCK_INPUT; |
53787
b8e5f3d01bb6
* xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents:
53335
diff
changeset
|
4369 UNGCPRO; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4370 return prop_value; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4371 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4372 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4373 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4374 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4375 /*********************************************************************** |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4376 Busy cursor |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4377 ***********************************************************************/ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4378 |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4379 /* If non-null, an asynchronous timer that, when it expires, displays |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4380 an hourglass cursor on all frames. */ |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4381 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4382 static struct atimer *hourglass_atimer; |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4383 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4384 /* Non-zero means an hourglass cursor is currently shown. */ |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4385 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4386 static int hourglass_shown_p; |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4387 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4388 /* Number of seconds to wait before displaying an hourglass cursor. */ |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4389 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4390 static Lisp_Object Vhourglass_delay; |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4391 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4392 /* Default number of seconds to wait before displaying an hourglass |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4393 cursor. */ |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4394 |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4395 #define DEFAULT_HOURGLASS_DELAY 1 |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4396 |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4397 /* Function prototypes. */ |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4398 |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4399 static void show_hourglass P_ ((struct atimer *)); |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4400 static void hide_hourglass P_ ((void)); |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4401 |
60555
2895b0a63b0e
* xfns.c (hourglass_started): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
60133
diff
changeset
|
4402 /* Return non-zero if houglass timer has been started or hourglass is shown. */ |
2895b0a63b0e
* xfns.c (hourglass_started): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
60133
diff
changeset
|
4403 |
2895b0a63b0e
* xfns.c (hourglass_started): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
60133
diff
changeset
|
4404 int |
2895b0a63b0e
* xfns.c (hourglass_started): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
60133
diff
changeset
|
4405 hourglass_started () |
2895b0a63b0e
* xfns.c (hourglass_started): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
60133
diff
changeset
|
4406 { |
2895b0a63b0e
* xfns.c (hourglass_started): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
60133
diff
changeset
|
4407 return hourglass_shown_p || hourglass_atimer != NULL; |
2895b0a63b0e
* xfns.c (hourglass_started): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
60133
diff
changeset
|
4408 } |
2895b0a63b0e
* xfns.c (hourglass_started): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
60133
diff
changeset
|
4409 |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4410 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4411 /* Cancel a currently active hourglass timer, and start a new one. */ |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4412 |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4413 void |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4414 start_hourglass () |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4415 { |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4416 EMACS_TIME delay; |
27915
e5b8e194d279
(start_busy_cursor): Allow floats for busy-cursor-delay.
Gerd Moellmann <gerd@gnu.org>
parents:
27902
diff
changeset
|
4417 int secs, usecs = 0; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4418 |
62144
19e471e1a080
(start_hourglass): Do nothing when running on a tty.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
60722
diff
changeset
|
4419 /* Don't bother for ttys. */ |
19e471e1a080
(start_hourglass): Do nothing when running on a tty.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
60722
diff
changeset
|
4420 if (NILP (Vwindow_system)) |
19e471e1a080
(start_hourglass): Do nothing when running on a tty.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
60722
diff
changeset
|
4421 return; |
19e471e1a080
(start_hourglass): Do nothing when running on a tty.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
60722
diff
changeset
|
4422 |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4423 cancel_hourglass (); |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4424 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4425 if (INTEGERP (Vhourglass_delay) |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4426 && XINT (Vhourglass_delay) > 0) |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4427 secs = XFASTINT (Vhourglass_delay); |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4428 else if (FLOATP (Vhourglass_delay) |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4429 && XFLOAT_DATA (Vhourglass_delay) > 0) |
27915
e5b8e194d279
(start_busy_cursor): Allow floats for busy-cursor-delay.
Gerd Moellmann <gerd@gnu.org>
parents:
27902
diff
changeset
|
4430 { |
e5b8e194d279
(start_busy_cursor): Allow floats for busy-cursor-delay.
Gerd Moellmann <gerd@gnu.org>
parents:
27902
diff
changeset
|
4431 Lisp_Object tem; |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4432 tem = Ftruncate (Vhourglass_delay, Qnil); |
27915
e5b8e194d279
(start_busy_cursor): Allow floats for busy-cursor-delay.
Gerd Moellmann <gerd@gnu.org>
parents:
27902
diff
changeset
|
4433 secs = XFASTINT (tem); |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4434 usecs = (XFLOAT_DATA (Vhourglass_delay) - secs) * 1000000; |
27915
e5b8e194d279
(start_busy_cursor): Allow floats for busy-cursor-delay.
Gerd Moellmann <gerd@gnu.org>
parents:
27902
diff
changeset
|
4435 } |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4436 else |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4437 secs = DEFAULT_HOURGLASS_DELAY; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4438 |
27915
e5b8e194d279
(start_busy_cursor): Allow floats for busy-cursor-delay.
Gerd Moellmann <gerd@gnu.org>
parents:
27902
diff
changeset
|
4439 EMACS_SET_SECS_USECS (delay, secs, usecs); |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4440 hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4441 show_hourglass, NULL); |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4442 } |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4443 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4444 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4445 /* Cancel the hourglass cursor timer if active, hide a busy cursor if |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4446 shown. */ |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4447 |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4448 void |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4449 cancel_hourglass () |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4450 { |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4451 if (hourglass_atimer) |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4452 { |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4453 cancel_atimer (hourglass_atimer); |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4454 hourglass_atimer = NULL; |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4455 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4456 |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4457 if (hourglass_shown_p) |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4458 hide_hourglass (); |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4459 } |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4460 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4461 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4462 /* Timer function of hourglass_atimer. TIMER is equal to |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4463 hourglass_atimer. |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4464 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4465 Display an hourglass pointer on all frames by mapping the frames' |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4466 hourglass_window. Set the hourglass_p flag in the frames' |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4467 output_data.x structure to indicate that an hourglass cursor is |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4468 shown on the frames. */ |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4469 |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4470 static void |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4471 show_hourglass (timer) |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4472 struct atimer *timer; |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4473 { |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4474 /* The timer implementation will cancel this timer automatically |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4475 after this function has run. Set hourglass_atimer to null |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4476 so that we know the timer doesn't have to be canceled. */ |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4477 hourglass_atimer = NULL; |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4478 |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4479 if (!hourglass_shown_p) |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4480 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4481 Lisp_Object rest, frame; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4482 |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4483 BLOCK_INPUT; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4484 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4485 FOR_EACH_FRAME (rest, frame) |
34662
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4486 { |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4487 struct frame *f = XFRAME (frame); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4488 |
34662
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4489 if (FRAME_LIVE_P (f) && FRAME_X_P (f) && FRAME_X_DISPLAY (f)) |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4490 { |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4491 Display *dpy = FRAME_X_DISPLAY (f); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4492 |
34662
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4493 #ifdef USE_X_TOOLKIT |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4494 if (f->output_data.x->widget) |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4495 #else |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4496 if (FRAME_OUTER_WINDOW (f)) |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4497 #endif |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4498 { |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4499 f->output_data.x->hourglass_p = 1; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4500 |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4501 if (!f->output_data.x->hourglass_window) |
34662
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4502 { |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4503 unsigned long mask = CWCursor; |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4504 XSetWindowAttributes attrs; |
59789
97d17acaf4e7
* xfns.c (show_hourglass): Use FRAME_X_WINDOW as parent for GTK,
Jan Djärv <jan.h.d@swipnet.se>
parents:
59102
diff
changeset
|
4505 #ifdef USE_GTK |
97d17acaf4e7
* xfns.c (show_hourglass): Use FRAME_X_WINDOW as parent for GTK,
Jan Djärv <jan.h.d@swipnet.se>
parents:
59102
diff
changeset
|
4506 Window parent = FRAME_X_WINDOW (f); |
97d17acaf4e7
* xfns.c (show_hourglass): Use FRAME_X_WINDOW as parent for GTK,
Jan Djärv <jan.h.d@swipnet.se>
parents:
59102
diff
changeset
|
4507 #else |
97d17acaf4e7
* xfns.c (show_hourglass): Use FRAME_X_WINDOW as parent for GTK,
Jan Djärv <jan.h.d@swipnet.se>
parents:
59102
diff
changeset
|
4508 Window parent = FRAME_OUTER_WINDOW (f); |
97d17acaf4e7
* xfns.c (show_hourglass): Use FRAME_X_WINDOW as parent for GTK,
Jan Djärv <jan.h.d@swipnet.se>
parents:
59102
diff
changeset
|
4509 #endif |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4510 attrs.cursor = f->output_data.x->hourglass_cursor; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4511 |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4512 f->output_data.x->hourglass_window |
59789
97d17acaf4e7
* xfns.c (show_hourglass): Use FRAME_X_WINDOW as parent for GTK,
Jan Djärv <jan.h.d@swipnet.se>
parents:
59102
diff
changeset
|
4513 = XCreateWindow (dpy, parent, |
34662
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4514 0, 0, 32000, 32000, 0, 0, |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4515 InputOnly, |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4516 CopyFromParent, |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4517 mask, &attrs); |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4518 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4519 |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4520 XMapRaised (dpy, f->output_data.x->hourglass_window); |
34662
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4521 XFlush (dpy); |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4522 } |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4523 } |
d8005f5e0a23
(show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents:
34638
diff
changeset
|
4524 } |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4525 |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4526 hourglass_shown_p = 1; |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4527 UNBLOCK_INPUT; |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4528 } |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4529 } |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4530 |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4531 |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4532 /* Hide the hourglass pointer on all frames, if it is currently |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4533 shown. */ |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4534 |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4535 static void |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4536 hide_hourglass () |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4537 { |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4538 if (hourglass_shown_p) |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4539 { |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4540 Lisp_Object rest, frame; |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4541 |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4542 BLOCK_INPUT; |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4543 FOR_EACH_FRAME (rest, frame) |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4544 { |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4545 struct frame *f = XFRAME (frame); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4546 |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4547 if (FRAME_X_P (f) |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4548 /* Watch out for newly created frames. */ |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4549 && f->output_data.x->hourglass_window) |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4550 { |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4551 XUnmapWindow (FRAME_X_DISPLAY (f), |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4552 f->output_data.x->hourglass_window); |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4553 /* Sync here because XTread_socket looks at the |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4554 hourglass_p flag that is reset to zero below. */ |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4555 XSync (FRAME_X_DISPLAY (f), False); |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4556 f->output_data.x->hourglass_p = 0; |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4557 } |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4558 } |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4559 |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
4560 hourglass_shown_p = 0; |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4561 UNBLOCK_INPUT; |
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
4562 } |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4563 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4564 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4565 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4566 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4567 /*********************************************************************** |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4568 Tool tips |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4569 ***********************************************************************/ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4570 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4571 static Lisp_Object x_create_tip_frame P_ ((struct x_display_info *, |
36869
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
4572 Lisp_Object, Lisp_Object)); |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4573 static void compute_tip_xy P_ ((struct frame *, Lisp_Object, Lisp_Object, |
37253
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4574 Lisp_Object, int, int, int *, int *)); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4575 |
34450
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
4576 /* The frame of a currently visible tooltip. */ |
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
4577 |
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
4578 Lisp_Object tip_frame; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4579 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4580 /* If non-nil, a timer started that hides the last tooltip when it |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4581 fires. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4582 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4583 Lisp_Object tip_timer; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4584 Window tip_window; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4585 |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4586 /* If non-nil, a vector of 3 elements containing the last args |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4587 with which x-show-tip was called. See there. */ |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4588 |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4589 Lisp_Object last_show_tip_args; |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4590 |
38574
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
4591 /* Maximum size for tooltips; a cons (COLUMNS . ROWS). */ |
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
4592 |
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
4593 Lisp_Object Vx_max_tooltip_size; |
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
4594 |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4595 |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4596 static Lisp_Object |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4597 unwind_create_tip_frame (frame) |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4598 Lisp_Object frame; |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4599 { |
34638
abb4510a89f6
(unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents:
34598
diff
changeset
|
4600 Lisp_Object deleted; |
abb4510a89f6
(unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents:
34598
diff
changeset
|
4601 |
abb4510a89f6
(unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents:
34598
diff
changeset
|
4602 deleted = unwind_create_frame (frame); |
abb4510a89f6
(unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents:
34598
diff
changeset
|
4603 if (EQ (deleted, Qt)) |
abb4510a89f6
(unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents:
34598
diff
changeset
|
4604 { |
abb4510a89f6
(unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents:
34598
diff
changeset
|
4605 tip_window = None; |
abb4510a89f6
(unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents:
34598
diff
changeset
|
4606 tip_frame = Qnil; |
abb4510a89f6
(unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents:
34598
diff
changeset
|
4607 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4608 |
34638
abb4510a89f6
(unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents:
34598
diff
changeset
|
4609 return deleted; |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4610 } |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4611 |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4612 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4613 /* Create a frame for a tooltip on the display described by DPYINFO. |
36869
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
4614 PARMS is a list of frame parameters. TEXT is the string to |
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
4615 display in the tip frame. Value is the frame. |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4616 |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4617 Note that functions called here, esp. x_default_parameter can |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4618 signal errors, for instance when a specified color name is |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4619 undefined. We have to make sure that we're in a consistent state |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4620 when this happens. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4621 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4622 static Lisp_Object |
36869
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
4623 x_create_tip_frame (dpyinfo, parms, text) |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4624 struct x_display_info *dpyinfo; |
36869
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
4625 Lisp_Object parms, text; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4626 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4627 struct frame *f; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4628 Lisp_Object frame, tem; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4629 Lisp_Object name; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4630 long window_prompting = 0; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4631 int width, height; |
46285
3f111801efb4
Rename BINDING_STACK_SIZE to SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents:
45968
diff
changeset
|
4632 int count = SPECPDL_INDEX (); |
25715
feaedc03dbc8
(x_set_background_color): Remove unused variable(s).
Gerd Moellmann <gerd@gnu.org>
parents:
25691
diff
changeset
|
4633 struct gcpro gcpro1, gcpro2, gcpro3; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4634 struct kboard *kb; |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4635 int face_change_count_before = face_change_count; |
36869
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
4636 Lisp_Object buffer; |
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
4637 struct buffer *old_buffer; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4638 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4639 check_x (); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4640 |
69404
26f292c725f1
(x_create_tip_frame): Preserve received parms by copying them.
Eli Zaretskii <eliz@gnu.org>
parents:
69173
diff
changeset
|
4641 parms = Fcopy_alist (parms); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4642 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4643 #ifdef MULTI_KBOARD |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4644 kb = dpyinfo->kboard; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4645 #else |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4646 kb = &the_only_kboard; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4647 #endif |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4648 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4649 /* Get the name of the frame to use for resource lookup. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4650 name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4651 if (!STRINGP (name) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4652 && !EQ (name, Qunbound) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4653 && !NILP (name)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4654 error ("Invalid frame name--not a string or nil"); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4655 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4656 frame = Qnil; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4657 GCPRO3 (parms, name, frame); |
34450
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
4658 f = make_frame (1); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4659 XSETFRAME (frame, f); |
36869
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
4660 |
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
4661 buffer = Fget_buffer_create (build_string (" *tip*")); |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
4662 Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil); |
36869
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
4663 old_buffer = current_buffer; |
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
4664 set_buffer_internal_1 (XBUFFER (buffer)); |
38574
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
4665 current_buffer->truncate_lines = Qnil; |
55492
43663119f752
(x_create_tip_frame): Bind inhibit-read-only and
Kenichi Handa <handa@m17n.org>
parents:
54392
diff
changeset
|
4666 specbind (Qinhibit_read_only, Qt); |
43663119f752
(x_create_tip_frame): Bind inhibit-read-only and
Kenichi Handa <handa@m17n.org>
parents:
54392
diff
changeset
|
4667 specbind (Qinhibit_modification_hooks, Qt); |
36869
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
4668 Ferase_buffer (); |
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
4669 Finsert (1, &text); |
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
4670 set_buffer_internal_1 (old_buffer); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4671 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4672 FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; |
34598
afd90be3ed75
(x_create_tip_frame): Use unwind_create_tip_frame,
Gerd Moellmann <gerd@gnu.org>
parents:
34549
diff
changeset
|
4673 record_unwind_protect (unwind_create_tip_frame, frame); |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4674 |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4675 /* By setting the output method, we're essentially saying that |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4676 the frame is live, as per FRAME_LIVE_P. If we get a signal |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4677 from this point on, x_destroy_window might screw up reference |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4678 counts etc. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4679 f->output_method = output_x_window; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4680 f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output)); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4681 bzero (f->output_data.x, sizeof (struct x_output)); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4682 f->output_data.x->icon_bitmap = -1; |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
4683 FRAME_FONTSET (f) = -1; |
29882
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4684 f->output_data.x->scroll_bar_foreground_pixel = -1; |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4685 f->output_data.x->scroll_bar_background_pixel = -1; |
39619
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
4686 #ifdef USE_TOOLKIT_SCROLL_BARS |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
4687 f->output_data.x->scroll_bar_top_shadow_pixel = -1; |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
4688 f->output_data.x->scroll_bar_bottom_shadow_pixel = -1; |
1e12db2b25f0
(x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents:
39591
diff
changeset
|
4689 #endif /* USE_TOOLKIT_SCROLL_BARS */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4690 f->icon_name = Qnil; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4691 FRAME_X_DISPLAY_INFO (f) = dpyinfo; |
34895
53e52b3525bf
Use #if GLYPH_DEBUG instead of #ifdef GLYPH_DEBUG.
Gerd Moellmann <gerd@gnu.org>
parents:
34662
diff
changeset
|
4692 #if GLYPH_DEBUG |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4693 image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount; |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4694 dpyinfo_refcount = dpyinfo->reference_count; |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4695 #endif /* GLYPH_DEBUG */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4696 #ifdef MULTI_KBOARD |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4697 FRAME_KBOARD (f) = kb; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4698 #endif |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4699 f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4700 f->output_data.x->explicit_parent = 0; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4701 |
29882
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4702 /* These colors will be set anyway later, but it's important |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4703 to get the color reference counts right, so initialize them! */ |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4704 { |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4705 Lisp_Object black; |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4706 struct gcpro gcpro1; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4707 |
29882
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4708 black = build_string ("black"); |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4709 GCPRO1 (black); |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4710 f->output_data.x->foreground_pixel |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4711 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4712 f->output_data.x->background_pixel |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4713 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4714 f->output_data.x->cursor_pixel |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4715 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4716 f->output_data.x->cursor_foreground_pixel |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4717 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4718 f->output_data.x->border_pixel |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4719 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4720 f->output_data.x->mouse_pixel |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4721 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f)); |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4722 UNGCPRO; |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4723 } |
c12b0f070cd1
(x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents:
29866
diff
changeset
|
4724 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4725 /* Set the name; the functions to which we pass f expect the name to |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4726 be set. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4727 if (EQ (name, Qunbound) || NILP (name)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4728 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4729 f->name = build_string (dpyinfo->x_id_name); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4730 f->explicit_name = 0; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4731 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4732 else |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4733 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4734 f->name = name; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4735 f->explicit_name = 1; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4736 /* use the frame's title when getting resources for this frame. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4737 specbind (Qx_resource_name, name); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4738 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4739 |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4740 /* Extract the window parameters from the supplied values that are |
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4741 needed to determine window geometry. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4742 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4743 Lisp_Object font; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4744 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4745 font = x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4746 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4747 BLOCK_INPUT; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4748 /* First, try whatever font the caller has specified. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4749 if (STRINGP (font)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4750 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4751 tem = Fquery_fontset (font, Qnil); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4752 if (STRINGP (tem)) |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
4753 font = x_new_fontset (f, SDATA (tem)); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4754 else |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
4755 font = x_new_font (f, SDATA (font)); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4756 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4757 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4758 /* Try out a font which we hope has bold and italic variations. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4759 if (!STRINGP (font)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4760 font = x_new_font (f, "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1"); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4761 if (!STRINGP (font)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4762 font = x_new_font (f, "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1"); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4763 if (! STRINGP (font)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4764 font = x_new_font (f, "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1"); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4765 if (! STRINGP (font)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4766 /* This was formerly the first thing tried, but it finds too many fonts |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4767 and takes too long. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4768 font = x_new_font (f, "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1"); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4769 /* If those didn't work, look for something which will at least work. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4770 if (! STRINGP (font)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4771 font = x_new_font (f, "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1"); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4772 UNBLOCK_INPUT; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4773 if (! STRINGP (font)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4774 font = build_string ("fixed"); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4775 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4776 x_default_parameter (f, parms, Qfont, font, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4777 "font", "Font", RES_TYPE_STRING); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4778 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4779 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4780 x_default_parameter (f, parms, Qborder_width, make_number (2), |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4781 "borderWidth", "BorderWidth", RES_TYPE_NUMBER); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4782 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4783 /* This defaults to 2 in order to match xterm. We recognize either |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4784 internalBorderWidth or internalBorder (which is what xterm calls |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4785 it). */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4786 if (NILP (Fassq (Qinternal_border_width, parms))) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4787 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4788 Lisp_Object value; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4789 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4790 value = x_get_arg (dpyinfo, parms, Qinternal_border_width, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4791 "internalBorder", "internalBorder", RES_TYPE_NUMBER); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4792 if (! EQ (value, Qunbound)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4793 parms = Fcons (Fcons (Qinternal_border_width, value), |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4794 parms); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4795 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4796 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4797 x_default_parameter (f, parms, Qinternal_border_width, make_number (1), |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4798 "internalBorderWidth", "internalBorderWidth", |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4799 RES_TYPE_NUMBER); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4800 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4801 /* Also do the stuff which must be set before the window exists. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4802 x_default_parameter (f, parms, Qforeground_color, build_string ("black"), |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4803 "foreground", "Foreground", RES_TYPE_STRING); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4804 x_default_parameter (f, parms, Qbackground_color, build_string ("white"), |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4805 "background", "Background", RES_TYPE_STRING); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4806 x_default_parameter (f, parms, Qmouse_color, build_string ("black"), |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4807 "pointerColor", "Foreground", RES_TYPE_STRING); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4808 x_default_parameter (f, parms, Qcursor_color, build_string ("black"), |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4809 "cursorColor", "Foreground", RES_TYPE_STRING); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4810 x_default_parameter (f, parms, Qborder_color, build_string ("black"), |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4811 "borderColor", "BorderColor", RES_TYPE_STRING); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4812 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4813 /* Init faces before x_default_parameter is called for scroll-bar |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4814 parameters because that function calls x_set_scroll_bar_width, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4815 which calls change_frame_size, which calls Fset_window_buffer, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4816 which runs hooks, which call Fvertical_motion. At the end, we |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4817 end up in init_iterator with a null face cache, which should not |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4818 happen. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4819 init_frame_faces (f); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4820 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4821 f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
4822 |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
4823 window_prompting = x_figure_window_size (f, parms, 0); |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
4824 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4825 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4826 XSetWindowAttributes attrs; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4827 unsigned long mask; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4828 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4829 BLOCK_INPUT; |
33657
e9cf01c7cda6
(x_create_tip_frame): Use CWSaveUnder only if the
Gerd Moellmann <gerd@gnu.org>
parents:
33601
diff
changeset
|
4830 mask = CWBackPixel | CWOverrideRedirect | CWEventMask; |
e9cf01c7cda6
(x_create_tip_frame): Use CWSaveUnder only if the
Gerd Moellmann <gerd@gnu.org>
parents:
33601
diff
changeset
|
4831 if (DoesSaveUnders (dpyinfo->screen)) |
e9cf01c7cda6
(x_create_tip_frame): Use CWSaveUnder only if the
Gerd Moellmann <gerd@gnu.org>
parents:
33601
diff
changeset
|
4832 mask |= CWSaveUnder; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4833 |
27987
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
4834 /* Window managers look at the override-redirect flag to determine |
ce9edc646960
(x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents:
27963
diff
changeset
|
4835 whether or net to give windows a decoration (Xlib spec, chapter |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4836 3.2.8). */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4837 attrs.override_redirect = True; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4838 attrs.save_under = True; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4839 attrs.background_pixel = FRAME_BACKGROUND_PIXEL (f); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4840 /* Arrange for getting MapNotify and UnmapNotify events. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4841 attrs.event_mask = StructureNotifyMask; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4842 tip_window |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4843 = FRAME_X_WINDOW (f) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4844 = XCreateWindow (FRAME_X_DISPLAY (f), |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4845 FRAME_X_DISPLAY_INFO (f)->root_window, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4846 /* x, y, width, height */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4847 0, 0, 1, 1, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4848 /* Border. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4849 1, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4850 CopyFromParent, InputOutput, CopyFromParent, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4851 mask, &attrs); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4852 UNBLOCK_INPUT; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4853 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4854 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4855 x_make_gc (f); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4856 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4857 x_default_parameter (f, parms, Qauto_raise, Qnil, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4858 "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4859 x_default_parameter (f, parms, Qauto_lower, Qnil, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4860 "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4861 x_default_parameter (f, parms, Qcursor_type, Qbox, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4862 "cursorType", "CursorType", RES_TYPE_SYMBOL); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4863 |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
4864 /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size. |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4865 Change will not be effected unless different from the current |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
4866 FRAME_LINES (f). */ |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
4867 width = FRAME_COLS (f); |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
4868 height = FRAME_LINES (f); |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
4869 SET_FRAME_COLS (f, 0); |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
4870 FRAME_LINES (f) = 0; |
25363
bf0488244270
Call change_frame_size and do_pending_window_change with
Gerd Moellmann <gerd@gnu.org>
parents:
25335
diff
changeset
|
4871 change_frame_size (f, height, width, 1, 0, 0); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4872 |
47731
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47434
diff
changeset
|
4873 /* Add `tooltip' frame parameter's default value. */ |
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47434
diff
changeset
|
4874 if (NILP (Fframe_parameter (frame, intern ("tooltip")))) |
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47434
diff
changeset
|
4875 Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt), |
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47434
diff
changeset
|
4876 Qnil)); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4877 |
35042
3088c9745e92
(x_create_tip_frame): Call face-set-after-frame-default,
Gerd Moellmann <gerd@gnu.org>
parents:
34976
diff
changeset
|
4878 /* Set up faces after all frame parameters are known. This call |
35508
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4879 also merges in face attributes specified for new frames. |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4880 |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4881 Frame parameters may be changed if .Xdefaults contains |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4882 specifications for the default font. For example, if there is an |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4883 `Emacs.default.attributeBackground: pink', the `background-color' |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4884 attribute of the frame get's set, which let's the internal border |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4885 of the tooltip frame appear in pink. Prevent this. */ |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4886 { |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4887 Lisp_Object bg = Fframe_parameter (frame, Qbackground_color); |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4888 |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4889 /* Set tip_frame here, so that */ |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4890 tip_frame = frame; |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4891 call1 (Qface_set_after_frame_default, frame); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4892 |
35508
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4893 if (!EQ (bg, Fframe_parameter (frame, Qbackground_color))) |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4894 Fmodify_frame_parameters (frame, Fcons (Fcons (Qbackground_color, bg), |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4895 Qnil)); |
0bd627ce1af8
(x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents:
35402
diff
changeset
|
4896 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4897 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4898 f->no_split = 1; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4899 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4900 UNGCPRO; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4901 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4902 /* It is now ok to make the frame official even if we get an error |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4903 below. And the frame needs to be on Vframe_list or making it |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4904 visible won't work. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4905 Vframe_list = Fcons (frame, Vframe_list); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4906 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4907 /* Now that the frame is official, it counts as a reference to |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4908 its display. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4909 FRAME_X_DISPLAY_INFO (f)->reference_count++; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4910 |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4911 /* Setting attributes of faces of the tooltip frame from resources |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4912 and similar will increment face_change_count, which leads to the |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4913 clearing of all current matrices. Since this isn't necessary |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4914 here, avoid it by resetting face_change_count to the value it |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4915 had before we created the tip frame. */ |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4916 face_change_count = face_change_count_before; |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4917 |
34524
d4b8782e7f7b
(image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents:
34512
diff
changeset
|
4918 /* Discard the unwind_protect. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4919 return unbind_to (count, frame); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4920 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4921 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
4922 |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4923 /* Compute where to display tip frame F. PARMS is the list of frame |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4924 parameters for F. DX and DY are specified offsets from the current |
37253
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4925 location of the mouse. WIDTH and HEIGHT are the width and height |
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4926 of the tooltip. Return coordinates relative to the root window of |
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4927 the display in *ROOT_X, and *ROOT_Y. */ |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4928 |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4929 static void |
37253
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4930 compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4931 struct frame *f; |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4932 Lisp_Object parms, dx, dy; |
37253
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4933 int width, height; |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4934 int *root_x, *root_y; |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4935 { |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4936 Lisp_Object left, top; |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4937 int win_x, win_y; |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4938 Window root, child; |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4939 unsigned pmask; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4940 |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4941 /* User-specified position? */ |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4942 left = Fcdr (Fassq (Qleft, parms)); |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4943 top = Fcdr (Fassq (Qtop, parms)); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
4944 |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4945 /* Move the tooltip window where the mouse pointer is. Resize and |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4946 show it. */ |
41449
4416668397d7
(compute_tip_xy): Initialize root_x and root_y from
Jason Rumney <jasonr@gnu.org>
parents:
41132
diff
changeset
|
4947 if (!INTEGERP (left) || !INTEGERP (top)) |
37253
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4948 { |
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4949 BLOCK_INPUT; |
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4950 XQueryPointer (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window, |
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4951 &root, &child, root_x, root_y, &win_x, &win_y, &pmask); |
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4952 UNBLOCK_INPUT; |
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4953 } |
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4954 |
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4955 if (INTEGERP (top)) |
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4956 *root_y = XINT (top); |
67581
05d48e1da3ad
* xfns.c (compute_tip_xy): Handle negative dx and dy.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67530
diff
changeset
|
4957 else if (*root_y + XINT (dy) <= 0) |
05d48e1da3ad
* xfns.c (compute_tip_xy): Handle negative dx and dy.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67530
diff
changeset
|
4958 *root_y = 0; /* Can happen for negative dy */ |
67530
5b6c71adc503
* (compute_tip_xy): Calculate root_y the same way as root_x,
Jan Djärv <jan.h.d@swipnet.se>
parents:
67442
diff
changeset
|
4959 else if (*root_y + XINT (dy) + height <= FRAME_X_DISPLAY_INFO (f)->height) |
5b6c71adc503
* (compute_tip_xy): Calculate root_y the same way as root_x,
Jan Djärv <jan.h.d@swipnet.se>
parents:
67442
diff
changeset
|
4960 /* It fits below the pointer */ |
5b6c71adc503
* (compute_tip_xy): Calculate root_y the same way as root_x,
Jan Djärv <jan.h.d@swipnet.se>
parents:
67442
diff
changeset
|
4961 *root_y += XINT (dy); |
5b6c71adc503
* (compute_tip_xy): Calculate root_y the same way as root_x,
Jan Djärv <jan.h.d@swipnet.se>
parents:
67442
diff
changeset
|
4962 else if (height + XINT (dy) <= *root_y) |
5b6c71adc503
* (compute_tip_xy): Calculate root_y the same way as root_x,
Jan Djärv <jan.h.d@swipnet.se>
parents:
67442
diff
changeset
|
4963 /* It fits above the pointer. */ |
5b6c71adc503
* (compute_tip_xy): Calculate root_y the same way as root_x,
Jan Djärv <jan.h.d@swipnet.se>
parents:
67442
diff
changeset
|
4964 *root_y -= height + XINT (dy); |
37253
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4965 else |
67530
5b6c71adc503
* (compute_tip_xy): Calculate root_y the same way as root_x,
Jan Djärv <jan.h.d@swipnet.se>
parents:
67442
diff
changeset
|
4966 /* Put it on the top. */ |
5b6c71adc503
* (compute_tip_xy): Calculate root_y the same way as root_x,
Jan Djärv <jan.h.d@swipnet.se>
parents:
67442
diff
changeset
|
4967 *root_y = 0; |
37253
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4968 |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4969 if (INTEGERP (left)) |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4970 *root_x = XINT (left); |
67581
05d48e1da3ad
* xfns.c (compute_tip_xy): Handle negative dx and dy.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67530
diff
changeset
|
4971 else if (*root_x + XINT (dx) <= 0) |
05d48e1da3ad
* xfns.c (compute_tip_xy): Handle negative dx and dy.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67530
diff
changeset
|
4972 *root_x = 0; /* Can happen for negative dx */ |
42247
35dd407f04cd
(compute_tip_xy): If tooltip won't fit on the screen
Richard M. Stallman <rms@gnu.org>
parents:
42123
diff
changeset
|
4973 else if (*root_x + XINT (dx) + width <= FRAME_X_DISPLAY_INFO (f)->width) |
35dd407f04cd
(compute_tip_xy): If tooltip won't fit on the screen
Richard M. Stallman <rms@gnu.org>
parents:
42123
diff
changeset
|
4974 /* It fits to the right of the pointer. */ |
35dd407f04cd
(compute_tip_xy): If tooltip won't fit on the screen
Richard M. Stallman <rms@gnu.org>
parents:
42123
diff
changeset
|
4975 *root_x += XINT (dx); |
35dd407f04cd
(compute_tip_xy): If tooltip won't fit on the screen
Richard M. Stallman <rms@gnu.org>
parents:
42123
diff
changeset
|
4976 else if (width + XINT (dx) <= *root_x) |
35dd407f04cd
(compute_tip_xy): If tooltip won't fit on the screen
Richard M. Stallman <rms@gnu.org>
parents:
42123
diff
changeset
|
4977 /* It fits to the left of the pointer. */ |
37253
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4978 *root_x -= width + XINT (dx); |
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
4979 else |
42247
35dd407f04cd
(compute_tip_xy): If tooltip won't fit on the screen
Richard M. Stallman <rms@gnu.org>
parents:
42123
diff
changeset
|
4980 /* Put it left-justified on the screen--it ought to fit that way. */ |
35dd407f04cd
(compute_tip_xy): If tooltip won't fit on the screen
Richard M. Stallman <rms@gnu.org>
parents:
42123
diff
changeset
|
4981 *root_x = 0; |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4982 } |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4983 |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
4984 |
30224
b9f781194989
(Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents:
29947
diff
changeset
|
4985 DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
4986 doc: /* Show STRING in a "tooltip" window on frame FRAME. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4987 A tooltip window is a small X window displaying a string. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4988 |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4989 FRAME nil or omitted means use the selected frame. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4990 |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4991 PARMS is an optional list of frame parameters which can be used to |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4992 change the tooltip's appearance. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4993 |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4994 Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4995 means use the default timeout of 5 seconds. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4996 |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4997 If the list of frame parameters PARAMS contains a `left' parameters, |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4998 the tooltip is displayed at that x-position. Otherwise it is |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
4999 displayed at the mouse position, with offset DX added (default is 5 if |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5000 DX isn't specified). Likewise for the y-position; if a `top' frame |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5001 parameter is specified, it determines the y-position of the tooltip |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5002 window, otherwise it is displayed at the mouse position, with offset |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5003 DY added (default is -10). |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5004 |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5005 A tooltip's maximum size is specified by `x-max-tooltip-size'. |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5006 Text larger than the specified size is clipped. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5007 (string, frame, parms, timeout, dx, dy) |
30224
b9f781194989
(Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents:
29947
diff
changeset
|
5008 Lisp_Object string, frame, parms, timeout, dx, dy; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5009 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5010 struct frame *f; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5011 struct window *w; |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5012 int root_x, root_y; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5013 struct buffer *old_buffer; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5014 struct text_pos pos; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5015 int i, width, height; |
26980
f0d5e95ccce9
(Fx_show_tip): Gcpro `timeout' too.
Dave Love <fx@gnu.org>
parents:
26978
diff
changeset
|
5016 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5017 int old_windows_or_buffers_changed = windows_or_buffers_changed; |
46285
3f111801efb4
Rename BINDING_STACK_SIZE to SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents:
45968
diff
changeset
|
5018 int count = SPECPDL_INDEX (); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5019 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5020 specbind (Qinhibit_redisplay, Qt); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5021 |
26980
f0d5e95ccce9
(Fx_show_tip): Gcpro `timeout' too.
Dave Love <fx@gnu.org>
parents:
26978
diff
changeset
|
5022 GCPRO4 (string, parms, frame, timeout); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5023 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
5024 CHECK_STRING (string); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5025 f = check_x_frame (frame); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5026 if (NILP (timeout)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5027 timeout = make_number (5); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5028 else |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
5029 CHECK_NATNUM (timeout); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5030 |
30224
b9f781194989
(Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents:
29947
diff
changeset
|
5031 if (NILP (dx)) |
b9f781194989
(Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents:
29947
diff
changeset
|
5032 dx = make_number (5); |
b9f781194989
(Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents:
29947
diff
changeset
|
5033 else |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
5034 CHECK_NUMBER (dx); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5035 |
30224
b9f781194989
(Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents:
29947
diff
changeset
|
5036 if (NILP (dy)) |
33589
5832e9020859
(Fx_show_tip): Use default y-offset of -10 so that
Gerd Moellmann <gerd@gnu.org>
parents:
33443
diff
changeset
|
5037 dy = make_number (-10); |
30224
b9f781194989
(Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents:
29947
diff
changeset
|
5038 else |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
5039 CHECK_NUMBER (dy); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5040 |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5041 if (NILP (last_show_tip_args)) |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5042 last_show_tip_args = Fmake_vector (make_number (3), Qnil); |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5043 |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5044 if (!NILP (tip_frame)) |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5045 { |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5046 Lisp_Object last_string = AREF (last_show_tip_args, 0); |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5047 Lisp_Object last_frame = AREF (last_show_tip_args, 1); |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5048 Lisp_Object last_parms = AREF (last_show_tip_args, 2); |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5049 |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5050 if (EQ (frame, last_frame) |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5051 && !NILP (Fequal (last_string, string)) |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5052 && !NILP (Fequal (last_parms, parms))) |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5053 { |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5054 struct frame *f = XFRAME (tip_frame); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5055 |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5056 /* Only DX and DY have changed. */ |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5057 if (!NILP (tip_timer)) |
35402
302fbe91e359
(Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
35360
diff
changeset
|
5058 { |
302fbe91e359
(Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
35360
diff
changeset
|
5059 Lisp_Object timer = tip_timer; |
302fbe91e359
(Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
35360
diff
changeset
|
5060 tip_timer = Qnil; |
302fbe91e359
(Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
35360
diff
changeset
|
5061 call1 (Qcancel_timer, timer); |
302fbe91e359
(Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
35360
diff
changeset
|
5062 } |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5063 |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5064 BLOCK_INPUT; |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
5065 compute_tip_xy (f, parms, dx, dy, FRAME_PIXEL_WIDTH (f), |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
5066 FRAME_PIXEL_HEIGHT (f), &root_x, &root_y); |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5067 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
37253
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
5068 root_x, root_y); |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5069 UNBLOCK_INPUT; |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5070 goto start_timer; |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5071 } |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5072 } |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5073 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5074 /* Hide a previous tip, if any. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5075 Fx_hide_tip (); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5076 |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5077 ASET (last_show_tip_args, 0, string); |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5078 ASET (last_show_tip_args, 1, frame); |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5079 ASET (last_show_tip_args, 2, parms); |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5080 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5081 /* Add default values to frame parameters. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5082 if (NILP (Fassq (Qname, parms))) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5083 parms = Fcons (Fcons (Qname, build_string ("tooltip")), parms); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5084 if (NILP (Fassq (Qinternal_border_width, parms))) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5085 parms = Fcons (Fcons (Qinternal_border_width, make_number (3)), parms); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5086 if (NILP (Fassq (Qborder_width, parms))) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5087 parms = Fcons (Fcons (Qborder_width, make_number (1)), parms); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5088 if (NILP (Fassq (Qborder_color, parms))) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5089 parms = Fcons (Fcons (Qborder_color, build_string ("lightyellow")), parms); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5090 if (NILP (Fassq (Qbackground_color, parms))) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5091 parms = Fcons (Fcons (Qbackground_color, build_string ("lightyellow")), |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5092 parms); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5093 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5094 /* Create a frame for the tooltip, and record it in the global |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5095 variable tip_frame. */ |
36869
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
5096 frame = x_create_tip_frame (FRAME_X_DISPLAY_INFO (f), parms, string); |
34450
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
5097 f = XFRAME (frame); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5098 |
38574
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5099 /* Set up the frame's root window. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5100 w = XWINDOW (FRAME_ROOT_WINDOW (f)); |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
5101 w->left_col = w->top_line = make_number (0); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5102 |
38574
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5103 if (CONSP (Vx_max_tooltip_size) |
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5104 && INTEGERP (XCAR (Vx_max_tooltip_size)) |
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5105 && XINT (XCAR (Vx_max_tooltip_size)) > 0 |
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5106 && INTEGERP (XCDR (Vx_max_tooltip_size)) |
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5107 && XINT (XCDR (Vx_max_tooltip_size)) > 0) |
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5108 { |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
5109 w->total_cols = XCAR (Vx_max_tooltip_size); |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
5110 w->total_lines = XCDR (Vx_max_tooltip_size); |
38574
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5111 } |
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5112 else |
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5113 { |
51211
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
5114 w->total_cols = make_number (80); |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
5115 w->total_lines = make_number (40); |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
5116 } |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
5117 |
28ea05de2dc5
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51175
diff
changeset
|
5118 FRAME_TOTAL_COLS (f) = XINT (w->total_cols); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5119 adjust_glyphs (f); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5120 w->pseudo_window_p = 1; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5121 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5122 /* Display the tooltip text in a temporary buffer. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5123 old_buffer = current_buffer; |
36869
a9cbe17061fc
(x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents:
36594
diff
changeset
|
5124 set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); |
38574
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5125 current_buffer->truncate_lines = Qnil; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5126 clear_glyph_matrix (w->desired_matrix); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5127 clear_glyph_matrix (w->current_matrix); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5128 SET_TEXT_POS (pos, BEGV, BEGV_BYTE); |
63772
b9edfe751512
(Fx_show_tip): Pass new arg to try_window.
Richard M. Stallman <rms@gnu.org>
parents:
62216
diff
changeset
|
5129 try_window (FRAME_ROOT_WINDOW (f), pos, 0); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5130 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5131 /* Compute width and height of the tooltip. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5132 width = height = 0; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5133 for (i = 0; i < w->desired_matrix->nrows; ++i) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5134 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5135 struct glyph_row *row = &w->desired_matrix->rows[i]; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5136 struct glyph *last; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5137 int row_width; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5138 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5139 /* Stop at the first empty row at the end. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5140 if (!row->enabled_p || !row->displays_text_p) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5141 break; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5142 |
25082
ba6bf065b287
(x_create_tip_frame): Don't set bitmapIcon resource.
Gerd Moellmann <gerd@gnu.org>
parents:
25075
diff
changeset
|
5143 /* Let the row go over the full width of the frame. */ |
ba6bf065b287
(x_create_tip_frame): Don't set bitmapIcon resource.
Gerd Moellmann <gerd@gnu.org>
parents:
25075
diff
changeset
|
5144 row->full_width_p = 1; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5145 |
28410
2812a333e746
(free_image_cache): Free the cache structure itself
Gerd Moellmann <gerd@gnu.org>
parents:
28355
diff
changeset
|
5146 /* There's a glyph at the end of rows that is used to place |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5147 the cursor there. Don't include the width of this glyph. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5148 if (row->used[TEXT_AREA]) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5149 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5150 last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1]; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5151 row_width = row->pixel_width - last->pixel_width; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5152 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5153 else |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5154 row_width = row->pixel_width; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5155 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5156 height += row->height; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5157 width = max (width, row_width); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5158 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5159 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5160 /* Add the frame's internal border to the width and height the X |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5161 window should have. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5162 height += 2 * FRAME_INTERNAL_BORDER_WIDTH (f); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5163 width += 2 * FRAME_INTERNAL_BORDER_WIDTH (f); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5164 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5165 /* Move the tooltip window where the mouse pointer is. Resize and |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5166 show it. */ |
37253
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
5167 compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y); |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5168 |
30224
b9f781194989
(Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents:
29947
diff
changeset
|
5169 BLOCK_INPUT; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5170 XMoveResizeWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
37253
7c3a00620335
(compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents:
37210
diff
changeset
|
5171 root_x, root_y, width, height); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5172 XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5173 UNBLOCK_INPUT; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5174 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5175 /* Draw into the window. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5176 w->must_be_updated_p = 1; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5177 update_single_window (w, 1); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5178 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5179 /* Restore original current buffer. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5180 set_buffer_internal_1 (old_buffer); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5181 windows_or_buffers_changed = old_windows_or_buffers_changed; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5182 |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5183 start_timer: |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5184 /* Let the tip disappear after timeout seconds. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5185 tip_timer = call3 (intern ("run-at-time"), timeout, Qnil, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5186 intern ("x-hide-tip")); |
26954
e388d69f4269
(Fx_show_tip): Add missing UNGCPRO.
Dave Love <fx@gnu.org>
parents:
26876
diff
changeset
|
5187 |
e388d69f4269
(Fx_show_tip): Add missing UNGCPRO.
Dave Love <fx@gnu.org>
parents:
26876
diff
changeset
|
5188 UNGCPRO; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5189 return unbind_to (count, Qnil); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5190 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5191 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5192 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5193 DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5194 doc: /* Hide the current tooltip window, if there is any. |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5195 Value is t if tooltip was open, nil otherwise. */) |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5196 () |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5197 { |
34450
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
5198 int count; |
34476 | 5199 Lisp_Object deleted, frame, timer; |
5200 struct gcpro gcpro1, gcpro2; | |
34450
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
5201 |
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
5202 /* Return quickly if nothing to do. */ |
34476 | 5203 if (NILP (tip_timer) && NILP (tip_frame)) |
34450
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
5204 return Qnil; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5205 |
34476 | 5206 frame = tip_frame; |
5207 timer = tip_timer; | |
5208 GCPRO2 (frame, timer); | |
5209 tip_frame = tip_timer = deleted = Qnil; | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5210 |
46285
3f111801efb4
Rename BINDING_STACK_SIZE to SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents:
45968
diff
changeset
|
5211 count = SPECPDL_INDEX (); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5212 specbind (Qinhibit_redisplay, Qt); |
34450
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
5213 specbind (Qinhibit_quit, Qt); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5214 |
34476 | 5215 if (!NILP (timer)) |
35402
302fbe91e359
(Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
35360
diff
changeset
|
5216 call1 (Qcancel_timer, timer); |
34476 | 5217 |
5218 if (FRAMEP (frame)) | |
5219 { | |
34450
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
5220 Fdelete_frame (frame, Qnil); |
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
5221 deleted = Qt; |
33713
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5222 |
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5223 #ifdef USE_LUCID |
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5224 /* Bloodcurdling hack alert: The Lucid menu bar widget's |
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5225 redisplay procedure is not called when a tip frame over menu |
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5226 items is unmapped. Redisplay the menu manually... */ |
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5227 { |
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5228 struct frame *f = SELECTED_FRAME (); |
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5229 Widget w = f->output_data.x->menubar_widget; |
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5230 extern void xlwmenu_redisplay P_ ((Widget)); |
39675 | 5231 |
33713
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5232 if (!DoesSaveUnders (FRAME_X_DISPLAY_INFO (f)->screen) |
36441
861557fe5809
(Fx_hide_tip): Don't use `None' with widgets; use
Gerd Moellmann <gerd@gnu.org>
parents:
36252
diff
changeset
|
5233 && w != NULL) |
33713
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5234 { |
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5235 BLOCK_INPUT; |
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5236 xlwmenu_redisplay (w); |
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5237 UNBLOCK_INPUT; |
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5238 } |
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5239 } |
91b2daa9479f
(Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents:
33657
diff
changeset
|
5240 #endif /* USE_LUCID */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5241 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5242 |
34476 | 5243 UNGCPRO; |
34450
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
5244 return unbind_to (count, deleted); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5245 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5246 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5247 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5248 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5249 /*********************************************************************** |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5250 File selection dialog |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5251 ***********************************************************************/ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5252 |
67761
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5253 DEFUN ("x-uses-old-gtk-dialog", Fx_uses_old_gtk_dialog, |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5254 Sx_uses_old_gtk_dialog, |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5255 0, 0, 0, |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5256 doc: /* Return t if the old Gtk+ file selection dialog is used. */) |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5257 () |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5258 { |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5259 #ifdef USE_GTK |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5260 extern int use_dialog_box; |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5261 extern int use_file_dialog; |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5262 |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5263 if (use_dialog_box |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5264 && use_file_dialog |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5265 && have_menus_p () |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5266 && xg_uses_old_file_dialog ()) |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5267 return Qt; |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5268 #endif |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5269 return Qnil; |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5270 } |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5271 |
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5272 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5273 #ifdef USE_MOTIF |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5274 /* Callback for "OK" and "Cancel" on file selection dialog. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5275 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5276 static void |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5277 file_dialog_cb (widget, client_data, call_data) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5278 Widget widget; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5279 XtPointer call_data, client_data; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5280 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5281 int *result = (int *) client_data; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5282 XmAnyCallbackStruct *cb = (XmAnyCallbackStruct *) call_data; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5283 *result = cb->reason; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5284 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5285 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5286 |
37556
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5287 /* Callback for unmapping a file selection dialog. This is used to |
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5288 capture the case where a dialog is closed via a window manager's |
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5289 closer button, for example. Using a XmNdestroyCallback didn't work |
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5290 in this case. */ |
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5291 |
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5292 static void |
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5293 file_dialog_unmap_cb (widget, client_data, call_data) |
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5294 Widget widget; |
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5295 XtPointer call_data, client_data; |
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5296 { |
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5297 int *result = (int *) client_data; |
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5298 *result = XmCR_CANCEL; |
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5299 } |
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5300 |
58214
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5301 static Lisp_Object |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5302 clean_up_file_dialog (arg) |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5303 Lisp_Object arg; |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5304 { |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5305 struct Lisp_Save_Value *p = XSAVE_VALUE (arg); |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5306 Widget dialog = (Widget) p->pointer; |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5307 |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5308 /* Clean up. */ |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5309 BLOCK_INPUT; |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5310 XtUnmanageChild (dialog); |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5311 XtDestroyWidget (dialog); |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5312 x_menu_set_in_use (0); |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5313 UNBLOCK_INPUT; |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5314 |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5315 return Qnil; |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5316 } |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5317 |
37556
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5318 |
57868
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5319 DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5320 doc: /* Read file name, prompting with PROMPT in directory DIR. |
57868
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5321 Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5322 selection box, if specified. If MUSTMATCH is non-nil, the returned file |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5323 or directory must exist. ONLY-DIR-P is ignored." */) |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5324 (prompt, dir, default_filename, mustmatch, only_dir_p) |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5325 Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5326 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5327 int result; |
25679
8b09c5927f1c
(QCfile): Moved to xdisp.c.
Gerd Moellmann <gerd@gnu.org>
parents:
25646
diff
changeset
|
5328 struct frame *f = SELECTED_FRAME (); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5329 Lisp_Object file = Qnil; |
69065
4c87a7783f95
* xfns.c (Fx_file_dialog, Motif and GTK): DECODE_FILE before
Jan Djärv <jan.h.d@swipnet.se>
parents:
68880
diff
changeset
|
5330 Lisp_Object decoded_file; |
57868
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5331 Widget dialog, text, help; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5332 Arg al[10]; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5333 int ac = 0; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5334 extern XtAppContext Xt_app_con; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5335 XmString dir_xmstring, pattern_xmstring; |
46295
b77ef572e1c9
Use macro SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents:
46285
diff
changeset
|
5336 int count = SPECPDL_INDEX (); |
57868
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5337 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6; |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5338 |
72774
e00572984112
(Fx_file_dialog): Call check_x.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
72529
diff
changeset
|
5339 check_x (); |
e00572984112
(Fx_file_dialog): Call check_x.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
72529
diff
changeset
|
5340 |
57868
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5341 GCPRO6 (prompt, dir, default_filename, mustmatch, only_dir_p, file); |
58214
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5342 |
58283
c163562b2d59
* xmenu.c (x_menu_in_use): Removed.
Jan Djärv <jan.h.d@swipnet.se>
parents:
58214
diff
changeset
|
5343 if (popup_activated ()) |
58214
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5344 error ("Trying to use a menu from within a menu-entry"); |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5345 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
5346 CHECK_STRING (prompt); |
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40608
diff
changeset
|
5347 CHECK_STRING (dir); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5348 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5349 /* Prevent redisplay. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5350 specbind (Qinhibit_redisplay, Qt); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5351 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5352 BLOCK_INPUT; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5353 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5354 /* Create the dialog with PROMPT as title, using DIR as initial |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5355 directory and using "*" as pattern. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5356 dir = Fexpand_file_name (dir, Qnil); |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
5357 dir_xmstring = XmStringCreateLocalized (SDATA (dir)); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5358 pattern_xmstring = XmStringCreateLocalized ("*"); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5359 |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46295
diff
changeset
|
5360 XtSetArg (al[ac], XmNtitle, SDATA (prompt)); ++ac; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5361 XtSetArg (al[ac], XmNdirectory, dir_xmstring); ++ac; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5362 XtSetArg (al[ac], XmNpattern, pattern_xmstring); ++ac; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5363 XtSetArg (al[ac], XmNresizePolicy, XmRESIZE_GROW); ++ac; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5364 XtSetArg (al[ac], XmNdialogStyle, XmDIALOG_APPLICATION_MODAL); ++ac; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5365 dialog = XmCreateFileSelectionDialog (f->output_data.x->widget, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5366 "fsb", al, ac); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5367 XmStringFree (dir_xmstring); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5368 XmStringFree (pattern_xmstring); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5369 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5370 /* Add callbacks for OK and Cancel. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5371 XtAddCallback (dialog, XmNokCallback, file_dialog_cb, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5372 (XtPointer) &result); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5373 XtAddCallback (dialog, XmNcancelCallback, file_dialog_cb, |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5374 (XtPointer) &result); |
37556
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5375 XtAddCallback (dialog, XmNunmapCallback, file_dialog_unmap_cb, |
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5376 (XtPointer) &result); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5377 |
57868
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5378 /* Remove the help button since we can't display help. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5379 help = XmFileSelectionBoxGetChild (dialog, XmDIALOG_HELP_BUTTON); |
57868
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5380 XtUnmanageChild (help); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5381 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5382 /* Mark OK button as default. */ |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5383 XtVaSetValues (XmFileSelectionBoxGetChild (dialog, XmDIALOG_OK_BUTTON), |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5384 XmNshowAsDefault, True, NULL); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5385 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5386 /* If MUSTMATCH is non-nil, disable the file entry field of the |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5387 dialog, so that the user must select a file from the files list |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5388 box. We can't remove it because we wouldn't have a way to get at |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5389 the result file name, then. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5390 text = XmFileSelectionBoxGetChild (dialog, XmDIALOG_TEXT); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5391 if (!NILP (mustmatch)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5392 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5393 Widget label; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5394 label = XmFileSelectionBoxGetChild (dialog, XmDIALOG_SELECTION_LABEL); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5395 XtSetSensitive (text, False); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5396 XtSetSensitive (label, False); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5397 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5398 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5399 /* Manage the dialog, so that list boxes get filled. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5400 XtManageChild (dialog); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5401 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5402 if (STRINGP (default_filename)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5403 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5404 XmString default_xmstring; |
57868
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5405 Widget wtext = XmFileSelectionBoxGetChild (dialog, XmDIALOG_TEXT); |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5406 Widget list = XmFileSelectionBoxGetChild (dialog, XmDIALOG_LIST); |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5407 |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5408 XmTextPosition last_pos = XmTextFieldGetLastPosition (wtext); |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5409 XmTextFieldReplace (wtext, 0, last_pos, |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5410 (SDATA (Ffile_name_nondirectory (default_filename)))); |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5411 |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5412 /* Select DEFAULT_FILENAME in the files list box. DEFAULT_FILENAME |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5413 must include the path for this to work. */ |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5414 |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5415 default_xmstring = XmStringCreateLocalized (SDATA (default_filename)); |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5416 |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5417 if (XmListItemExists (list, default_xmstring)) |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5418 { |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5419 int item_pos = XmListItemPos (list, default_xmstring); |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5420 /* Select the item and scroll it into view. */ |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5421 XmListSelectPos (list, item_pos, True); |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5422 XmListSetPos (list, item_pos); |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5423 } |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5424 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5425 XmStringFree (default_xmstring); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5426 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5427 |
58214
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5428 record_unwind_protect (clean_up_file_dialog, make_save_value (dialog, 0)); |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5429 |
49117 | 5430 /* Process events until the user presses Cancel or OK. */ |
58283
c163562b2d59
* xmenu.c (x_menu_in_use): Removed.
Jan Djärv <jan.h.d@swipnet.se>
parents:
58214
diff
changeset
|
5431 x_menu_set_in_use (1); |
29866
c31c4d7dd0e0
(Fx_file_dialog) [HAVE_MOTIF_2_1]: Handle events
Gerd Moellmann <gerd@gnu.org>
parents:
29728
diff
changeset
|
5432 result = 0; |
37556
171c0f4964a9
(file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
37253
diff
changeset
|
5433 while (result == 0) |
38548
58603538f196
(Fx_file_dialog): Block/unblock input while processing
Gerd Moellmann <gerd@gnu.org>
parents:
38542
diff
changeset
|
5434 { |
49117 | 5435 XEvent event; |
58214
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5436 x_menu_wait_for_event (0); |
49117 | 5437 XtAppNextEvent (Xt_app_con, &event); |
59102
0096c58ce34a
* xmenu.c (popup_get_selection): Pop down on C-g.
Jan Djärv <jan.h.d@swipnet.se>
parents:
58463
diff
changeset
|
5438 if (event.type == KeyPress |
0096c58ce34a
* xmenu.c (popup_get_selection): Pop down on C-g.
Jan Djärv <jan.h.d@swipnet.se>
parents:
58463
diff
changeset
|
5439 && FRAME_X_DISPLAY (f) == event.xkey.display) |
0096c58ce34a
* xmenu.c (popup_get_selection): Pop down on C-g.
Jan Djärv <jan.h.d@swipnet.se>
parents:
58463
diff
changeset
|
5440 { |
0096c58ce34a
* xmenu.c (popup_get_selection): Pop down on C-g.
Jan Djärv <jan.h.d@swipnet.se>
parents:
58463
diff
changeset
|
5441 KeySym keysym = XLookupKeysym (&event.xkey, 0); |
0096c58ce34a
* xmenu.c (popup_get_selection): Pop down on C-g.
Jan Djärv <jan.h.d@swipnet.se>
parents:
58463
diff
changeset
|
5442 |
0096c58ce34a
* xmenu.c (popup_get_selection): Pop down on C-g.
Jan Djärv <jan.h.d@swipnet.se>
parents:
58463
diff
changeset
|
5443 /* Pop down on C-g. */ |
0096c58ce34a
* xmenu.c (popup_get_selection): Pop down on C-g.
Jan Djärv <jan.h.d@swipnet.se>
parents:
58463
diff
changeset
|
5444 if (keysym == XK_g && (event.xkey.state & ControlMask) != 0) |
0096c58ce34a
* xmenu.c (popup_get_selection): Pop down on C-g.
Jan Djärv <jan.h.d@swipnet.se>
parents:
58463
diff
changeset
|
5445 XtUnmanageChild (dialog); |
0096c58ce34a
* xmenu.c (popup_get_selection): Pop down on C-g.
Jan Djärv <jan.h.d@swipnet.se>
parents:
58463
diff
changeset
|
5446 } |
59904
adc18da68682
(unwind_create_frame) [!GLYPH_DEBUG]: Fix xassert.
Kim F. Storm <storm@cua.dk>
parents:
59789
diff
changeset
|
5447 |
58214
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5448 (void) x_dispatch_event (&event, FRAME_X_DISPLAY (f)); |
49117 | 5449 } |
29866
c31c4d7dd0e0
(Fx_file_dialog) [HAVE_MOTIF_2_1]: Handle events
Gerd Moellmann <gerd@gnu.org>
parents:
29728
diff
changeset
|
5450 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5451 /* Get the result. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5452 if (result == XmCR_OK) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5453 { |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5454 XmString text; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5455 String data; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5456 |
30573
3bb43339533c
(Fx_file_dialog): Use NULL instead of 0 at the end of
Gerd Moellmann <gerd@gnu.org>
parents:
30383
diff
changeset
|
5457 XtVaGetValues (dialog, XmNtextString, &text, NULL); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5458 XmStringGetLtoR (text, XmFONTLIST_DEFAULT_TAG, &data); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5459 XmStringFree (text); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5460 file = build_string (data); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5461 XtFree (data); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5462 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5463 else |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5464 file = Qnil; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5465 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5466 UNBLOCK_INPUT; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5467 UNGCPRO; |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5468 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5469 /* Make "Cancel" equivalent to C-g. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5470 if (NILP (file)) |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5471 Fsignal (Qquit, Qnil); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5472 |
69065
4c87a7783f95
* xfns.c (Fx_file_dialog, Motif and GTK): DECODE_FILE before
Jan Djärv <jan.h.d@swipnet.se>
parents:
68880
diff
changeset
|
5473 decoded_file = DECODE_FILE (file); |
4c87a7783f95
* xfns.c (Fx_file_dialog, Motif and GTK): DECODE_FILE before
Jan Djärv <jan.h.d@swipnet.se>
parents:
68880
diff
changeset
|
5474 |
4c87a7783f95
* xfns.c (Fx_file_dialog, Motif and GTK): DECODE_FILE before
Jan Djärv <jan.h.d@swipnet.se>
parents:
68880
diff
changeset
|
5475 return unbind_to (count, decoded_file); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5476 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5477 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5478 #endif /* USE_MOTIF */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5479 |
49322 | 5480 #ifdef USE_GTK |
5481 | |
58214
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5482 static Lisp_Object |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5483 clean_up_dialog (arg) |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5484 Lisp_Object arg; |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5485 { |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5486 x_menu_set_in_use (0); |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5487 |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5488 return Qnil; |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5489 } |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5490 |
57868
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5491 DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0, |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5492 doc: /* Read file name, prompting with PROMPT in directory DIR. |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5493 Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5494 selection box, if specified. If MUSTMATCH is non-nil, the returned file |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5495 or directory must exist. If ONLY-DIR-P is non-nil, the user can only select |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5496 directories. */) |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5497 (prompt, dir, default_filename, mustmatch, only_dir_p) |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5498 Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p; |
49322 | 5499 { |
5500 FRAME_PTR f = SELECTED_FRAME (); | |
5501 char *fn; | |
5502 Lisp_Object file = Qnil; | |
69065
4c87a7783f95
* xfns.c (Fx_file_dialog, Motif and GTK): DECODE_FILE before
Jan Djärv <jan.h.d@swipnet.se>
parents:
68880
diff
changeset
|
5503 Lisp_Object decoded_file; |
58214
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5504 int count = SPECPDL_INDEX (); |
57868
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5505 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6; |
49322 | 5506 char *cdef_file; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5507 |
72774
e00572984112
(Fx_file_dialog): Call check_x.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
72529
diff
changeset
|
5508 check_x (); |
e00572984112
(Fx_file_dialog): Call check_x.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
72529
diff
changeset
|
5509 |
57868
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5510 GCPRO6 (prompt, dir, default_filename, mustmatch, only_dir_p, file); |
58214
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5511 |
58283
c163562b2d59
* xmenu.c (x_menu_in_use): Removed.
Jan Djärv <jan.h.d@swipnet.se>
parents:
58214
diff
changeset
|
5512 if (popup_activated ()) |
58214
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5513 error ("Trying to use a menu from within a menu-entry"); |
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5514 |
49322 | 5515 CHECK_STRING (prompt); |
5516 CHECK_STRING (dir); | |
5517 | |
5518 /* Prevent redisplay. */ | |
5519 specbind (Qinhibit_redisplay, Qt); | |
58214
aaad85fd645c
* xfns.c (Fx_file_dialog): Call x_menu_in_use and x_menu_set_in_use.
Jan Djärv <jan.h.d@swipnet.se>
parents:
57941
diff
changeset
|
5520 record_unwind_protect (clean_up_dialog, Qnil); |
49322 | 5521 |
5522 BLOCK_INPUT; | |
5523 | |
5524 if (STRINGP (default_filename)) | |
5525 cdef_file = SDATA (default_filename); | |
5526 else | |
5527 cdef_file = SDATA (dir); | |
5528 | |
57868
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5529 fn = xg_get_file_name (f, SDATA (prompt), cdef_file, |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5530 ! NILP (mustmatch), |
c955f6add62a
* fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents:
57765
diff
changeset
|
5531 ! NILP (only_dir_p)); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5532 |
49322 | 5533 if (fn) |
5534 { | |
5535 file = build_string (fn); | |
5536 xfree (fn); | |
5537 } | |
5538 | |
5539 UNBLOCK_INPUT; | |
5540 UNGCPRO; | |
5541 | |
5542 /* Make "Cancel" equivalent to C-g. */ | |
5543 if (NILP (file)) | |
5544 Fsignal (Qquit, Qnil); | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5545 |
69065
4c87a7783f95
* xfns.c (Fx_file_dialog, Motif and GTK): DECODE_FILE before
Jan Djärv <jan.h.d@swipnet.se>
parents:
68880
diff
changeset
|
5546 decoded_file = DECODE_FILE (file); |
4c87a7783f95
* xfns.c (Fx_file_dialog, Motif and GTK): DECODE_FILE before
Jan Djärv <jan.h.d@swipnet.se>
parents:
68880
diff
changeset
|
5547 |
4c87a7783f95
* xfns.c (Fx_file_dialog, Motif and GTK): DECODE_FILE before
Jan Djärv <jan.h.d@swipnet.se>
parents:
68880
diff
changeset
|
5548 return unbind_to (count, decoded_file); |
49322 | 5549 } |
5550 | |
5551 #endif /* USE_GTK */ | |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5552 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5553 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5554 /*********************************************************************** |
34549
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5555 Keyboard |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5556 ***********************************************************************/ |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5557 |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5558 #ifdef HAVE_XKBGETKEYBOARD |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5559 #include <X11/XKBlib.h> |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5560 #include <X11/keysym.h> |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5561 #endif |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5562 |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5563 DEFUN ("x-backspace-delete-keys-p", Fx_backspace_delete_keys_p, |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5564 Sx_backspace_delete_keys_p, 0, 1, 0, |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5565 doc: /* Check if both Backspace and Delete keys are on the keyboard of FRAME. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5566 FRAME nil means use the selected frame. |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5567 Value is t if we know that both keys are present, and are mapped to the |
67654
f6416d33b0a2
(Fx_backspace_delete_keys_p): In case we cannot determine
Dan Nicolaescu <dann@ics.uci.edu>
parents:
67581
diff
changeset
|
5568 usual X keysyms. Value is `lambda' if we cannot determine if both keys are |
f6416d33b0a2
(Fx_backspace_delete_keys_p): In case we cannot determine
Dan Nicolaescu <dann@ics.uci.edu>
parents:
67581
diff
changeset
|
5569 present and mapped to the usual X keysyms. */) |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5570 (frame) |
34549
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5571 Lisp_Object frame; |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5572 { |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5573 #ifdef HAVE_XKBGETKEYBOARD |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5574 XkbDescPtr kb; |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5575 struct frame *f = check_x_frame (frame); |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5576 Display *dpy = FRAME_X_DISPLAY (f); |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5577 Lisp_Object have_keys; |
34911
4cdfcac861d7
(Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents:
34895
diff
changeset
|
5578 int major, minor, op, event, error; |
34549
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5579 |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5580 BLOCK_INPUT; |
34911
4cdfcac861d7
(Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents:
34895
diff
changeset
|
5581 |
4cdfcac861d7
(Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents:
34895
diff
changeset
|
5582 /* Check library version in case we're dynamically linked. */ |
4cdfcac861d7
(Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents:
34895
diff
changeset
|
5583 major = XkbMajorVersion; |
4cdfcac861d7
(Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents:
34895
diff
changeset
|
5584 minor = XkbMinorVersion; |
4cdfcac861d7
(Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents:
34895
diff
changeset
|
5585 if (!XkbLibraryVersion (&major, &minor)) |
35191
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5586 { |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5587 UNBLOCK_INPUT; |
67654
f6416d33b0a2
(Fx_backspace_delete_keys_p): In case we cannot determine
Dan Nicolaescu <dann@ics.uci.edu>
parents:
67581
diff
changeset
|
5588 return Qlambda; |
35191
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5589 } |
34911
4cdfcac861d7
(Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents:
34895
diff
changeset
|
5590 |
4cdfcac861d7
(Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents:
34895
diff
changeset
|
5591 /* Check that the server supports XKB. */ |
4cdfcac861d7
(Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents:
34895
diff
changeset
|
5592 major = XkbMajorVersion; |
4cdfcac861d7
(Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents:
34895
diff
changeset
|
5593 minor = XkbMinorVersion; |
4cdfcac861d7
(Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents:
34895
diff
changeset
|
5594 if (!XkbQueryExtension (dpy, &op, &event, &error, &major, &minor)) |
35191
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5595 { |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5596 UNBLOCK_INPUT; |
67654
f6416d33b0a2
(Fx_backspace_delete_keys_p): In case we cannot determine
Dan Nicolaescu <dann@ics.uci.edu>
parents:
67581
diff
changeset
|
5597 return Qlambda; |
35191
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5598 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5599 |
59974
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5600 /* In this code we check that the keyboard has physical keys with names |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5601 that start with BKSP (Backspace) and DELE (Delete), and that they |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5602 generate keysym XK_BackSpace and XK_Delete respectively. |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5603 This function is used to test if normal-erase-is-backspace should be |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5604 turned on. |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5605 An alternative approach would be to just check if XK_BackSpace and |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5606 XK_Delete are mapped to any key. But if any of those are mapped to |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5607 some non-intuitive key combination (Meta-Shift-Ctrl-whatever) and the |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5608 user doesn't know about it, it is better to return false here. |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5609 It is more obvious to the user what to do if she/he has two keys |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5610 clearly marked with names/symbols and one key does something not |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5611 expected (i.e. she/he then tries the other). |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5612 The cases where Backspace/Delete is mapped to some other key combination |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5613 are rare, and in those cases, normal-erase-is-backspace can be turned on |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5614 manually. */ |
bb6a99f86b5d
* xfns.c (Fx_backspace_delete_keys_p): Added comment about the
Jan Djärv <jan.h.d@swipnet.se>
parents:
59905
diff
changeset
|
5615 |
34911
4cdfcac861d7
(Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents:
34895
diff
changeset
|
5616 have_keys = Qnil; |
35191
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5617 kb = XkbGetMap (dpy, XkbAllMapComponentsMask, XkbUseCoreKbd); |
34549
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5618 if (kb) |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5619 { |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5620 int delete_keycode = 0, backspace_keycode = 0, i; |
35191
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5621 |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5622 if (XkbGetNames (dpy, XkbAllNamesMask, kb) == Success) |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5623 { |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5624 for (i = kb->min_key_code; |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5625 (i < kb->max_key_code |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5626 && (delete_keycode == 0 || backspace_keycode == 0)); |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5627 ++i) |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5628 { |
38574
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5629 /* The XKB symbolic key names can be seen most easily in |
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5630 the PS file generated by `xkbprint -label name |
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5631 $DISPLAY'. */ |
35191
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5632 if (bcmp ("DELE", kb->names->keys[i].name, 4) == 0) |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5633 delete_keycode = i; |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5634 else if (bcmp ("BKSP", kb->names->keys[i].name, 4) == 0) |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5635 backspace_keycode = i; |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5636 } |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5637 |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5638 XkbFreeNames (kb, 0, True); |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5639 } |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5640 |
3de883052d49
(Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents:
35146
diff
changeset
|
5641 XkbFreeClientMap (kb, 0, True); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5642 |
34549
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5643 if (delete_keycode |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5644 && backspace_keycode |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5645 && XKeysymToKeycode (dpy, XK_Delete) == delete_keycode |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5646 && XKeysymToKeycode (dpy, XK_BackSpace) == backspace_keycode) |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5647 have_keys = Qt; |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5648 } |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5649 UNBLOCK_INPUT; |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5650 return have_keys; |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5651 #else /* not HAVE_XKBGETKEYBOARD */ |
67654
f6416d33b0a2
(Fx_backspace_delete_keys_p): In case we cannot determine
Dan Nicolaescu <dann@ics.uci.edu>
parents:
67581
diff
changeset
|
5652 return Qlambda; |
34549
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5653 #endif /* not HAVE_XKBGETKEYBOARD */ |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5654 } |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5655 |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5656 |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5657 |
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5658 /*********************************************************************** |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5659 Initialization |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5660 ***********************************************************************/ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5661 |
51175 | 5662 /* Keep this list in the same order as frame_parms in frame.c. |
50370
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5663 Use 0 for unsupported frame parameters. */ |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5664 |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5665 frame_parm_handler x_frame_parm_handlers[] = |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5666 { |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5667 x_set_autoraise, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5668 x_set_autolower, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5669 x_set_background_color, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5670 x_set_border_color, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5671 x_set_border_width, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5672 x_set_cursor_color, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5673 x_set_cursor_type, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5674 x_set_font, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5675 x_set_foreground_color, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5676 x_set_icon_name, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5677 x_set_icon_type, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5678 x_set_internal_border_width, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5679 x_set_menu_bar_lines, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5680 x_set_mouse_color, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5681 x_explicitly_set_name, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5682 x_set_scroll_bar_width, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5683 x_set_title, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5684 x_set_unsplittable, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5685 x_set_vertical_scroll_bars, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5686 x_set_visibility, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5687 x_set_tool_bar_lines, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5688 x_set_scroll_bar_foreground, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5689 x_set_scroll_bar_background, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5690 x_set_screen_gamma, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5691 x_set_line_spacing, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5692 x_set_fringe_width, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5693 x_set_fringe_width, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5694 x_set_wait_for_wm, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5695 x_set_fullscreen, |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5696 }; |
0c01548d7ed3
The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents:
50236
diff
changeset
|
5697 |
21846 | 5698 void |
389 | 5699 syms_of_xfns () |
5700 { | |
5701 /* 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
|
5702 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
|
5703 |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5704 /* 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
|
5705 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
|
5706 /*&&& init symbols here &&&*/ |
1874
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
5707 Qnone = intern ("none"); |
19cf50641d6c
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
5708 staticpro (&Qnone); |
2328
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
5709 Qsuppress_icon = intern ("suppress-icon"); |
82e4fed9cdd6
* xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents:
2295
diff
changeset
|
5710 staticpro (&Qsuppress_icon); |
389 | 5711 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
|
5712 staticpro (&Qundefined_color); |
30351
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
5713 Qcompound_text = intern ("compound-text"); |
a67fcab978bb
(x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents:
30224
diff
changeset
|
5714 staticpro (&Qcompound_text); |
35402
302fbe91e359
(Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
35360
diff
changeset
|
5715 Qcancel_timer = intern ("cancel-timer"); |
302fbe91e359
(Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
35360
diff
changeset
|
5716 staticpro (&Qcancel_timer); |
974
4f88a1b78a46
* xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents:
833
diff
changeset
|
5717 /* 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
|
5718 |
26876 | 5719 /* Text property `display' should be nonsticky by default. */ |
5720 Vtext_property_default_nonsticky | |
5721 = Fcons (Fcons (Qdisplay, Qt), Vtext_property_default_nonsticky); | |
5722 | |
5723 | |
389 | 5724 Fput (Qundefined_color, Qerror_conditions, |
5725 Fcons (Qundefined_color, Fcons (Qerror, Qnil))); | |
5726 Fput (Qundefined_color, Qerror_message, | |
5727 build_string ("Undefined color")); | |
5728 | |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5729 DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape, |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5730 doc: /* The shape of the pointer when over text. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5731 Changing the value does not affect existing frames |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5732 unless you set the mouse color. */); |
389 | 5733 Vx_pointer_shape = Qnil; |
5734 | |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5735 #if 0 /* This doesn't really do anything. */ |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5736 DEFVAR_LISP ("x-nontext-pointer-shape", &Vx_nontext_pointer_shape, |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5737 doc: /* The shape of the pointer when not over text. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5738 This variable takes effect when you create a new frame |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5739 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
|
5740 #endif |
389 | 5741 Vx_nontext_pointer_shape = Qnil; |
5742 | |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5743 DEFVAR_LISP ("x-hourglass-pointer-shape", &Vx_hourglass_pointer_shape, |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5744 doc: /* The shape of the pointer when Emacs is busy. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5745 This variable takes effect when you create a new frame |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5746 or when you set the mouse color. */); |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
5747 Vx_hourglass_pointer_shape = Qnil; |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
5748 |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5749 DEFVAR_BOOL ("display-hourglass", &display_hourglass_p, |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5750 doc: /* Non-zero means Emacs displays an hourglass pointer on window systems. */); |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
5751 display_hourglass_p = 1; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5752 |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5753 DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay, |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5754 doc: /* *Seconds to wait before displaying an hourglass pointer. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5755 Value must be an integer or float. */); |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
5756 Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY); |
27864
ea05cbe65943
(inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents:
27798
diff
changeset
|
5757 |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5758 #if 0 /* This doesn't really do anything. */ |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5759 DEFVAR_LISP ("x-mode-pointer-shape", &Vx_mode_pointer_shape, |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5760 doc: /* The shape of the pointer when over the mode line. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5761 This variable takes effect when you create a new frame |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5762 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
|
5763 #endif |
389 | 5764 Vx_mode_pointer_shape = Qnil; |
5765 | |
16396
4e4cc27b2a2a
(x_set_internal_border_width): Only change
Richard M. Stallman <rms@gnu.org>
parents:
16357
diff
changeset
|
5766 DEFVAR_LISP ("x-sensitive-text-pointer-shape", |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5767 &Vx_sensitive_text_pointer_shape, |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5768 doc: /* The shape of the pointer when over mouse-sensitive text. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5769 This variable takes effect when you create a new frame |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5770 or when you set the mouse color. */); |
7683
be3423efbdce
(Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents:
7599
diff
changeset
|
5771 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
|
5772 |
33960
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
5773 DEFVAR_LISP ("x-window-horizontal-drag-cursor", |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5774 &Vx_window_horizontal_drag_shape, |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5775 doc: /* Pointer shape to use for indicating a window can be dragged horizontally. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5776 This variable takes effect when you create a new frame |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5777 or when you set the mouse color. */); |
33960
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
5778 Vx_window_horizontal_drag_shape = Qnil; |
1f92a2d65681
(Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
33747
diff
changeset
|
5779 |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5780 DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel, |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5781 doc: /* A string indicating the foreground color of the cursor box. */); |
389 | 5782 Vx_cursor_fore_pixel = Qnil; |
5783 | |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5784 DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size, |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5785 doc: /* Maximum size for tooltips. Value is a pair (COLUMNS . ROWS). |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5786 Text larger than this is clipped. */); |
38574
79a0d7b341b3
(Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
38548
diff
changeset
|
5787 Vx_max_tooltip_size = Fcons (make_number (80), make_number (40)); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5788 |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5789 DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5790 doc: /* Non-nil if no X window manager is in use. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5791 Emacs doesn't try to figure this out; this is always nil |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5792 unless you set it to something else. */); |
12209
5537ed125771
(syms_of_xfns): Initialize Vx_no_window_manager. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
12190
diff
changeset
|
5793 /* 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
|
5794 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
|
5795 Vx_no_window_manager = Qnil; |
8170
d92a24366b22
(x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
8103
diff
changeset
|
5796 |
17048
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
5797 DEFVAR_LISP ("x-pixel-size-width-font-regexp", |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5798 &Vx_pixel_size_width_font_regexp, |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5799 doc: /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'. |
39905
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5800 |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5801 Since Emacs gets width of a font matching with this regexp from |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5802 PIXEL_SIZE field of the name, font finding mechanism gets faster for |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5803 such a font. This is especially effective for such large fonts as |
542a86892257
Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents:
39862
diff
changeset
|
5804 Chinese, Japanese, and Korean. */); |
17048
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
5805 Vx_pixel_size_width_font_regexp = Qnil; |
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
5806 |
58463
86fddd350b35
* gtkutil.c (xg_get_file_name): Rename use-old-gtk-file-dialog to
Jan Djärv <jan.h.d@swipnet.se>
parents:
58283
diff
changeset
|
5807 /* This is not ifdef:ed, so other builds than GTK can customize it. */ |
72964
4e1cc9325b0e
* xfns.c (syms_of_xfns): Rename x-use-old-gtk-file-dialog
Jan Djärv <jan.h.d@swipnet.se>
parents:
72932
diff
changeset
|
5808 DEFVAR_BOOL ("x-gtk-use-old-file-dialog", &x_gtk_use_old_file_dialog, |
58463
86fddd350b35
* gtkutil.c (xg_get_file_name): Rename use-old-gtk-file-dialog to
Jan Djärv <jan.h.d@swipnet.se>
parents:
58283
diff
changeset
|
5809 doc: /* *Non-nil means prompt with the old GTK file selection dialog. |
86fddd350b35
* gtkutil.c (xg_get_file_name): Rename use-old-gtk-file-dialog to
Jan Djärv <jan.h.d@swipnet.se>
parents:
58283
diff
changeset
|
5810 If nil or if the file selection dialog is not available, the new GTK file |
86fddd350b35
* gtkutil.c (xg_get_file_name): Rename use-old-gtk-file-dialog to
Jan Djärv <jan.h.d@swipnet.se>
parents:
58283
diff
changeset
|
5811 chooser is used instead. To turn off all file dialogs set the |
86fddd350b35
* gtkutil.c (xg_get_file_name): Rename use-old-gtk-file-dialog to
Jan Djärv <jan.h.d@swipnet.se>
parents:
58283
diff
changeset
|
5812 variable `use-file-dialog'. */); |
72964
4e1cc9325b0e
* xfns.c (syms_of_xfns): Rename x-use-old-gtk-file-dialog
Jan Djärv <jan.h.d@swipnet.se>
parents:
72932
diff
changeset
|
5813 x_gtk_use_old_file_dialog = 0; |
58463
86fddd350b35
* gtkutil.c (xg_get_file_name): Rename use-old-gtk-file-dialog to
Jan Djärv <jan.h.d@swipnet.se>
parents:
58283
diff
changeset
|
5814 |
67842
095b05723996
* xfns.c: x_show_hidden_files, new variable.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67761
diff
changeset
|
5815 DEFVAR_BOOL ("x-gtk-show-hidden-files", &x_gtk_show_hidden_files, |
095b05723996
* xfns.c: x_show_hidden_files, new variable.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67761
diff
changeset
|
5816 doc: /* *If non-nil, the GTK file chooser will by default show hidden files. |
095b05723996
* xfns.c: x_show_hidden_files, new variable.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67761
diff
changeset
|
5817 Note that this is just the default, there is a toggle button on the file |
095b05723996
* xfns.c: x_show_hidden_files, new variable.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67761
diff
changeset
|
5818 chooser to show or not show hidden files on a case by case basis. */); |
095b05723996
* xfns.c: x_show_hidden_files, new variable.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67761
diff
changeset
|
5819 x_gtk_show_hidden_files = 0; |
095b05723996
* xfns.c: x_show_hidden_files, new variable.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67761
diff
changeset
|
5820 |
72969
f8188a2ff5f6
* xfns.c (syms_of_xfns): Rename x_gtk_show_chooser_help_text to
Jan Djärv <jan.h.d@swipnet.se>
parents:
72964
diff
changeset
|
5821 DEFVAR_BOOL ("x-gtk-file-dialog-help-text", &x_gtk_file_dialog_help_text, |
73045
cec998346c98
* xfns.c (syms_of_xfns): Fix typo in help text for
Jan Djärv <jan.h.d@swipnet.se>
parents:
72969
diff
changeset
|
5822 doc: /* *If non-nil, the GTK file chooser will show additional help text. |
72932
eea4777d0d23
* xfns.c (syms_of_xfns): New variable: x-gtk-show-chooser-help-text.
Jan Djärv <jan.h.d@swipnet.se>
parents:
72777
diff
changeset
|
5823 If more space for files in the file chooser dialog is wanted, set this to nil |
eea4777d0d23
* xfns.c (syms_of_xfns): New variable: x-gtk-show-chooser-help-text.
Jan Djärv <jan.h.d@swipnet.se>
parents:
72777
diff
changeset
|
5824 to turn the additional text off. */); |
72969
f8188a2ff5f6
* xfns.c (syms_of_xfns): Rename x_gtk_show_chooser_help_text to
Jan Djärv <jan.h.d@swipnet.se>
parents:
72964
diff
changeset
|
5825 x_gtk_file_dialog_help_text = 1; |
72932
eea4777d0d23
* xfns.c (syms_of_xfns): New variable: x-gtk-show-chooser-help-text.
Jan Djärv <jan.h.d@swipnet.se>
parents:
72777
diff
changeset
|
5826 |
68880
f5fa98f7c3b7
* xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar.
Jan Djärv <jan.h.d@swipnet.se>
parents:
68651
diff
changeset
|
5827 DEFVAR_BOOL ("x-gtk-whole-detached-tool-bar", &x_gtk_whole_detached_tool_bar, |
f5fa98f7c3b7
* xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar.
Jan Djärv <jan.h.d@swipnet.se>
parents:
68651
diff
changeset
|
5828 doc: /* *If non-nil, a detached tool bar is shown in full. |
f5fa98f7c3b7
* xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar.
Jan Djärv <jan.h.d@swipnet.se>
parents:
68651
diff
changeset
|
5829 The default is to just show an arrow and pressing on that arrow shows |
f5fa98f7c3b7
* xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar.
Jan Djärv <jan.h.d@swipnet.se>
parents:
68651
diff
changeset
|
5830 the tool bar buttons. */); |
f5fa98f7c3b7
* xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar.
Jan Djärv <jan.h.d@swipnet.se>
parents:
68651
diff
changeset
|
5831 x_gtk_whole_detached_tool_bar = 0; |
f5fa98f7c3b7
* xfns.c (syms_of_xfns): New variable: x-gtk-whole-detached-tool-bar.
Jan Djärv <jan.h.d@swipnet.se>
parents:
68651
diff
changeset
|
5832 |
66502
dd57bcb034c0
(syms_of_xfns): Provide `x' as feature.
Richard M. Stallman <rms@gnu.org>
parents:
65936
diff
changeset
|
5833 Fprovide (intern ("x"), Qnil); |
dd57bcb034c0
(syms_of_xfns): Provide `x' as feature.
Richard M. Stallman <rms@gnu.org>
parents:
65936
diff
changeset
|
5834 |
8170
d92a24366b22
(x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
8103
diff
changeset
|
5835 #ifdef USE_X_TOOLKIT |
39862
da336e9d1ab5
(syms_of_xfns): Update calls to Fprovide.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39812
diff
changeset
|
5836 Fprovide (intern ("x-toolkit"), Qnil); |
12094
a9fda5417acf
(syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents:
12080
diff
changeset
|
5837 #ifdef USE_MOTIF |
39862
da336e9d1ab5
(syms_of_xfns): Update calls to Fprovide.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39812
diff
changeset
|
5838 Fprovide (intern ("motif"), Qnil); |
37210
8b47704e0150
(Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37173
diff
changeset
|
5839 |
39988
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5840 DEFVAR_LISP ("motif-version-string", &Vmotif_version_string, |
eac4e9ae201c
Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents:
39907
diff
changeset
|
5841 doc: /* Version info for LessTif/Motif. */); |
37210
8b47704e0150
(Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37173
diff
changeset
|
5842 Vmotif_version_string = build_string (XmVERSION_STRING); |
8b47704e0150
(Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37173
diff
changeset
|
5843 #endif /* USE_MOTIF */ |
8b47704e0150
(Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
37173
diff
changeset
|
5844 #endif /* USE_X_TOOLKIT */ |
389 | 5845 |
52334
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
5846 #ifdef USE_GTK |
55546
4e3b166f7f72
* xfns.c (syms_of_xfns): Provide x-toolkit also for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
55492
diff
changeset
|
5847 /* Provide x-toolkit also for GTK. Internally GTK does not use Xt so it |
4e3b166f7f72
* xfns.c (syms_of_xfns): Provide x-toolkit also for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
55492
diff
changeset
|
5848 is not an X toolkit in that sense (USE_X_TOOLKIT is not defined). |
4e3b166f7f72
* xfns.c (syms_of_xfns): Provide x-toolkit also for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
55492
diff
changeset
|
5849 But for a user it is a toolkit for X, and indeed, configure |
4e3b166f7f72
* xfns.c (syms_of_xfns): Provide x-toolkit also for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
55492
diff
changeset
|
5850 accepts --with-x-toolkit=gtk. */ |
4e3b166f7f72
* xfns.c (syms_of_xfns): Provide x-toolkit also for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents:
55492
diff
changeset
|
5851 Fprovide (intern ("x-toolkit"), Qnil); |
52334
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
5852 Fprovide (intern ("gtk"), Qnil); |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
5853 |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
5854 DEFVAR_LISP ("gtk-version-string", &Vgtk_version_string, |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
5855 doc: /* Version info for GTK+. */); |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
5856 { |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
5857 char gtk_version[40]; |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
5858 g_snprintf (gtk_version, sizeof (gtk_version), "%u.%u.%u", |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
5859 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
5860 Vgtk_version_string = build_string (gtk_version); |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
5861 } |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
5862 #endif /* USE_GTK */ |
a721547105d6
(Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents:
52298
diff
changeset
|
5863 |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5864 /* X window properties. */ |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5865 defsubr (&Sx_change_window_property); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5866 defsubr (&Sx_delete_window_property); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5867 defsubr (&Sx_window_property); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5868 |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26571
diff
changeset
|
5869 defsubr (&Sxw_display_color_p); |
8779
12c6296bbb4b
(Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8758
diff
changeset
|
5870 defsubr (&Sx_display_grayscale_p); |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26571
diff
changeset
|
5871 defsubr (&Sxw_color_defined_p); |
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26571
diff
changeset
|
5872 defsubr (&Sxw_color_values); |
4279 | 5873 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
|
5874 defsubr (&Sx_server_vendor); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5875 defsubr (&Sx_server_version); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5876 defsubr (&Sx_display_pixel_width); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5877 defsubr (&Sx_display_pixel_height); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5878 defsubr (&Sx_display_mm_width); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5879 defsubr (&Sx_display_mm_height); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5880 defsubr (&Sx_display_screens); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5881 defsubr (&Sx_display_planes); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5882 defsubr (&Sx_display_color_cells); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5883 defsubr (&Sx_display_visual_class); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5884 defsubr (&Sx_display_backing_store); |
68328c3af38f
(x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents:
2197
diff
changeset
|
5885 defsubr (&Sx_display_save_under); |
771 | 5886 defsubr (&Sx_create_frame); |
389 | 5887 defsubr (&Sx_open_connection); |
9690
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
5888 defsubr (&Sx_close_connection); |
f6d4e1acb5a1
(Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents:
9653
diff
changeset
|
5889 defsubr (&Sx_display_list); |
389 | 5890 defsubr (&Sx_synchronize); |
28044
88db4c84b6fd
Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents:
28010
diff
changeset
|
5891 defsubr (&Sx_focus_frame); |
34549
708ea44ef3c0
(Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
34524
diff
changeset
|
5892 defsubr (&Sx_backspace_delete_keys_p); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5893 |
17048
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
5894 /* Setting callback functions for fontset handler. */ |
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
5895 get_font_info_func = x_get_font_info; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5896 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5897 #if 0 /* This function pointer doesn't seem to be used anywhere. |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5898 And the pointer assigned has the wrong type, anyway. */ |
17048
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
5899 list_fonts_func = x_list_fonts; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5900 #endif |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49473
diff
changeset
|
5901 |
17048
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
5902 load_font_func = x_load_font; |
21549
3b63301ea296
(syms_of_xfns): Initialize find_ccl_program_func.
Kenichi Handa <handa@m17n.org>
parents:
21536
diff
changeset
|
5903 find_ccl_program_func = x_find_ccl_program; |
17048
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
5904 query_font_func = x_query_font; |
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
5905 set_frame_fontset_func = x_set_font; |
2da4e24ceee5
Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents:
16966
diff
changeset
|
5906 check_window_system_func = check_x; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5907 |
36252
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
5908 hourglass_atimer = NULL; |
a8630c63f7d5
Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents:
35859
diff
changeset
|
5909 hourglass_shown_p = 0; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5910 |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5911 defsubr (&Sx_show_tip); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5912 defsubr (&Sx_hide_tip); |
34450
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
5913 tip_timer = Qnil; |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5914 staticpro (&tip_timer); |
34450
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
5915 tip_frame = Qnil; |
5de00bff5de3
(Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents:
34321
diff
changeset
|
5916 staticpro (&tip_frame); |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5917 |
35067
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5918 last_show_tip_args = Qnil; |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5919 staticpro (&last_show_tip_args); |
7ca0048f8615
(x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents:
35042
diff
changeset
|
5920 |
67761
5b8799d65159
* xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents:
67654
diff
changeset
|
5921 defsubr (&Sx_uses_old_gtk_dialog); |
57432
d95ac5c74632
* xfns.c (syms_of_xfns): defsubr x-file-dialog for GTK also.
Jan Djärv <jan.h.d@swipnet.se>
parents:
56879
diff
changeset
|
5922 #if defined (USE_MOTIF) || defined (USE_GTK) |
24994
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5923 defsubr (&Sx_file_dialog); |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5924 #endif |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5925 } |
d549b7ac676d
(x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents:
24905
diff
changeset
|
5926 |
389 | 5927 #endif /* HAVE_X_WINDOWS */ |
52401 | 5928 |
5929 /* arch-tag: 55040d02-5485-4d58-8b22-95a7a05f3288 | |
5930 (do not change this comment) */ |