annotate src/xfns.c @ 109555:05e7e7c46ff0

Use const, move declarations to header files. * src/buffer.c (Fset_buffer_multibyte): Remove local extern declaration. * src/character.c (strwidth, parse_str_to_multibyte): Add const. * src/character.h (strwidth, parse_str_to_multibyte): Likewise. * src/charset.c (add_to_log): Remove declaration. * src/composite.c (syms_of_composite): Remove local extern declarations. * src/data.c (Finteractive_form): Use const. * src/dired.c (scmp): Add const. (directory_files_internal): Remove local extern declaration. * src/dispextern.h (add_to_log): Remove declaration. (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg) (x_frame_get_and_record_arg, x_default_parameter): Add const. * src/dispnew.c: Remove duplicate #include <unistd.h>. (update_window, update_frame_1, init_display): Remove local extern declarations. * src/editfns.c (region_limit, syms_of_editfns): Remove local extern declarations. * src/emacs.c (main): Remove local extern declaration. * src/font.c (Qnormal, QCtype, QCfamily, QCweight, QCslant, QCwidth) (QCheight, QCsize, QCname): Remove declarations. * src/frame.c (x_get_resource_string, x_get_string_resource) (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg) (x_default_parameter): Use const. * src/image.c (QCwidth, QCheight, QCforeground, QCbackground, QCfile) (QCdata, QCtype, Qcenter): Remove declarations. * src/keyboard.h (do_mouse_tracking): Add declaration. * src/minibuf.c (Qmouse_face): Remove declaration. * src/msdos.c (IT_note_mouse_highlight): Remove local extern declaration. * src/xdisp.c (do_mouse_tracking): Remove declaration. (add_to_log): Use const. * src/xfaces.c (Qmouse_face): Remove declaration. (face_color_gray_p, tty_defined_color, defined_color) (face_color_gray_p, face_color_supported_p). Add const. * src/xfns.c: Include xlwmenu.h when USE_LUCID. (x_defined_color, xic_set_xfontset): Use const. (Fx_hide_tip): Remove local extern declaration. * src/xselect.c (selection_data_to_lisp_data) (x_property_data_to_lisp): * src/xrdb.c (x_get_string_resource, file_p) (x_get_customization_string, magic_file_p, search_magic_path) (get_system_app, get_user_app, x_load_resources, x_get_resource) (x_get_string_resource): Use const. * src/xterm.c (xlwmenu_window_p, xlwmenu_redisplay): Remove declarations. (x_text_icon, x_check_errors, x_connection_closed): Use const. * src/xterm.h (x_get_customization_string, x_load_resources) (x_get_resource, x_text_icon, x_text_icon, x_check_errors) (x_check_errors, x_property_data_to_lisp, defined_color) (xic_set_xfontset, x_defined_color): Use const.
author Dan Nicolaescu <dann@ics.uci.edu>
date Mon, 26 Jul 2010 20:52:35 -0700
parents 051595eb9b58
children 228a5fa4eda0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
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,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 106788
diff changeset
3 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
79759
fc2bcd2a8aad Add 2008 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 79392
diff changeset
4 Free Software Foundation, Inc.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 This file is part of GNU Emacs.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7
94963
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94939
diff changeset
8 GNU Emacs is free software: you can redistribute it and/or modify
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 it under the terms of the GNU General Public License as published by
94963
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94939
diff changeset
10 the Free Software Foundation, either version 3 of the License, or
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94939
diff changeset
11 (at your option) any later version.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 GNU Emacs is distributed in the hope that it will be useful,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 GNU General Public License for more details.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
94963
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94939
diff changeset
19 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20
26088
b7aa6ac26872 Add support for large files, 64-bit Solaris, system locale codings.
Paul Eggert <eggert@twinsun.com>
parents: 26032
diff changeset
21 #include <config.h>
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
22 #include <stdio.h>
25528
b5dd1bafd001 Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents: 25511
diff changeset
23 #include <math.h>
105669
68dd71358159 * alloc.c: Do not define struct catchtag.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105426
diff changeset
24 #include <setjmp.h>
106201
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
25 #include <ctype.h>
7899
facf6b0e97ff Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 7860
diff changeset
26
40700
6f6287da52d1 Include unistd.h, if it exists.
Richard M. Stallman <rms@gnu.org>
parents: 40656
diff changeset
27 #ifdef HAVE_UNISTD_H
6f6287da52d1 Include unistd.h, if it exists.
Richard M. Stallman <rms@gnu.org>
parents: 40656
diff changeset
28 #include <unistd.h>
6f6287da52d1 Include unistd.h, if it exists.
Richard M. Stallman <rms@gnu.org>
parents: 40656
diff changeset
29 #endif
6f6287da52d1 Include unistd.h, if it exists.
Richard M. Stallman <rms@gnu.org>
parents: 40656
diff changeset
30
8091
f40cbe50c74f (XLIB_ILLEGAL_ACCESS): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 8090
diff changeset
31 /* 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
32
8091
f40cbe50c74f (XLIB_ILLEGAL_ACCESS): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 8090
diff changeset
33 #define XLIB_ILLEGAL_ACCESS
f40cbe50c74f (XLIB_ILLEGAL_ACCESS): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 8090
diff changeset
34
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35 #include "lisp.h"
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 #include "xterm.h"
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
37 #include "frame.h"
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 #include "window.h"
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 #include "buffer.h"
26876
578acd06aa3b Include intervals.h.
Kenichi Handa <handa@m17n.org>
parents: 26808
diff changeset
40 #include "intervals.h"
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 #include "dispextern.h"
515
0005d4c90c97 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
42 #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
43 #include "blockinput.h"
24412
d11ac02f9d6a Use epaths.h istead of paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 24170
diff changeset
44 #include <epaths.h>
88395
e69e2f450430 Include "character.h".
Kenichi Handa <handa@m17n.org>
parents: 43452
diff changeset
45 #include "character.h"
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
46 #include "charset.h"
30351
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
47 #include "coding.h"
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
48 #include "fontset.h"
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
49 #include "systime.h"
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
50 #include "termhooks.h"
27864
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
51 #include "atimer.h"
53226
dd3018b4785b Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents: 53069
diff changeset
52 #include "termchar.h"
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
53 #include "font.h"
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
54
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 #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
56
786ab5197e4b Include <stdlib.h> if available, and declare abort only if not. Include
Andreas Schwab <schwab@suse.de>
parents: 25390
diff changeset
57 #include <ctype.h>
27069
b2934c683b5e (gif_load): Avoid sign extension and thus out of bounds
Gerd Moellmann <gerd@gnu.org>
parents: 27066
diff changeset
58 #include <sys/types.h>
b2934c683b5e (gif_load): Avoid sign extension and thus out of bounds
Gerd Moellmann <gerd@gnu.org>
parents: 27066
diff changeset
59 #include <sys/stat.h>
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60
3821
8f353c2491d0 * xfns.c: Always #include "bitmaps/gray.xbm"; the bitmaps seem to
Jim Blandy <jimb@redhat.com>
parents: 3692
diff changeset
61 #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
62 #include "bitmaps/gray.xbm"
2657b04dd324 [EMACS_BIT_MAPS]: Include gray.xbm from ./bitmaps.
Richard M. Stallman <rms@gnu.org>
parents: 3507
diff changeset
63 #else
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
64 #include <X11/bitmaps/gray>
3512
2657b04dd324 [EMACS_BIT_MAPS]: Include gray.xbm from ./bitmaps.
Richard M. Stallman <rms@gnu.org>
parents: 3507
diff changeset
65 #endif
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
66
106098
8c46fe65b4c6 * lisp.h: Remove declaration of Ffont_get_system_font.
Andreas Schwab <schwab@linux-m68k.org>
parents: 106096
diff changeset
67 #include "xsettings.h"
8c46fe65b4c6 * lisp.h: Remove declaration of Ffont_get_system_font.
Andreas Schwab <schwab@linux-m68k.org>
parents: 106096
diff changeset
68
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
69 #ifdef USE_GTK
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
70 #include "gtkutil.h"
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
71 #endif
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
72
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
73 #ifdef USE_X_TOOLKIT
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
74 #include <X11/Shell.h>
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
75
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
76 #ifndef USE_MOTIF
81374
c567f60cd935 Link to xaw3d if available.
Chong Yidong <cyd@stupidchicken.com>
parents: 81291
diff changeset
77 #ifdef HAVE_XAW3D
c567f60cd935 Link to xaw3d if available.
Chong Yidong <cyd@stupidchicken.com>
parents: 81291
diff changeset
78 #include <X11/Xaw3d/Paned.h>
81375
7d290e488d73 Fix last fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 81374
diff changeset
79 #include <X11/Xaw3d/Label.h>
81374
c567f60cd935 Link to xaw3d if available.
Chong Yidong <cyd@stupidchicken.com>
parents: 81291
diff changeset
80 #else /* !HAVE_XAW3D */
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
81 #include <X11/Xaw/Paned.h>
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
82 #include <X11/Xaw/Label.h>
81374
c567f60cd935 Link to xaw3d if available.
Chong Yidong <cyd@stupidchicken.com>
parents: 81291
diff changeset
83 #endif /* HAVE_XAW3D */
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
84 #endif /* USE_MOTIF */
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
85
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
86 #ifdef USG
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
87 #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
88 #include <X11/Xos.h>
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
89 #define USG
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
90 #else
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
91 #include <X11/Xos.h>
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
92 #endif
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
93
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
94 #include "widget.h"
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
95
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
96 #include "../lwlib/lwlib.h"
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
97
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
98 #ifdef USE_MOTIF
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
99 #include <Xm/Xm.h>
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
100 #include <Xm/DialogS.h>
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
101 #include <Xm/FileSB.h>
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
102 #endif
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
103
109555
05e7e7c46ff0 Use const, move declarations to header files.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109445
diff changeset
104 #ifdef USE_LUCID
05e7e7c46ff0 Use const, move declarations to header files.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109445
diff changeset
105 #include "../lwlib/xlwmenu.h"
05e7e7c46ff0 Use const, move declarations to header files.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109445
diff changeset
106 #endif
05e7e7c46ff0 Use const, move declarations to header files.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109445
diff changeset
107
105671
f4161811f50e * xterm.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105669
diff changeset
108 #if !defined(NO_EDITRES)
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
109 #define HACK_EDITRES
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
110 extern void _XEditResCheckMessages ();
105671
f4161811f50e * xterm.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105669
diff changeset
111 #endif /* not defined NO_EDITRES */
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
112
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
113 /* 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
114
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
115 extern LWLIB_ID widget_id_tick;
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
116
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
117 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
118 extern double atof ();
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
119
37210
8b47704e0150 (Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37173
diff changeset
120 #ifdef USE_MOTIF
8b47704e0150 (Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37173
diff changeset
121
8b47704e0150 (Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37173
diff changeset
122 /* LessTif/Motif version info. */
8b47704e0150 (Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37173
diff changeset
123
8b47704e0150 (Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37173
diff changeset
124 static Lisp_Object Vmotif_version_string;
8b47704e0150 (Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37173
diff changeset
125
8b47704e0150 (Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37173
diff changeset
126 #endif /* USE_MOTIF */
8b47704e0150 (Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37173
diff changeset
127
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
128 #endif /* USE_X_TOOLKIT */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
129
52334
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
130 #ifdef USE_GTK
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
131
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
132 /* GTK+ version info */
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
133
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
134 static Lisp_Object Vgtk_version_string;
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
135
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
136 #endif /* USE_GTK */
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
137
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
138 #define MAXREQUEST(dpy) (XMaxRequestSize (dpy))
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
139
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
140 /* 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
141 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
142 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
143
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
144 int gray_bitmap_width = gray_width;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
145 int gray_bitmap_height = gray_height;
34512
d069886667e6 (gray_bitmap_bits): Declare `char *'.
Gerd Moellmann <gerd@gnu.org>
parents: 34476
diff changeset
146 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
147
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
148 /* 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
149
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
150 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
151
67842
095b05723996 * xfns.c: x_show_hidden_files, new variable.
Jan Djärv <jan.h.d@swipnet.se>
parents: 67761
diff changeset
152 /* 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
153
095b05723996 * xfns.c: x_show_hidden_files, new variable.
Jan Djärv <jan.h.d@swipnet.se>
parents: 67761
diff changeset
154 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
155
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
156 /* 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
157
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
158 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
159
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
160 /* 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
161
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
162 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
163
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164 /* 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
165 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
166
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
167 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
168 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
169
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
170 /* 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
171
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
172 Lisp_Object Vx_sensitive_text_pointer_shape;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
173
33960
1f92a2d65681 (Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 33747
diff changeset
174 /* 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
175 dragged horizontally. */
1f92a2d65681 (Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 33747
diff changeset
176
1f92a2d65681 (Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 33747
diff changeset
177 Lisp_Object Vx_window_horizontal_drag_shape;
1f92a2d65681 (Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 33747
diff changeset
178
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
179 /* 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
180
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
181 Lisp_Object Vx_cursor_fore_pixel;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
182
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
183 /* Nonzero if using X. */
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
184
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
185 static int x_in_use;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
186
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
187 /* 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
188
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
189 Lisp_Object Vx_no_window_manager;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
190
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
191 /* 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
192
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
193 Lisp_Object Vx_pixel_size_width_font_regexp;
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
194
1874
19cf50641d6c * frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
195 Lisp_Object Qnone;
2328
82e4fed9cdd6 * xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents: 2295
diff changeset
196 Lisp_Object Qsuppress_icon;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
197 Lisp_Object Qundefined_color;
35402
302fbe91e359 (Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 35360
diff changeset
198 Lisp_Object Qcompound_text, Qcancel_timer;
106201
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
199 Lisp_Object Qfont_param;
50370
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
200
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
201 /* In dispnew.c */
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
202
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
203 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
204
107779
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
205 /* In editfns.c */
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
206
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
207 extern Lisp_Object Vsystem_name;
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
208
9653
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
109058
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 109035
diff changeset
211 extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
109290
1b5ca039f5f2 Fix faulty `if' statement in delete_frame.
Chong Yidong <cyd@stupidchicken.com>
parents: 107526
diff changeset
212 extern Lisp_Object Qtooltip;
1b5ca039f5f2 Fix faulty `if' statement in delete_frame.
Chong Yidong <cyd@stupidchicken.com>
parents: 107526
diff changeset
213
34895
53e52b3525bf Use #if GLYPH_DEBUG instead of #ifdef GLYPH_DEBUG.
Gerd Moellmann <gerd@gnu.org>
parents: 34662
diff changeset
214 #if GLYPH_DEBUG
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
215 int image_cache_refcount, dpyinfo_refcount;
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
216 #endif
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
217
103840
a9bb4a9d0ebd xfns.c (Fx_select_font): Remember last font selected in
Jan Djärv <jan.h.d@swipnet.se>
parents: 103706
diff changeset
218 #if defined (USE_GTK) && defined (HAVE_FREETYPE)
a9bb4a9d0ebd xfns.c (Fx_select_font): Remember last font selected in
Jan Djärv <jan.h.d@swipnet.se>
parents: 103706
diff changeset
219 char *x_last_font_name;
a9bb4a9d0ebd xfns.c (Fx_select_font): Remember last font selected in
Jan Djärv <jan.h.d@swipnet.se>
parents: 103706
diff changeset
220 #endif
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
221
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
222
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
223 /* 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
224
5948
ef777779bd80 (check_x): Make it global.
Karl Heuer <kwzh@gnu.org>
parents: 5900
diff changeset
225 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
226 check_x (void)
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
227 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
228 if (! x_in_use)
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
229 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
230 }
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
231
13867
19a05b5a597d (check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents: 13781
diff changeset
232 /* 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
233 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
234
2b4e4a76468b (using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7683
diff changeset
235 int
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
236 have_menus_p (void)
7791
2b4e4a76468b (using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7683
diff changeset
237 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
238 return x_in_use;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
239 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
240
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
241 /* 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
242 and checking validity for X. */
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 FRAME_PTR
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
245 check_x_frame (Lisp_Object frame)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
246 {
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
247 FRAME_PTR f;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
248
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
249 if (NILP (frame))
25679
8b09c5927f1c (QCfile): Moved to xdisp.c.
Gerd Moellmann <gerd@gnu.org>
parents: 25646
diff changeset
250 frame = selected_frame;
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
251 CHECK_LIVE_FRAME (frame);
25679
8b09c5927f1c (QCfile): Moved to xdisp.c.
Gerd Moellmann <gerd@gnu.org>
parents: 25646
diff changeset
252 f = XFRAME (frame);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
253 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
254 error ("Non-X frame used");
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
255 return f;
7791
2b4e4a76468b (using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7683
diff changeset
256 }
2b4e4a76468b (using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7683
diff changeset
257
83342
9216636c02fc Rename `struct display' to `struct device'. Update function, parameter and variable names accordingly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83332
diff changeset
258 /* Let the user specify an X display with a Lisp object.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
259 OBJECT may be nil, a frame or a terminal object.
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
260 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
261 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
262
50370
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
263 struct x_display_info *
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
264 check_x_display_info (Lisp_Object object)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
265 {
31543
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
266 struct x_display_info *dpyinfo = NULL;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
267
83342
9216636c02fc Rename `struct display' to `struct device'. Update function, parameter and variable names accordingly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83332
diff changeset
268 if (NILP (object))
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
269 {
25679
8b09c5927f1c (QCfile): Moved to xdisp.c.
Gerd Moellmann <gerd@gnu.org>
parents: 25646
diff changeset
270 struct frame *sf = XFRAME (selected_frame);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
271
25679
8b09c5927f1c (QCfile): Moved to xdisp.c.
Gerd Moellmann <gerd@gnu.org>
parents: 25646
diff changeset
272 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
273 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
274 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
275 dpyinfo = x_display_list;
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 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
278 }
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
279 else if (TERMINALP (object))
83167
69ebc75cb461 Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents: 83123
diff changeset
280 {
83760
aa5347e75afa (check_x_display_info): Yet Another Int/Lisp_Object Mixup.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83648
diff changeset
281 struct terminal *t = get_terminal (object, 1);
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
282
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
283 if (t->type != output_x_window)
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
284 error ("Terminal %d is not an X display", XINT (object));
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
285
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
286 dpyinfo = t->display_info.x;
83167
69ebc75cb461 Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents: 83123
diff changeset
287 }
83342
9216636c02fc Rename `struct display' to `struct device'. Update function, parameter and variable names accordingly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83332
diff changeset
288 else if (STRINGP (object))
9216636c02fc Rename `struct display' to `struct device'. Update function, parameter and variable names accordingly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83332
diff changeset
289 dpyinfo = x_display_info_for_name (object);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
290 else
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
291 {
83342
9216636c02fc Rename `struct display' to `struct device'. Update function, parameter and variable names accordingly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83332
diff changeset
292 FRAME_PTR f = check_x_frame (object);
31543
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
293 dpyinfo = FRAME_X_DISPLAY_INFO (f);
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
294 }
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
295
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
296 return dpyinfo;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
297 }
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
298
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
299
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
300 /* Return the Emacs frame-object corresponding to an X window.
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
301 It could be the frame's main window or an icon window. */
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
302
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
303 /* 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
304
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
305 struct frame *
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
306 x_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
307 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
308 Lisp_Object tail, frame;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
309 struct frame *f;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
310
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
311 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
312
90970
3371fc48749b Replace uses of GC_* macros with the non-GC_ versions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 90951
diff changeset
313 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
25646
9154af188477 Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents: 25628
diff changeset
314 {
9154af188477 Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents: 25628
diff changeset
315 frame = XCAR (tail);
90970
3371fc48749b Replace uses of GC_* macros with the non-GC_ versions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 90951
diff changeset
316 if (!FRAMEP (frame))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
317 continue;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
318 f = XFRAME (frame);
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26571
diff changeset
319 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
320 continue;
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
321 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
322 return f;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
323 #ifdef USE_X_TOOLKIT
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
324 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
325 && 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
326 /* A tooltip frame? */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
327 || (!f->output_data.x->edit_widget
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
328 && 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
329 || f->output_data.x->icon_desc == wdesc)
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
330 return f;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
331 #else /* not USE_X_TOOLKIT */
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
332 #ifdef USE_GTK
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
333 if (f->output_data.x->edit_widget)
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
334 {
53069
1218a42792ea Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents: 53027
diff changeset
335 GtkWidget *gwdesc = xg_win_to_widget (dpyinfo->display, wdesc);
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
336 struct x_output *x = f->output_data.x;
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
337 if (gwdesc != 0 && gwdesc == x->edit_widget)
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
338 return f;
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
339 }
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
340 #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
341 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
342 || f->output_data.x->icon_desc == wdesc)
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
343 return f;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
344 #endif /* not USE_X_TOOLKIT */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
345 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
346 return 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
347 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
348
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
349 #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
350 /* 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
351 windows. */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
352
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
353 struct frame *
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
354 x_any_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
355 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
356 Lisp_Object tail, frame;
27798
d00730392332 (x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents: 27659
diff changeset
357 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
358 struct x_output *x;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
359
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
360 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
361
27798
d00730392332 (x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents: 27659
diff changeset
362 found = NULL;
90970
3371fc48749b Replace uses of GC_* macros with the non-GC_ versions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 90951
diff changeset
363 for (tail = Vframe_list; 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
364 {
9154af188477 Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents: 25628
diff changeset
365 frame = XCAR (tail);
90970
3371fc48749b Replace uses of GC_* macros with the non-GC_ versions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 90951
diff changeset
366 if (!FRAMEP (frame))
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
367 continue;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
368
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
369 f = XFRAME (frame);
27798
d00730392332 (x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents: 27659
diff changeset
370 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
371 {
27798
d00730392332 (x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents: 27659
diff changeset
372 /* 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
373 x = f->output_data.x;
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
374 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
375 found = f;
d00730392332 (x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents: 27659
diff changeset
376 else if (x->widget)
d00730392332 (x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents: 27659
diff changeset
377 {
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
378 #ifdef USE_GTK
53069
1218a42792ea Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents: 53027
diff changeset
379 GtkWidget *gwdesc = xg_win_to_widget (dpyinfo->display, wdesc);
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
380 if (gwdesc != 0
104815
b3c991e42448 * xterm.h: Rename x_non_menubar_window_to_frame to
Jan Djärv <jan.h.d@swipnet.se>
parents: 103840
diff changeset
381 && gtk_widget_get_toplevel (gwdesc) == x->widget)
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
382 found = f;
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
383 #else
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
384 if (wdesc == XtWindow (x->widget)
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
385 || 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
386 || wdesc == XtWindow (x->edit_widget))
d00730392332 (x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents: 27659
diff changeset
387 found = f;
d00730392332 (x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents: 27659
diff changeset
388 /* 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
389 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
390 found = f;
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
391 #endif
27798
d00730392332 (x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents: 27659
diff changeset
392 }
d00730392332 (x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents: 27659
diff changeset
393 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
394 /* A tooltip frame. */
d00730392332 (x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents: 27659
diff changeset
395 found = f;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
396 }
27798
d00730392332 (x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents: 27659
diff changeset
397 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
398
27798
d00730392332 (x_window_to_frame, x_any_window_to_frame)
Gerd Moellmann <gerd@gnu.org>
parents: 27659
diff changeset
399 return found;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
400 }
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
401
12656
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
402 /* 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
403
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
404 struct frame *
109445
051595eb9b58 Merge changes from emacs-23 branch.
Chong Yidong <cyd@stupidchicken.com>
parents: 109374 109327
diff changeset
405 x_menubar_window_to_frame (struct x_display_info *dpyinfo, XEvent *event)
12656
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
406 {
109327
60266cf487b0 Fix menus as per bug 6499 and 6608.
Jan D <jan.h.d@swipnet.se>
parents: 109290
diff changeset
407 Window wdesc = event->xany.window;
12656
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
408 Lisp_Object tail, frame;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
409 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
410 struct x_output *x;
12656
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
411
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
412 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
413
90970
3371fc48749b Replace uses of GC_* macros with the non-GC_ versions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 90951
diff changeset
414 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
25646
9154af188477 Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents: 25628
diff changeset
415 {
9154af188477 Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents: 25628
diff changeset
416 frame = XCAR (tail);
90970
3371fc48749b Replace uses of GC_* macros with the non-GC_ versions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 90951
diff changeset
417 if (!FRAMEP (frame))
12656
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
418 continue;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
419 f = XFRAME (frame);
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26571
diff changeset
420 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
421 continue;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
422 x = f->output_data.x;
109327
60266cf487b0 Fix menus as per bug 6499 and 6608.
Jan D <jan.h.d@swipnet.se>
parents: 109290
diff changeset
423 #ifdef USE_GTK
60266cf487b0 Fix menus as per bug 6499 and 6608.
Jan D <jan.h.d@swipnet.se>
parents: 109290
diff changeset
424 if (x->menubar_widget && xg_event_is_for_menubar (f, event))
60266cf487b0 Fix menus as per bug 6499 and 6608.
Jan D <jan.h.d@swipnet.se>
parents: 109290
diff changeset
425 return f;
60266cf487b0 Fix menus as per bug 6499 and 6608.
Jan D <jan.h.d@swipnet.se>
parents: 109290
diff changeset
426 #else
12656
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
427 /* Match if the window is this frame's menubar. */
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
428 if (x->menubar_widget
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
429 && 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
430 return f;
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
431 #endif
12656
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
432 }
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
433 return 0;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
434 }
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
435
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
436 /* 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
437 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
438
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
439 struct frame *
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
440 x_top_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
441 {
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
442 Lisp_Object tail, frame;
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
443 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
444 struct x_output *x;
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
445
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
446 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
447
90970
3371fc48749b Replace uses of GC_* macros with the non-GC_ versions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 90951
diff changeset
448 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
25646
9154af188477 Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents: 25628
diff changeset
449 {
9154af188477 Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents: 25628
diff changeset
450 frame = XCAR (tail);
90970
3371fc48749b Replace uses of GC_* macros with the non-GC_ versions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 90951
diff changeset
451 if (!FRAMEP (frame))
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
452 continue;
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
453 f = XFRAME (frame);
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26571
diff changeset
454 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
455 continue;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
456 x = f->output_data.x;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
457
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
458 if (x->widget)
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
459 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
460 /* This frame matches if the window is its topmost widget. */
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
461 #ifdef USE_GTK
53069
1218a42792ea Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents: 53027
diff changeset
462 GtkWidget *gwdesc = xg_win_to_widget (dpyinfo->display, wdesc);
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
463 if (gwdesc == x->widget)
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
464 return f;
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
465 #else
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
466 if (wdesc == XtWindow (x->widget))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
467 return f;
12019
63ee64941021 (x_top_window_to_frame): Don't match menu-bar widget.
Karl Heuer <kwzh@gnu.org>
parents: 12011
diff changeset
468 #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
469 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
470 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
471 /* Match if the window is this frame's menubar. */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
472 if (x->menubar_widget
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
473 && wdesc == XtWindow (x->menubar_widget))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
474 return f;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
475 #endif
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
476 #endif
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
477 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
478 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
479 /* Tooltip frame. */
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
480 return f;
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
481 }
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
482 return 0;
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
483 }
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
484 #endif /* USE_X_TOOLKIT || USE_GTK */
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
485
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
486
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
487
109100
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
488 static void x_default_font_parameter (struct frame *, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
489
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
490 static Lisp_Object unwind_create_frame (Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
491 static Lisp_Object unwind_create_tip_frame (Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
492
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
493 void x_set_foreground_color (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
494 static void x_set_wait_for_wm (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
495 void x_set_background_color (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
496 void x_set_mouse_color (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
497 void x_set_cursor_color (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
498 void x_set_border_color (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
499 void x_set_cursor_type (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
500 void x_set_icon_type (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
501 void x_set_icon_name (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
502 void x_explicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
503 void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
504 void x_set_title (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
505 void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
506 void x_set_scroll_bar_foreground (struct frame *, Lisp_Object,
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
507 Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
508 void x_set_scroll_bar_background (struct frame *, Lisp_Object,
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
509 Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
510 static Lisp_Object x_default_scroll_bar_color_parameter (struct frame *,
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
511 Lisp_Object,
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
512 Lisp_Object,
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
513 char *, char *,
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
514 int);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
515
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
516
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
517 /* 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
518 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
519 not Emacs's own window. */
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
520
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
521 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
522 x_real_positions (FRAME_PTR f, int *xptr, int *yptr)
7408
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
523 {
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
524 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
525 int real_x = 0, real_y = 0;
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
526 int had_errors = 0;
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
527 Window win = f->output_data.x->parent_desc;
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
528
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
529 BLOCK_INPUT;
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
530
69152
f2147c1027b6 * xterm.h (x_catch_errors) Return value changed to void.
Chong Yidong <cyd@stupidchicken.com>
parents: 69065
diff changeset
531 x_catch_errors (FRAME_X_DISPLAY (f));
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
532
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
533 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
534 win = FRAME_OUTER_WINDOW (f);
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
535
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
536 /* 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
537 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
538 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
539 should be the outer WM window. */
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
540 for (;;)
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
541 {
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
542 Window wm_window, rootw;
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
543 Window *tmp_children;
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
544 unsigned int tmp_nchildren;
43914
fed15ed090bc (x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents: 43670
diff changeset
545 int success;
fed15ed090bc (x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents: 43670
diff changeset
546
fed15ed090bc (x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents: 43670
diff changeset
547 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
548 &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
549
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
550 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
551
43914
fed15ed090bc (x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents: 43670
diff changeset
552 /* 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
553 if (! success)
fed15ed090bc (x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents: 43670
diff changeset
554 break;
fed15ed090bc (x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents: 43670
diff changeset
555
fed15ed090bc (x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents: 43670
diff changeset
556 XFree ((char *) tmp_children);
fed15ed090bc (x_real_positions): Handle failure in XQueryTree.
Richard M. Stallman <rms@gnu.org>
parents: 43670
diff changeset
557
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
558 if (wm_window == rootw || had_errors)
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
559 break;
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
560
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
561 win = wm_window;
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
562 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
563
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
564 if (! had_errors)
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
565 {
67264
d50a6a8cfd1e * xfns.c (x_real_positions): int ign => unsigned int.
Jan Djärv <jan.h.d@swipnet.se>
parents: 66931
diff changeset
566 unsigned int ign;
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
567 Window child, rootw;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
568
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
569 /* 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
570 XGetGeometry (FRAME_X_DISPLAY (f), win,
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
571 &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
572
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
573 /* Translate real coordinates to coordinates relative to our
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
574 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
575 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
576 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
577
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
578 ------------------ ---> x
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
579 | title |
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
580 | ----------------- v y
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
581 | | our window
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
582 */
17954
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
583 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
584
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
585 /* From-window, to-window. */
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
586 FRAME_X_DISPLAY_INFO (f)->root_window,
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
587 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
588
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
589 /* From-position, to-position. */
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
590 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
591
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
592 /* Child of win. */
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
593 &child);
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
594
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
595 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
596 {
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
597 outer_x = win_x;
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
598 outer_y = win_y;
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
599 }
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
600 else
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
601 {
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
602 XTranslateCoordinates (FRAME_X_DISPLAY (f),
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
603
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
604 /* From-window, to-window. */
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
605 FRAME_X_DISPLAY_INFO (f)->root_window,
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
606 FRAME_OUTER_WINDOW (f),
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
607
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
608 /* From-position, to-position. */
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
609 real_x, real_y, &outer_x, &outer_y,
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
610
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
611 /* Child of win. */
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
612 &child);
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
613 }
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
614
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
615 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
616 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
617
69173
fdee8318ddc9 * xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary
Chong Yidong <cyd@stupidchicken.com>
parents: 69152
diff changeset
618 x_uncatch_errors ();
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
619
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
620 UNBLOCK_INPUT;
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
621
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
622 if (had_errors) return;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
623
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
624 f->x_pixels_diff = -win_x;
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
625 f->y_pixels_diff = -win_y;
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
626
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
627 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
628 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
629
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
630 *xptr = real_x;
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
631 *yptr = real_y;
7408
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
632 }
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
633
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
634
10920
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
635
25528
b5dd1bafd001 Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents: 25511
diff changeset
636
b5dd1bafd001 Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents: 25511
diff changeset
637 /* 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
638
b5dd1bafd001 Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents: 25511
diff changeset
639 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
640 gamma_correct (struct frame *f, XColor *color)
25528
b5dd1bafd001 Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents: 25511
diff changeset
641 {
b5dd1bafd001 Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents: 25511
diff changeset
642 if (f->gamma)
b5dd1bafd001 Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents: 25511
diff changeset
643 {
b5dd1bafd001 Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents: 25511
diff changeset
644 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
645 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
646 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
647 }
b5dd1bafd001 Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents: 25511
diff changeset
648 }
b5dd1bafd001 Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents: 25511
diff changeset
649
b5dd1bafd001 Include math.h. Add extern declaration for atof in case
Gerd Moellmann <gerd@gnu.org>
parents: 25511
diff changeset
650
28096
244f283b3d03 (x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents: 28050
diff changeset
651 /* 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
652 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
653 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
654 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
655
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
656 int
109555
05e7e7c46ff0 Use const, move declarations to header files.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109445
diff changeset
657 x_defined_color (struct frame *f, const char *color_name,
05e7e7c46ff0 Use const, move declarations to header files.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109445
diff changeset
658 XColor *color, int alloc_p)
28096
244f283b3d03 (x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents: 28050
diff changeset
659 {
244f283b3d03 (x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents: 28050
diff changeset
660 int success_p;
244f283b3d03 (x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents: 28050
diff changeset
661 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
662 Colormap cmap = FRAME_X_COLORMAP (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
663
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
664 BLOCK_INPUT;
28096
244f283b3d03 (x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents: 28050
diff changeset
665 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
666 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
667 success_p = x_alloc_nearest_color (f, cmap, color);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
668 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
669
28096
244f283b3d03 (x_defined_color): Rewritten to use x_allocate_nearest_color.
Gerd Moellmann <gerd@gnu.org>
parents: 28050
diff changeset
670 return success_p;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
671 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
672
27987
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
673
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
674 /* 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
675 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
676 Signal an error if color can't be allocated. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
677
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
678 int
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
679 x_decode_color (FRAME_PTR f, Lisp_Object color_name, int mono_color)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
680 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
681 XColor cdef;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
682
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
683 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
684
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
685 #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
686 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
687 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
688 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
689 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
690 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
691 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
692 #endif
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
693
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
694 /* 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
695 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
696 return mono_color;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
697
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26571
diff changeset
698 /* 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
699 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
700 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
701 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
702
71993
3f1637b3adcb (x_decode_color): Use signal_error.
Kim F. Storm <storm@cua.dk>
parents: 71577
diff changeset
703 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
704 }
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
705
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
706
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
707
38183
3ef7b5a020b2 (Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37946
diff changeset
708 /* 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
709 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
710 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
711
3ef7b5a020b2 (Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37946
diff changeset
712 static void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
713 x_set_wait_for_wm (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
38183
3ef7b5a020b2 (Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37946
diff changeset
714 {
3ef7b5a020b2 (Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37946
diff changeset
715 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
716 }
3ef7b5a020b2 (Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37946
diff changeset
717
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
718 #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
719
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
720 /* 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
721 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
722
b65c743ccded (x_bitmap_mask, x_create_bitmap_mask): New functions to handle mask of bitmaps.
Juanma Barranquero <lekktu@gmail.com>
parents: 51876
diff changeset
723 int
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
724 xg_set_icon (FRAME_PTR f, Lisp_Object file)
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
725 {
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
726 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
727 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
728
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
729 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
730
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
731 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
732 {
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
733 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
734 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
735 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
736 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
737
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
738 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
739
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
740 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
741 {
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
742 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
743 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
744 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
745
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
746 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
747 }
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
748 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
749 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
750
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
751 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
752 }
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
753
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
754 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
755 }
66931
1a573209abf9 * xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 66502
diff changeset
756
1a573209abf9 * xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 66502
diff changeset
757 int
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
758 xg_set_icon_from_xpm_data (FRAME_PTR f, char **data)
66931
1a573209abf9 * xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 66502
diff changeset
759 {
1a573209abf9 * xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 66502
diff changeset
760 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
761 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
762
1a573209abf9 * xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 66502
diff changeset
763 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
764 return 0;
d50a6a8cfd1e * xfns.c (x_real_positions): int ign => unsigned int.
Jan Djärv <jan.h.d@swipnet.se>
parents: 66931
diff changeset
765
d50a6a8cfd1e * xfns.c (x_real_positions): int ign => unsigned int.
Jan Djärv <jan.h.d@swipnet.se>
parents: 66931
diff changeset
766 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
767 g_object_unref (pixbuf);
1a573209abf9 * xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 66502
diff changeset
768 return 1;
1a573209abf9 * xfns.c (xg_set_icon_from_xpm_data): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 66502
diff changeset
769 }
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
770 #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
771
38183
3ef7b5a020b2 (Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37946
diff changeset
772
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
773 /* Functions called only from `x_set_frame_param'
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
774 to set individual parameters.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
775
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
776 If FRAME_X_WINDOW (f) is 0,
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
777 the frame is being created and its X-window does not exist yet.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
778 In that case, just record the parameter's new value
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
779 in the standard place; do not attempt to change the window. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
780
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
781 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
782 x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
783 {
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
784 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
785 unsigned long fg, old_fg;
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
786
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
787 fg = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
788 old_fg = FRAME_FOREGROUND_PIXEL (f);
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
789 FRAME_FOREGROUND_PIXEL (f) = fg;
21779
6aaa0268fe91 (x_set_foreground_color, x_set_background_color)
Richard M. Stallman <rms@gnu.org>
parents: 21555
diff changeset
790
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
791 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
792 {
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
793 Display *dpy = FRAME_X_DISPLAY (f);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
794
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
795 BLOCK_INPUT;
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
796 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
797 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
798
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
799 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
800 {
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
801 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
802 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
803 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
804 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
805
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
806 UNBLOCK_INPUT;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
807
25593
9aecfcf3cb43 (x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents: 25550
diff changeset
808 update_face_from_frame_parameter (f, Qforeground_color, arg);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
809
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
810 if (FRAME_VISIBLE_P (f))
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
811 redraw_frame (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
812 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
813
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
814 unload_color (f, old_fg);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
815 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
816
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
817 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
818 x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
819 {
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
820 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
821 unsigned long bg;
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
822
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
823 bg = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f));
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
824 unload_color (f, FRAME_BACKGROUND_PIXEL (f));
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
825 FRAME_BACKGROUND_PIXEL (f) = bg;
21779
6aaa0268fe91 (x_set_foreground_color, x_set_background_color)
Richard M. Stallman <rms@gnu.org>
parents: 21555
diff changeset
826
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
827 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
828 {
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
829 Display *dpy = FRAME_X_DISPLAY (f);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
830
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
831 BLOCK_INPUT;
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
832 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
833 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
834 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
835 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
836
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
837 #ifdef USE_GTK
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
838 xg_set_background_color (f, bg);
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
839 #endif
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
840
39159
2c7a6a1b047e (x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents: 38749
diff changeset
841 #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
842 toolkit scroll bars. */
2c7a6a1b047e (x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents: 38749
diff changeset
843 {
2c7a6a1b047e (x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents: 38749
diff changeset
844 Lisp_Object bar;
2c7a6a1b047e (x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents: 38749
diff changeset
845 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
846 !NILP (bar);
2c7a6a1b047e (x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents: 38749
diff changeset
847 bar = XSCROLL_BAR (bar)->next)
2c7a6a1b047e (x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents: 38749
diff changeset
848 {
86161
3408ab8b4152 * xterm.h (struct scroll_bar): Only use Lisp_Object for lisp data.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86073
diff changeset
849 Window window = XSCROLL_BAR (bar)->x_window;
39159
2c7a6a1b047e (x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents: 38749
diff changeset
850 XSetWindowBackground (dpy, window, bg);
2c7a6a1b047e (x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents: 38749
diff changeset
851 }
2c7a6a1b047e (x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents: 38749
diff changeset
852 }
2c7a6a1b047e (x_set_background_color): Don't change the colors
Gerd Moellmann <gerd@gnu.org>
parents: 38749
diff changeset
853 #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
854
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
855 UNBLOCK_INPUT;
25593
9aecfcf3cb43 (x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents: 25550
diff changeset
856 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
857
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
858 if (FRAME_VISIBLE_P (f))
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
859 redraw_frame (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
860 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
861 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
862
103704
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
863 static Cursor
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
864 make_invisible_cursor (struct frame *f)
103704
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
865 {
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
866 Display *dpy = FRAME_X_DISPLAY (f);
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
867 static char const no_data[] = { 0 };
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
868 Pixmap pix;
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
869 XColor col;
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
870 Cursor c;
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
871
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
872 x_catch_errors (dpy);
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
873 pix = XCreateBitmapFromData (dpy, FRAME_X_DISPLAY_INFO (f)->root_window,
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
874 no_data, 1, 1);
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
875 if (! x_had_errors_p (dpy) && pix != None)
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
876 {
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
877 col.pixel = 0;
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
878 col.red = col.green = col.blue = 0;
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
879 col.flags = DoRed | DoGreen | DoBlue;
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
880 c = XCreatePixmapCursor (dpy, pix, pix, &col, &col, 0, 0);
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
881 if (x_had_errors_p (dpy) || c == None)
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
882 c = 0;
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
883 XFreePixmap (dpy, pix);
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
884 }
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
885
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
886 x_uncatch_errors ();
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
887
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
888 return c;
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
889 }
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
890
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
891 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
892 x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
893 {
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
894 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
895 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
896 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
897 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
898 unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
899 unsigned long mask_color = FRAME_BACKGROUND_PIXEL (f);
25075
9f5d679349e9 (x_set_mouse_color): Always unload the old color.
Karl Heuer <kwzh@gnu.org>
parents: 24994
diff changeset
900
9f5d679349e9 (x_set_mouse_color): Always unload the old color.
Karl Heuer <kwzh@gnu.org>
parents: 24994
diff changeset
901 /* 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
902 if (mask_color == pixel)
35261
ba1f849f9381 (x_set_mouse_color): Fix color allocation.
Gerd Moellmann <gerd@gnu.org>
parents: 35191
diff changeset
903 {
ba1f849f9381 (x_set_mouse_color): Fix color allocation.
Gerd Moellmann <gerd@gnu.org>
parents: 35191
diff changeset
904 x_free_colors (f, &pixel, 1);
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
905 pixel = x_copy_color (f, FRAME_FOREGROUND_PIXEL (f));
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
906 }
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
907
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
908 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
909 x->mouse_pixel = pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
910
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
911 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
912
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 3512
diff changeset
913 /* 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
914 x_catch_errors (dpy);
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
915
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
916 if (!NILP (Vx_pointer_shape))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
917 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
918 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
919 cursor = XCreateFontCursor (dpy, XINT (Vx_pointer_shape));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
920 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
921 else
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
922 cursor = XCreateFontCursor (dpy, XC_xterm);
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
923 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
924
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
925 if (!NILP (Vx_nontext_pointer_shape))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
926 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
927 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
928 nontext_cursor
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
929 = XCreateFontCursor (dpy, XINT (Vx_nontext_pointer_shape));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
930 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
931 else
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
932 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
933 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
934
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
935 if (!NILP (Vx_hourglass_pointer_shape))
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
936 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
937 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
938 hourglass_cursor
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
939 = 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
940 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
941 else
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
942 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
943 x_check_errors (dpy, "bad hourglass pointer cursor: %s");
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
944
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
945 if (!NILP (Vx_mode_pointer_shape))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
946 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
947 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
948 mode_cursor = XCreateFontCursor (dpy, XINT (Vx_mode_pointer_shape));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
949 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
950 else
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
951 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
952 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
953
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
954 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
955 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
956 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
957 hand_cursor
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
958 = 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
959 }
e0938c42218c (syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6610
diff changeset
960 else
50236
156baddab173 Setup and use hand_cursor instead of cross_cursor.
Kim F. Storm <storm@cua.dk>
parents: 50099
diff changeset
961 hand_cursor = XCreateFontCursor (dpy, XC_hand2);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
962
33960
1f92a2d65681 (Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 33747
diff changeset
963 if (!NILP (Vx_window_horizontal_drag_shape))
1f92a2d65681 (Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 33747
diff changeset
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_window_horizontal_drag_shape);
33960
1f92a2d65681 (Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 33747
diff changeset
966 horizontal_drag_cursor
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
967 = 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
968 }
1f92a2d65681 (Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 33747
diff changeset
969 else
1f92a2d65681 (Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 33747
diff changeset
970 horizontal_drag_cursor
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
971 = 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
972
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
973 /* 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
974 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
975 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
976
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
977 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
978 XColor fore_color, back_color;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
979
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
980 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
981 x_query_color (f, &fore_color);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
982 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
983 x_query_color (f, &back_color);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
984
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
985 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
986 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
987 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
988 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
989 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
990 XRecolorCursor (dpy, horizontal_drag_cursor, &fore_color, &back_color);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
991 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
992
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
993 if (FRAME_X_WINDOW (f) != 0)
103704
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
994 XDefineCursor (dpy, FRAME_X_WINDOW (f),
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
995 f->output_data.x->current_cursor = cursor);
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
996
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
997 if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor == 0)
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
998 FRAME_X_DISPLAY_INFO (f)->invisible_cursor = make_invisible_cursor (f);
6a4e411bd83b * xterm.h (struct x_display_info): Add invisible_cursor.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103674
diff changeset
999
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1000 if (cursor != x->text_cursor
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1001 && x->text_cursor != 0)
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1002 XFreeCursor (dpy, x->text_cursor);
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1003 x->text_cursor = cursor;
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1004
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1005 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
1006 && x->nontext_cursor != 0)
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1007 XFreeCursor (dpy, x->nontext_cursor);
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1008 x->nontext_cursor = nontext_cursor;
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1009
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1010 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
1011 && x->hourglass_cursor != 0)
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1012 XFreeCursor (dpy, x->hourglass_cursor);
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1013 x->hourglass_cursor = hourglass_cursor;
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1014
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1015 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
1016 && x->modeline_cursor != 0)
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1017 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
1018 x->modeline_cursor = mode_cursor;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
1019
50236
156baddab173 Setup and use hand_cursor instead of cross_cursor.
Kim F. Storm <storm@cua.dk>
parents: 50099
diff changeset
1020 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
1021 && x->hand_cursor != 0)
156baddab173 Setup and use hand_cursor instead of cross_cursor.
Kim F. Storm <storm@cua.dk>
parents: 50099
diff changeset
1022 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
1023 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
1024
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1025 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
1026 && x->horizontal_drag_cursor != 0)
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1027 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
1028 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
1029
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1030 XFlush (dpy);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1031 UNBLOCK_INPUT;
25593
9aecfcf3cb43 (x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents: 25550
diff changeset
1032
9aecfcf3cb43 (x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents: 25550
diff changeset
1033 update_face_from_frame_parameter (f, Qmouse_color, arg);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1034 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1035
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1036 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1037 x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1038 {
21779
6aaa0268fe91 (x_set_foreground_color, x_set_background_color)
Richard M. Stallman <rms@gnu.org>
parents: 21555
diff changeset
1039 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
1040 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
1041 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
1042
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1043 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
1044 {
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1045 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
1046 WHITE_PIX_DEFAULT (f));
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1047 fore_pixel_allocated_p = 1;
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1048 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1049 else
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
1050 fore_pixel = FRAME_BACKGROUND_PIXEL (f);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
1051
21779
6aaa0268fe91 (x_set_foreground_color, x_set_background_color)
Richard M. Stallman <rms@gnu.org>
parents: 21555
diff changeset
1052 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
1053 pixel_allocated_p = 1;
21779
6aaa0268fe91 (x_set_foreground_color, x_set_background_color)
Richard M. Stallman <rms@gnu.org>
parents: 21555
diff changeset
1054
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
1055 /* Make sure that the cursor color differs from the background color. */
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
1056 if (pixel == FRAME_BACKGROUND_PIXEL (f))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1057 {
28355
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1058 if (pixel_allocated_p)
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1059 {
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1060 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
1061 pixel_allocated_p = 0;
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1062 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
1063
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1064 pixel = x->mouse_pixel;
21779
6aaa0268fe91 (x_set_foreground_color, x_set_background_color)
Richard M. Stallman <rms@gnu.org>
parents: 21555
diff changeset
1065 if (pixel == fore_pixel)
28355
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1066 {
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1067 if (fore_pixel_allocated_p)
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1068 {
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1069 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
1070 fore_pixel_allocated_p = 0;
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1071 }
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
1072 fore_pixel = FRAME_BACKGROUND_PIXEL (f);
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1073 }
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1074 }
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1075
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1076 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
1077 if (!fore_pixel_allocated_p)
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1078 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
1079 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
1080
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1081 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
1082 if (!pixel_allocated_p)
11d7a6fdad5f (x_set_cursor_color): Get color reference counts right.
Gerd Moellmann <gerd@gnu.org>
parents: 28347
diff changeset
1083 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
1084 x->cursor_pixel = pixel;
21779
6aaa0268fe91 (x_set_foreground_color, x_set_background_color)
Richard M. Stallman <rms@gnu.org>
parents: 21555
diff changeset
1085
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
1086 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1087 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1088 BLOCK_INPUT;
37762
ddf0a963805f (x_set_foreground_color): Change frame's cursor_pixel
Gerd Moellmann <gerd@gnu.org>
parents: 37608
diff changeset
1089 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
1090 XSetForeground (FRAME_X_DISPLAY (f), x->cursor_gc, fore_pixel);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1091 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1092
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1093 if (FRAME_VISIBLE_P (f))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1094 {
15999
0e148af7d4ec (x_set_cursor_color): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents: 15942
diff changeset
1095 x_update_cursor (f, 0);
0e148af7d4ec (x_set_cursor_color): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents: 15942
diff changeset
1096 x_update_cursor (f, 1);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1097 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1098 }
25593
9aecfcf3cb43 (x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents: 25550
diff changeset
1099
9aecfcf3cb43 (x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents: 25550
diff changeset
1100 update_face_from_frame_parameter (f, Qcursor_color, arg);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1101 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1102
50370
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1103 /* 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
1104 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
1105 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
1106
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1107 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1108 x_set_border_pixel (struct frame *f, int pix)
50370
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1109 {
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1110 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
1111 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
1112
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
1113 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
1114 {
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1115 BLOCK_INPUT;
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1116 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
1117 (unsigned long)pix);
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1118 UNBLOCK_INPUT;
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1119
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1120 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
1121 redraw_frame (f);
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1122 }
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1123 }
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1124
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1125 /* Set the border-color of frame F to value described by ARG.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1126 ARG can be a string naming a color.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1127 The border-color is used for the border that is drawn by the X server.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1128 Note that this does not fully take effect if done before
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1129 F has an x-window; it must be redone when the window is created.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1130
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1131 Note: this is done in two routines because of the way X10 works.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1132
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1133 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
1134 and so emacs' border colors may be overridden. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1135
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1136 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1137 x_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1138 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1139 int pix;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1140
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
1141 CHECK_STRING (arg);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1142 pix = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1143 x_set_border_pixel (f, pix);
25593
9aecfcf3cb43 (x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents: 25550
diff changeset
1144 update_face_from_frame_parameter (f, Qborder_color, arg);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1145 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1146
28347
ce7dddf6dfb7 (x_specified_cursor_type): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 28229
diff changeset
1147
ce7dddf6dfb7 (x_specified_cursor_type): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 28229
diff changeset
1148 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1149 x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
28347
ce7dddf6dfb7 (x_specified_cursor_type): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 28229
diff changeset
1150 {
47142
21cac7a2dcb9 (Vblink_cursor_alist): Removed.
Kim F. Storm <storm@cua.dk>
parents: 47086
diff changeset
1151 set_frame_cursor_types (f, arg);
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1152
43987
ea6530f23937 (x_set_cursor_type): Set cursor_type_changed,
Richard M. Stallman <rms@gnu.org>
parents: 43917
diff changeset
1153 /* 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
1154 cursor_type_changed = 1;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1155 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1156
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1157 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1158 x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1159 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1160 int result;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1161
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
1162 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
1163 {
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
1164 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
1165 return;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
1166 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
1167 else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1168 return;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1169
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1170 BLOCK_INPUT;
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 436
diff changeset
1171 if (NILP (arg))
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1172 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
1173 (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
1174 ? 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
1175 : f->name)));
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1176 else
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1177 result = x_bitmap_icon (f, arg);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1178
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1179 if (result)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1180 {
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
1181 UNBLOCK_INPUT;
9353
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1182 error ("No icon window available");
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1183 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1184
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1185 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1186 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1187 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1188
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1189 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1190 x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1191 {
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1192 int result;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1193
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1194 if (STRINGP (arg))
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1195 {
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1196 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt))
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1197 return;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1198 }
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
1199 else if (!NILP (arg) || NILP (oldval))
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1200 return;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1201
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
1202 f->icon_name = arg;
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1203
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1204 if (f->output_data.x->icon_bitmap != 0)
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1205 return;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1206
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1207 BLOCK_INPUT;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1208
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1209 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
1210 (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
1211 ? 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
1212 : !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
1213 ? f->title
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46295
diff changeset
1214 : f->name)));
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1215
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1216 if (result)
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1217 {
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1218 UNBLOCK_INPUT;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1219 error ("No icon window available");
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1220 }
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1221
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1222 XFlush (FRAME_X_DISPLAY (f));
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1223 UNBLOCK_INPUT;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1224 }
31930
9c779861abff (x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents: 31902
diff changeset
1225
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1226
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1227 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1228 x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1229 {
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1230 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
1231 #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
1232 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
1233 #endif
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1234
2880
9a78169e44df * xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents: 2842
diff changeset
1235 /* 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
1236 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
1237 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
1238 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
1239 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
1240 return;
9a78169e44df * xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents: 2842
diff changeset
1241
9103
948e8acb6990 (x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9022
diff changeset
1242 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
1243 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
1244 else
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1245 nlines = 0;
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1246
17556
c0f8f4264f7a (x_set_menu_bar_lines): Increment windows_or_buffers_changed.
Richard M. Stallman <rms@gnu.org>
parents: 17106
diff changeset
1247 /* 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
1248 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
1249
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1250 #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
1251 FRAME_MENU_BAR_LINES (f) = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1252 if (nlines)
12832
0d750e41c4f2 (x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents: 12773
diff changeset
1253 {
0d750e41c4f2 (x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents: 12773
diff changeset
1254 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
1255 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
1256 /* 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
1257 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
1258 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1259 else
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1260 {
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
1261 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
1262 free_frame_menubar (f);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1263 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
1264 if (FRAME_X_P (f))
714433bead7f (x_set_menu_bar_lines) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents: 13508
diff changeset
1265 f->output_data.x->menubar_widget = 0;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1266 }
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1267 #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
1268 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
1269 change_window_heights (f->root_window, nlines - olines);
106788
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1270
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1271 /* If the menu bar height gets changed, the internal border below
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1272 the top margin has to be cleared. Also, if the menu bar gets
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1273 larger, the area for the added lines has to be cleared except for
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1274 the first menu bar line that is to be drawn later. */
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1275 if (nlines != olines)
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1276 {
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1277 int height = FRAME_INTERNAL_BORDER_WIDTH (f);
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1278 int width = FRAME_PIXEL_WIDTH (f);
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1279 int y;
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1280
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1281 /* height can be zero here. */
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1282 if (height > 0 && width > 0)
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1283 {
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1284 y = FRAME_TOP_MARGIN_HEIGHT (f);
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1285
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1286 BLOCK_INPUT;
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1287 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1288 0, y, width, height, False);
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1289 UNBLOCK_INPUT;
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1290 }
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1291
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1292 if (nlines > 1 && nlines > olines)
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1293 {
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1294 y = (olines == 0 ? 1 : olines) * FRAME_LINE_HEIGHT (f);
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1295 height = nlines * FRAME_LINE_HEIGHT (f) - y;
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1296
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1297 BLOCK_INPUT;
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1298 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1299 0, y, width, height, False);
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1300 UNBLOCK_INPUT;
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1301 }
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1302
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1303 if (nlines == 0 && WINDOWP (f->menu_bar_window))
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1304 clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix);
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1305 }
cf03cdb87fff * xfns.c (x_set_menu_bar_lines) [!USE_X_TOOLKIT && !USE_GTK]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106772
diff changeset
1306 #endif /* not USE_X_TOOLKIT && not USE_GTK */
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1307 adjust_glyphs (f);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1308 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1309
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1310
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1311 /* 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
1312 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
1313 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
1314 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
1315 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
1316
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1317 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1318 x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1319 {
31930
9c779861abff (x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents: 31902
diff changeset
1320 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
1321 Lisp_Object root_window;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1322
35819
74e2d9de2fc1 (x_set_tool_bar_lines): Do nothing If frame is
Gerd Moellmann <gerd@gnu.org>
parents: 35733
diff changeset
1323 /* 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
1324 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
1325 return;
74e2d9de2fc1 (x_set_tool_bar_lines): Do nothing If frame is
Gerd Moellmann <gerd@gnu.org>
parents: 35733
diff changeset
1326
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1327 /* 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
1328 if (INTEGERP (value) && XINT (value) >= 0)
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1329 nlines = XFASTINT (value);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1330 else
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1331 nlines = 0;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1332
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1333 #ifdef USE_GTK
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1334 FRAME_TOOL_BAR_LINES (f) = 0;
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1335 if (nlines)
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1336 {
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1337 FRAME_EXTERNAL_TOOL_BAR (f) = 1;
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1338 if (FRAME_X_P (f) && f->output_data.x->toolbar_widget == 0)
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1339 /* Make sure next redisplay shows the tool bar. */
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1340 XWINDOW (FRAME_SELECTED_WINDOW (f))->update_mode_line = Qt;
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1341 update_frame_tool_bar (f);
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1342 }
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1343 else
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1344 {
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1345 if (FRAME_EXTERNAL_TOOL_BAR (f))
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1346 free_frame_tool_bar (f);
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1347 FRAME_EXTERNAL_TOOL_BAR (f) = 0;
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1348 }
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1349
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1350 return;
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1351 #endif
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
1352
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
1353 /* 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
1354 ++windows_or_buffers_changed;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1355
25544
693ca9ba497a Change spelling of `toolbar' to `tool_bar' or `tool-bar'.
Gerd Moellmann <gerd@gnu.org>
parents: 25528
diff changeset
1356 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
1357
9c779861abff (x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents: 31902
diff changeset
1358 /* 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
1359 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
1360 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
1361 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
1362 {
9c779861abff (x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents: 31902
diff changeset
1363 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
1364 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
1365 }
9c779861abff (x_set_tool_bar_lines): Don't use more lines for the
Gerd Moellmann <gerd@gnu.org>
parents: 31902
diff changeset
1366
25544
693ca9ba497a Change spelling of `toolbar' to `tool_bar' or `tool-bar'.
Gerd Moellmann <gerd@gnu.org>
parents: 25528
diff changeset
1367 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
1368 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
1369 adjust_glyphs (f);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
1370
31999
d862c73ea0d5 (x_set_tool_bar_lines): Clear frame when tool bar
Gerd Moellmann <gerd@gnu.org>
parents: 31930
diff changeset
1371 /* 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
1372 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
1373 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
1374 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
1375 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
1376 below the menu bar. */
d862c73ea0d5 (x_set_tool_bar_lines): Clear frame when tool bar
Gerd Moellmann <gerd@gnu.org>
parents: 31930
diff changeset
1377 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
1378 {
83100
4970ad4995f5 Eliminated updating_frame.
Karoly Lorentey <lorentey@elte.hu>
parents: 83078
diff changeset
1379 clear_frame (f);
33601
1ee8ea329b7b (x_set_tool_bar_lines): When clearing the frame, also
Gerd Moellmann <gerd@gnu.org>
parents: 33589
diff changeset
1380 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
1381 }
33747
e0e2461a24fe (x_set_tool_bar_lines): Clear internal border when
Gerd Moellmann <gerd@gnu.org>
parents: 33713
diff changeset
1382
e0e2461a24fe (x_set_tool_bar_lines): Clear internal border when
Gerd Moellmann <gerd@gnu.org>
parents: 33713
diff changeset
1383 /* 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
1384 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
1385 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
1386 if (delta < 0)
e0e2461a24fe (x_set_tool_bar_lines): Clear internal border when
Gerd Moellmann <gerd@gnu.org>
parents: 33713
diff changeset
1387 {
e0e2461a24fe (x_set_tool_bar_lines): Clear internal border when
Gerd Moellmann <gerd@gnu.org>
parents: 33713
diff changeset
1388 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
1389 int width = FRAME_PIXEL_WIDTH (f);
106768
21fd634f447a Make line<->pixel_y conversion macros aware of native menu/tool bars.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 106561
diff changeset
1390 int y = (FRAME_MENU_BAR_LINES (f) + 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
1391
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
1392 /* 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
1393 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
1394 {
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
1395 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
1396 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
1397 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
1398 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
1399 }
38625
0bfdfd449f4a (x_set_tool_bar_lines): Clear the tool bar window's
Gerd Moellmann <gerd@gnu.org>
parents: 38575
diff changeset
1400
0bfdfd449f4a (x_set_tool_bar_lines): Clear the tool bar window's
Gerd Moellmann <gerd@gnu.org>
parents: 38575
diff changeset
1401 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
1402 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
1403 }
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1404 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1405
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1406
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1407 /* 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
1408 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
1409 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
1410 the frame parameter. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1411
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1412 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1413 x_set_scroll_bar_foreground (struct frame *f, Lisp_Object value, Lisp_Object oldval)
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1414 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1415 unsigned long pixel;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
1416
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1417 if (STRINGP (value))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1418 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
1419 else
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1420 pixel = -1;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1421
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1422 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
1423 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
1424
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1425 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
1426 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
1427 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1428 /* Remove all scroll bars because they have wrong colors. */
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
1429 if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook)
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
1430 (*FRAME_TERMINAL (f)->condemn_scroll_bars_hook) (f);
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
1431 if (FRAME_TERMINAL (f)->judge_scroll_bars_hook)
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
1432 (*FRAME_TERMINAL (f)->judge_scroll_bars_hook) (f);
25593
9aecfcf3cb43 (x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents: 25550
diff changeset
1433
9aecfcf3cb43 (x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents: 25550
diff changeset
1434 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
1435 redraw_frame (f);
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 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1438
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1439
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1440 /* 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
1441 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
1442 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
1443 parameter. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1444
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1445 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1446 x_set_scroll_bar_background (struct frame *f, Lisp_Object value, Lisp_Object oldval)
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1447 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1448 unsigned long pixel;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1449
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1450 if (STRINGP (value))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1451 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
1452 else
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1453 pixel = -1;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
1454
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1455 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
1456 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
1457
39619
1e12db2b25f0 (x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents: 39591
diff changeset
1458 #ifdef USE_TOOLKIT_SCROLL_BARS
1e12db2b25f0 (x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents: 39591
diff changeset
1459 /* Scrollbar shadow colors. */
1e12db2b25f0 (x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents: 39591
diff changeset
1460 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
1461 {
1e12db2b25f0 (x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents: 39591
diff changeset
1462 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
1463 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
1464 }
1e12db2b25f0 (x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents: 39591
diff changeset
1465 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
1466 {
1e12db2b25f0 (x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents: 39591
diff changeset
1467 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
1468 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
1469 }
1e12db2b25f0 (x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents: 39591
diff changeset
1470 #endif /* USE_TOOLKIT_SCROLL_BARS */
1e12db2b25f0 (x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents: 39591
diff changeset
1471
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1472 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
1473 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
1474 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1475 /* Remove all scroll bars because they have wrong colors. */
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
1476 if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook)
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
1477 (*FRAME_TERMINAL (f)->condemn_scroll_bars_hook) (f);
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
1478 if (FRAME_TERMINAL (f)->judge_scroll_bars_hook)
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
1479 (*FRAME_TERMINAL (f)->judge_scroll_bars_hook) (f);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
1480
25593
9aecfcf3cb43 (x_set_foreground_color): Call
Gerd Moellmann <gerd@gnu.org>
parents: 25550
diff changeset
1481 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
1482 redraw_frame (f);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1483 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1484 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1485
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1486
30383
2bec5f82f5d0 Correct typo in a comment.
Eli Zaretskii <eliz@gnu.org>
parents: 30355
diff changeset
1487 /* 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
1488 XICCC (X Inter Client Communication Conventions).
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1489
77849
f68ce6aa4bd1 (x_encode_text): Add GCPRO.
Richard M. Stallman <rms@gnu.org>
parents: 77848
diff changeset
1490 This can call Lisp code, so callers must GCPRO.
f68ce6aa4bd1 (x_encode_text): Add GCPRO.
Richard M. Stallman <rms@gnu.org>
parents: 77848
diff changeset
1491
30351
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1492 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
1493 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
1494 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
1495 should be freed by `xfree' by a caller.
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1496
43452
75677c801c26 (x_encode_text): Accept additional arg SELECTIONP; all
Eli Zaretskii <eliz@gnu.org>
parents: 43426
diff changeset
1497 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
1498 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
1499 may run Lisp code).
75677c801c26 (x_encode_text): Accept additional arg SELECTIONP; all
Eli Zaretskii <eliz@gnu.org>
parents: 43426
diff changeset
1500
30351
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1501 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
1502
30354
7540bd2b5a34 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 30351
diff changeset
1503 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
1504 which means that the `encoding' of the result can be `STRING'.
30354
7540bd2b5a34 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 30351
diff changeset
1505 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
1506 the result should be `COMPOUND_TEXT'. */
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1507
65459
41f88837ca5b (x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents: 64770
diff changeset
1508 static unsigned char *
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1509 x_encode_text (Lisp_Object string, Lisp_Object coding_system, int selectionp, int *text_bytes, int *stringp, int *freep)
30351
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1510 {
88395
e69e2f450430 Include "character.h".
Kenichi Handa <handa@m17n.org>
parents: 43452
diff changeset
1511 int result = string_xstring_p (string);
30351
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1512 struct coding_system coding;
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1513
88395
e69e2f450430 Include "character.h".
Kenichi Handa <handa@m17n.org>
parents: 43452
diff changeset
1514 if (result == 0)
30351
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1515 {
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1516 /* No multibyte character in OBJ. We need not encode it. */
89483
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89352
diff changeset
1517 *text_bytes = SBYTES (string);
30354
7540bd2b5a34 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 30351
diff changeset
1518 *stringp = 1;
65459
41f88837ca5b (x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents: 64770
diff changeset
1519 *freep = 0;
89483
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89352
diff changeset
1520 return SDATA (string);
30351
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1521 }
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1522
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1523 setup_coding_system (coding_system, &coding);
88395
e69e2f450430 Include "character.h".
Kenichi Handa <handa@m17n.org>
parents: 43452
diff changeset
1524 coding.mode |= (CODING_MODE_SAFE_ENCODING | CODING_MODE_LAST_BLOCK);
33242
421e3db4e24e (x_encode_text): Suppress producing escape sequences for composition.
Kenichi Handa <handa@m17n.org>
parents: 32606
diff changeset
1525 /* We suppress producing escape sequences for composition. */
88395
e69e2f450430 Include "character.h".
Kenichi Handa <handa@m17n.org>
parents: 43452
diff changeset
1526 coding.common_flags &= ~CODING_ANNOTATION_MASK;
89483
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89352
diff changeset
1527 coding.dst_bytes = SCHARS (string) * 2;
88509
0ac97e7062f5 (x_encode_text): Allocate coding.destination here, and
Kenichi Handa <handa@m17n.org>
parents: 88395
diff changeset
1528 coding.destination = (unsigned char *) xmalloc (coding.dst_bytes);
88395
e69e2f450430 Include "character.h".
Kenichi Handa <handa@m17n.org>
parents: 43452
diff changeset
1529 encode_coding_object (&coding, string, 0, 0,
89483
2f877ed80fa6 *** empty log message ***
Kenichi Handa <handa@m17n.org>
parents: 88123 89352
diff changeset
1530 SCHARS (string), SBYTES (string), Qnil);
30351
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1531 *text_bytes = coding.produced;
88395
e69e2f450430 Include "character.h".
Kenichi Handa <handa@m17n.org>
parents: 43452
diff changeset
1532 *stringp = (result == 1 || !EQ (coding_system, Qcompound_text));
65459
41f88837ca5b (x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents: 64770
diff changeset
1533 *freep = 1;
88509
0ac97e7062f5 (x_encode_text): Allocate coding.destination here, and
Kenichi Handa <handa@m17n.org>
parents: 88395
diff changeset
1534 return coding.destination;
30351
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1535 }
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1536
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
1537
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
1538 /* 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
1539 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
1540 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
1541
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
1542 static void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1543 x_set_name_internal (FRAME_PTR f, Lisp_Object 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
1544 {
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
1545 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
1546 {
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
1547 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
1548 {
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
1549 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
1550 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
1551 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
1552 Lisp_Object coding_system;
77854
96c01b44f51d (x_set_name_internal): Undo last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 77849
diff changeset
1553 Lisp_Object encoded_name;
109143
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1554 Lisp_Object encoded_icon_name;
77854
96c01b44f51d (x_set_name_internal): Undo last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 77849
diff changeset
1555 struct gcpro gcpro1;
96c01b44f51d (x_set_name_internal): Undo last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 77849
diff changeset
1556
96c01b44f51d (x_set_name_internal): Undo last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 77849
diff changeset
1557 /* As ENCODE_UTF_8 may cause GC and relocation of string data,
96c01b44f51d (x_set_name_internal): Undo last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 77849
diff changeset
1558 we use it before x_encode_text that may return string data. */
96c01b44f51d (x_set_name_internal): Undo last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 77849
diff changeset
1559 GCPRO1 (name);
96c01b44f51d (x_set_name_internal): Undo last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 77849
diff changeset
1560 encoded_name = ENCODE_UTF_8 (name);
96c01b44f51d (x_set_name_internal): Undo last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 77849
diff changeset
1561 UNGCPRO;
96c01b44f51d (x_set_name_internal): Undo last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 77849
diff changeset
1562
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
1563 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
1564 /* 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
1565
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
1566 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
1567 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
1568 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
1569 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
1570 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
1571 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
1572 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
1573
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
1574 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
1575 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
1576 But, for the moment, there's no way to know that the
109143
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1577 current window manager supports it or not.
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1578
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1579 Either way, we also set the _NET_WM_NAME and _NET_WM_ICON_NAME
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1580 properties. Per the EWMH specification, those two properties
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1581 are always UTF8_STRING. This matches what gtk_window_set_title()
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1582 does in the USE_GTK case. */
65459
41f88837ca5b (x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents: 64770
diff changeset
1583 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
1584 &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
1585 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
1586 : 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
1587 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
1588 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
1589
71173
ac5b57ff4647 (x_set_name_internal): Set icon to `text', derived from name, when
John Paul Wallington <jpw@pobox.com>
parents: 71166
diff changeset
1590 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
1591 {
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 = text;
109143
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1593 encoded_icon_name = encoded_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
1594 }
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 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
1596 {
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 /* 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
1598 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
1599 &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
1600 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
1601 : 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
1602 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
1603 icon.nitems = bytes;
109143
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1604
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1605 encoded_icon_name = ENCODE_UTF_8 (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
1606 }
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
77854
96c01b44f51d (x_set_name_internal): Undo last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 77849
diff changeset
1608 #ifdef USE_GTK
96c01b44f51d (x_set_name_internal): Undo last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 77849
diff changeset
1609 gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
96c01b44f51d (x_set_name_internal): Undo last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 77849
diff changeset
1610 (char *) SDATA (encoded_name));
96c01b44f51d (x_set_name_internal): Undo last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 77849
diff changeset
1611 #else /* not USE_GTK */
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
1612 XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text);
109143
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1613 XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1614 FRAME_X_DISPLAY_INFO (f)->Xatom_net_wm_name,
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1615 FRAME_X_DISPLAY_INFO (f)->Xatom_UTF8_STRING,
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1616 8, PropModeReplace,
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1617 (char *) SDATA (encoded_name),
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1618 SBYTES (encoded_name));
77854
96c01b44f51d (x_set_name_internal): Undo last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 77849
diff changeset
1619 #endif /* not USE_GTK */
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
1620
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 XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &icon);
109143
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1622 XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1623 FRAME_X_DISPLAY_INFO (f)->Xatom_net_wm_icon_name,
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1624 FRAME_X_DISPLAY_INFO (f)->Xatom_UTF8_STRING,
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1625 8, PropModeReplace,
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1626 (char *) SDATA (encoded_icon_name),
a08a6559b47b Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Jan D <jan.h.d@swipnet.se>
parents: 109126
diff changeset
1627 SBYTES (encoded_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
1628
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 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
1630 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
1631 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
1632 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
1633 }
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 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
1635 }
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
4650
d81041bb1e3d comment fix
David J. MacKenzie <djm@gnu.org>
parents: 4629
diff changeset
1638 /* 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
1639 x_id_name.
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1640
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1641 If EXPLICIT is non-zero, that indicates that lisp code is setting the
4650
d81041bb1e3d comment fix
David J. MacKenzie <djm@gnu.org>
parents: 4629
diff changeset
1642 name; if NAME is a string, set F's name to NAME and set
d81041bb1e3d comment fix
David J. MacKenzie <djm@gnu.org>
parents: 4629
diff changeset
1643 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
1644
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1645 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
1646 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
1647 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
1648
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1649 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1650 x_set_name (struct frame *f, Lisp_Object name, int explicit)
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1651 {
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
1652 /* 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
1653 Emacs redisplay code. */
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1654 if (explicit)
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1655 {
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1656 /* 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
1657 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
1658 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
1659 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
1660
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1661 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
1662 }
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1663 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
1664 return;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1665
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1666 /* 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
1667 if (NILP (name))
8090
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
1668 {
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
1669 /* 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
1670 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
1671 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
1672 SDATA (f->name)))
8090
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
1673 return;
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
1674 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
1675 }
833
14748faa4f17 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 817
diff changeset
1676 else
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
1677 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
1678
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1679 /* 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
1680 if (! NILP (Fstring_equal (name, f->name)))
727
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 708
diff changeset
1681 return;
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 708
diff changeset
1682
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1683 f->name = name;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1684
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1685 /* 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
1686 the name parameter. */
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1687 if (! NILP (f->title))
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1688 name = f->title;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1689
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
1690 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
1691 }
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1692
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1693 /* 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
1694 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
1695 redisplay code. */
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1696 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1697 x_explicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1698 {
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1699 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
1700 }
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1701
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1702 /* 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
1703 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
1704 lisp code. */
1125
059624bf9bf0 Declare x_implicitly_set_name to be void.
Jim Blandy <jimb@redhat.com>
parents: 1096
diff changeset
1705 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1706 x_implicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1707 {
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1708 x_set_name (f, arg, 0);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1709 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1710
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1711 /* Change the title of frame F to NAME.
79055
3d1946da128d *** empty log message ***
Martin Rudalics <rudalics@gmx.at>
parents: 78260
diff changeset
1712 If NAME is nil, use the frame name as the title. */
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1713
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1714 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1715 x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1716 {
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1717 /* 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
1718 if (EQ (name, f->title))
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1719 return;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1720
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1721 update_mode_lines = 1;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1722
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1723 f->title = name;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1724
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1725 if (NILP (name))
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1726 name = f->name;
16732
f52c4fd47f03 (x_set_title): Check data type of NAME.
Richard M. Stallman <rms@gnu.org>
parents: 16682
diff changeset
1727 else
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
1728 CHECK_STRING (name);
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1729
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
1730 x_set_name_internal (f, name);
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1731 }
9580
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1732
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1733 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1734 x_set_scroll_bar_default_width (struct frame *f)
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
1735 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
1736 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
1737
25511
9bc9d4d6c716 (x_set_scroll_bar_width): Change conditional compilation
Gerd Moellmann <gerd@gnu.org>
parents: 25464
diff changeset
1738 #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
1739 /* 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
1740 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
1741 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
1742 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
1743 #else
50370
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1744 /* 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
1745 character width. */
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
1746 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
1747
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1748 /* 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
1749 scroll bar. */
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
1750 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
1751 #endif
50370
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
1752 }
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1753
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1754
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1755 /* 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
1756 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
1757 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
1758 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
1759
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1760 static Lisp_Object
109364
89a16701cde1 Convert old-style definitions
Andreas Schwab <schwab@linux-m68k.org>
parents: 109315
diff changeset
1761 x_default_scroll_bar_color_parameter (struct frame *f,
89a16701cde1 Convert old-style definitions
Andreas Schwab <schwab@linux-m68k.org>
parents: 109315
diff changeset
1762 Lisp_Object alist, Lisp_Object prop,
89a16701cde1 Convert old-style definitions
Andreas Schwab <schwab@linux-m68k.org>
parents: 109315
diff changeset
1763 char *xprop, char *xclass,
89a16701cde1 Convert old-style definitions
Andreas Schwab <schwab@linux-m68k.org>
parents: 109315
diff changeset
1764 int foreground_p)
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1765 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1766 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
1767 Lisp_Object tem;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1768
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1769 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
1770 if (EQ (tem, Qunbound))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1771 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1772 #ifdef USE_TOOLKIT_SCROLL_BARS
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1773
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1774 /* 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
1775 specified. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1776 tem = display_x_get_resource (dpyinfo,
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1777 build_string (foreground_p
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1778 ? "foreground"
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1779 : "background"),
81274
516508c377db (x_default_scroll_bar_color_parameter):
Juanma Barranquero <lekktu@gmail.com>
parents: 77848
diff changeset
1780 empty_unibyte_string,
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1781 build_string ("verticalScrollBar"),
81274
516508c377db (x_default_scroll_bar_color_parameter):
Juanma Barranquero <lekktu@gmail.com>
parents: 77848
diff changeset
1782 empty_unibyte_string);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1783 if (!STRINGP (tem))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1784 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1785 /* 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
1786 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
1787 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
1788 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
1789 specified. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1790 tem = Qnil;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1791 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
1792
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1793 #else /* not USE_TOOLKIT_SCROLL_BARS */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
1794
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1795 tem = Qnil;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
1796
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1797 #endif /* not USE_TOOLKIT_SCROLL_BARS */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1798 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1799
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1800 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
1801 return tem;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1802 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1803
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
1804
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1805
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1806
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1807 #ifdef USE_X_TOOLKIT
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1808
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
1809 /* 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
1810 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
1811 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
1812 for example, but Xt doesn't). */
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1813
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1814 static void
109372
dd04c65fb401 Convert function definitions to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109364
diff changeset
1815 hack_wm_protocols (FRAME_PTR f, Widget widget)
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1816 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1817 Display *dpy = XtDisplay (widget);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1818 Window w = XtWindow (widget);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1819 int need_delete = 1;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1820 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
1821 int need_save = 1;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1822
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1823 BLOCK_INPUT;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1824 {
60133
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1825 Atom type;
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1826 unsigned char *catoms;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1827 int format = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1828 unsigned long nitems = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1829 unsigned long bytes_after;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1830
11882
8b3575269610 (hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents: 11774
diff changeset
1831 if ((XGetWindowProperty (dpy, w,
8b3575269610 (hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents: 11774
diff changeset
1832 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
1833 (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
1834 &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
1835 &catoms)
11882
8b3575269610 (hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents: 11774
diff changeset
1836 == Success)
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1837 && 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
1838 {
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1839 Atom *atoms = (Atom *) catoms;
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1840 while (nitems > 0)
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1841 {
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1842 nitems--;
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1843 if (atoms[nitems]
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1844 == 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
1845 need_delete = 0;
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1846 else if (atoms[nitems]
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1847 == 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
1848 need_focus = 0;
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1849 else if (atoms[nitems]
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1850 == 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
1851 need_save = 0;
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1852 }
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1853 }
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1854 if (catoms)
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
1855 XFree (catoms);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1856 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1857 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1858 Atom props [10];
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1859 int count = 0;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1860 if (need_delete)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1861 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
1862 if (need_focus)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1863 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
1864 if (need_save)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1865 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
1866 if (count)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1867 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
1868 XA_ATOM, 32, PropModeAppend,
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1869 (unsigned char *) props, count);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1870 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1871 UNBLOCK_INPUT;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1872 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1873 #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
1874
3dafddaefc2c (x_create_im): New function to set IM and IC of a frame.
Gerd Moellmann <gerd@gnu.org>
parents: 27153
diff changeset
1875
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1876
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1877 /* Support routines for XIC (X Input Context). */
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1878
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1879 #ifdef HAVE_X_I18N
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1880
109100
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
1881 static XFontSet xic_create_xfontset (struct frame *);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
1882 static XIMStyle best_xim_style (XIMStyles *, XIMStyles *);
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1883
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1884
51130
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
1885 /* Supported XIM styles, ordered by preference. */
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1886
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1887 static XIMStyle supported_xim_styles[] =
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1888 {
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1889 XIMPreeditPosition | XIMStatusArea,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1890 XIMPreeditPosition | XIMStatusNothing,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1891 XIMPreeditPosition | XIMStatusNone,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1892 XIMPreeditNothing | XIMStatusArea,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1893 XIMPreeditNothing | XIMStatusNothing,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1894 XIMPreeditNothing | XIMStatusNone,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1895 XIMPreeditNone | XIMStatusArea,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1896 XIMPreeditNone | XIMStatusNothing,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1897 XIMPreeditNone | XIMStatusNone,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1898 0,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1899 };
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1900
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
1901
57633
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
1902 /* 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
1903
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1904 char xic_defaut_fontset[] = "-*-*-*-r-normal--14-*-*-*-*-*-*-*";
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1905
60668
34f4b9f0b40d (xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60582
diff changeset
1906 /* 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
1907 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
1908 char *
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
1909 xic_create_fontsetname (char *base_fontname, int motif)
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1910 {
60668
34f4b9f0b40d (xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60582
diff changeset
1911 const char *sep = motif ? ";" : ",";
34f4b9f0b40d (xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60582
diff changeset
1912 char *fontsetname;
34f4b9f0b40d (xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60582
diff changeset
1913
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1914 /* 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
1915 if (xic_defaut_fontset == base_fontname)
60668
34f4b9f0b40d (xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60582
diff changeset
1916 { /* 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
1917 int len = strlen (base_fontname) + 2;
34f4b9f0b40d (xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60582
diff changeset
1918 fontsetname = xmalloc (len);
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
1919 memset (fontsetname, 0, len);
60668
34f4b9f0b40d (xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60582
diff changeset
1920 strcpy (fontsetname, base_fontname);
34f4b9f0b40d (xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60582
diff changeset
1921 }
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1922 else
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1923 {
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1924 /* 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
1925 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
1926 - the base font.
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1927 - 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
1928 - 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
1929 char *p = base_fontname;
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1930 int i;
65459
41f88837ca5b (x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents: 64770
diff changeset
1931
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1932 for (i = 0; *p; p++)
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1933 if (*p == '-') i++;
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1934 if (i != 14)
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1935 { /* 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
1936 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
1937 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
1938 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
1939 fontsetname = xmalloc (len);
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
1940 memset (fontsetname, 0, len);
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1941 strcpy (fontsetname, base_fontname);
60668
34f4b9f0b40d (xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60582
diff changeset
1942 strcat (fontsetname, sep);
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1943 strcat (fontsetname, xic_defaut_fontset);
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1944 }
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1945 else
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1946 {
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1947 int len;
73448
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1948 char *p1 = NULL, *p2 = NULL, *p3 = NULL;
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1949 char *font_allcs = NULL;
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1950 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
1951 char *font_all = NULL;
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1952 char *allcs = "*-*-*-*-*-*-*";
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1953 char *allfamilies = "-*-*-";
60695
d8c3512bc427 (xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60668
diff changeset
1954 char *all = "*-*-*-*-";
73448
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1955 char *base;
65459
41f88837ca5b (x_encode_text): Declare static. Add FREEP arg.
Kim F. Storm <storm@cua.dk>
parents: 64770
diff changeset
1956
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1957 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
1958 {
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1959 if (*p == '-')
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1960 {
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1961 i++;
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1962 if (i == 3)
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1963 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
1964 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
1965 p2 = p + 1;
73448
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1966 else if (i == 6)
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1967 p3 = p + 1;
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1968 }
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1969 }
73448
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1970 /* If base_fontname specifies ADSTYLE, make it a
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1971 wildcard. */
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1972 if (*p3 != '*')
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1973 {
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1974 int diff = (p2 - p3) - 2;
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1975
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1976 base = alloca (strlen (base_fontname) + 1);
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
1977 memcpy (base, base_fontname, p3 - base_fontname);
73448
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1978 base[p3 - base_fontname] = '*';
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1979 base[(p3 - base_fontname) + 1] = '-';
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1980 strcpy (base + (p3 - base_fontname) + 2, p2);
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1981 p = base + (p - base_fontname) - diff;
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1982 p1 = base + (p1 - base_fontname);
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1983 p2 = base + (p2 - base_fontname) - diff;
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1984 base_fontname = base;
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1985 }
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1986
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1987 /* Build the font spec that matches all charsets. */
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1988 len = p - base_fontname + strlen (allcs) + 1;
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1989 font_allcs = (char *) alloca (len);
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
1990 memset (font_allcs, 0, len);
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
1991 memcpy (font_allcs, base_fontname, p - base_fontname);
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1992 strcat (font_allcs, allcs);
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1993
73448
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1994 /* Build the font spec that matches all families and
1fd4b3c12646 (xic_create_fontsetname): If ADSTYLE field is not a wild
Kenichi Handa <handa@m17n.org>
parents: 73045
diff changeset
1995 add-styles. */
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1996 len = p - p1 + strlen (allcs) + strlen (allfamilies) + 1;
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1997 font_allfamilies = (char *) alloca (len);
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
1998 memset (font_allfamilies, 0, len);
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
1999 strcpy (font_allfamilies, allfamilies);
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
2000 memcpy (font_allfamilies + strlen (allfamilies), p1, p - p1);
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
2001 strcat (font_allfamilies, allcs);
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
2002
60695
d8c3512bc427 (xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60668
diff changeset
2003 /* 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
2004 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
2005 font_all = (char *) alloca (len);
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
2006 memset (font_all, 0, len);
60695
d8c3512bc427 (xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60668
diff changeset
2007 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
2008 strcat (font_all, all);
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
2009 memcpy (font_all + strlen (all) + strlen (allfamilies), p2, p - p2);
60695
d8c3512bc427 (xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60668
diff changeset
2010 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
2011
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
2012 /* Build the actual font set name. */
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
2013 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
2014 + strlen (font_allfamilies) + strlen (font_all) + 5;
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
2015 fontsetname = xmalloc (len);
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
2016 memset (fontsetname, 0, len);
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
2017 strcpy (fontsetname, base_fontname);
60668
34f4b9f0b40d (xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60582
diff changeset
2018 strcat (fontsetname, sep);
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
2019 strcat (fontsetname, font_allcs);
60668
34f4b9f0b40d (xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60582
diff changeset
2020 strcat (fontsetname, sep);
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
2021 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
2022 strcat (fontsetname, sep);
d8c3512bc427 (xic_create_fontsetname): Add a final catch-all font pattern.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60668
diff changeset
2023 strcat (fontsetname, font_all);
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
2024 }
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
2025 }
60668
34f4b9f0b40d (xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60582
diff changeset
2026 if (motif)
34f4b9f0b40d (xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60582
diff changeset
2027 strcat (fontsetname, ":");
34f4b9f0b40d (xic_create_fontsetname): Add `motif' argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60582
diff changeset
2028 return fontsetname;
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
2029 }
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
2030
90724
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2031 #ifdef DEBUG_XIC_FONTSET
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2032 static void
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2033 print_fontset_result (xfs, name, missing_list, missing_count)
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2034 XFontSet xfs;
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2035 char *name;
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2036 char **missing_list;
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2037 int missing_count;
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2038 {
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2039 if (xfs)
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2040 fprintf (stderr, "XIC Fontset created: %s\n", name);
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2041 else
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2042 {
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2043 fprintf (stderr, "XIC Fontset failed: %s\n", name);
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2044 while (missing_count-- > 0)
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2045 {
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2046 fprintf (stderr, " missing: %s\n", *missing_list);
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2047 missing_list++;
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2048 }
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2049 }
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2050
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2051 }
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2052 #endif
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2053
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2054 static XFontSet
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
2055 xic_create_xfontset (struct frame *f)
90693
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2056 {
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2057 XFontSet xfs = NULL;
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
2058 struct font *font = FRAME_FONT (f);
90693
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2059 int pixel_size = font->pixel_size;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2060 Lisp_Object rest, frame;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2061
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2062 /* See if there is another frame already using same fontset. */
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2063 FOR_EACH_FRAME (rest, frame)
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2064 {
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2065 struct frame *cf = XFRAME (frame);
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2066
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2067 if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf)
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2068 && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f)
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
2069 && FRAME_FONT (f)
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
2070 && FRAME_FONT (f)->pixel_size == pixel_size)
90693
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2071 {
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2072 xfs = FRAME_XIC_FONTSET (cf);
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2073 break;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2074 }
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2075 }
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2076
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2077 if (! xfs)
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2078 {
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2079 char buf[256];
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2080 char **missing_list;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2081 int missing_count;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2082 char *def_string;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2083 char *xlfd_format = "-*-*-medium-r-normal--%d-*-*-*-*-*";
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2084
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2085 sprintf (buf, xlfd_format, pixel_size);
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2086 missing_list = NULL;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2087 xfs = XCreateFontSet (FRAME_X_DISPLAY (f), buf,
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2088 &missing_list, &missing_count, &def_string);
90719
3bba05d0a63c (xic_create_xfontset2): Add debug code.
Kenichi Handa <handa@m17n.org>
parents: 90693
diff changeset
2089 #ifdef DEBUG_XIC_FONTSET
90721
83fbeead74c9 Fix previous change.
Kenichi Handa <handa@m17n.org>
parents: 90720
diff changeset
2090 print_fontset_result (xfs, buf, missing_list, missing_count);
90719
3bba05d0a63c (xic_create_xfontset2): Add debug code.
Kenichi Handa <handa@m17n.org>
parents: 90693
diff changeset
2091 #endif
90693
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2092 if (missing_list)
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2093 XFreeStringList (missing_list);
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2094 if (! xfs)
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2095 {
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2096 /* List of pixel sizes most likely available. Find one that
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2097 is closest to pixel_size. */
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2098 int sizes[] = {0, 8, 10, 11, 12, 14, 17, 18, 20, 24, 26, 34, 0};
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2099 int *smaller, *larger;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2100
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2101 for (smaller = sizes; smaller[1]; smaller++)
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2102 if (smaller[1] >= pixel_size)
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2103 break;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2104 larger = smaller + 1;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2105 if (*larger == pixel_size)
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2106 larger++;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2107 while (*smaller || *larger)
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2108 {
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2109 int this_size;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2110
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2111 if (! *larger)
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2112 this_size = *smaller--;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2113 else if (! *smaller)
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2114 this_size = *larger++;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2115 else if (pixel_size - *smaller < *larger - pixel_size)
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2116 this_size = *smaller--;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2117 else
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2118 this_size = *larger++;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2119 sprintf (buf, xlfd_format, this_size);
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2120 missing_list = NULL;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2121 xfs = XCreateFontSet (FRAME_X_DISPLAY (f), buf,
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2122 &missing_list, &missing_count, &def_string);
90719
3bba05d0a63c (xic_create_xfontset2): Add debug code.
Kenichi Handa <handa@m17n.org>
parents: 90693
diff changeset
2123 #ifdef DEBUG_XIC_FONTSET
90721
83fbeead74c9 Fix previous change.
Kenichi Handa <handa@m17n.org>
parents: 90720
diff changeset
2124 print_fontset_result (xfs, buf, missing_list, missing_count);
90719
3bba05d0a63c (xic_create_xfontset2): Add debug code.
Kenichi Handa <handa@m17n.org>
parents: 90693
diff changeset
2125 #endif
90693
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2126 if (missing_list)
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2127 XFreeStringList (missing_list);
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2128 if (xfs)
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2129 break;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2130 }
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2131 }
90724
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2132 if (! xfs)
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2133 {
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2134 char *last_resort = "-*-*-*-r-normal--*-*-*-*-*-*";
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2135
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2136 missing_list = NULL;
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2137 xfs = XCreateFontSet (FRAME_X_DISPLAY (f), last_resort,
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2138 &missing_list, &missing_count, &def_string);
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2139 #ifdef DEBUG_XIC_FONTSET
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2140 print_fontset_result (xfs, last_resort, missing_list, missing_count);
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2141 #endif
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2142 if (missing_list)
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2143 XFreeStringList (missing_list);
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2144 }
96bde39d99b2 Add more debug info.
Kenichi Handa <handa@m17n.org>
parents: 90721
diff changeset
2145
90693
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2146 }
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2147
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2148 return xfs;
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2149 }
42871c3ee387 (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
Kenichi Handa <handa@m17n.org>
parents: 90662
diff changeset
2150
57633
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2151 /* 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
2152
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2153 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
2154 xic_free_xfontset (struct frame *f)
57633
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2155 {
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2156 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
2157 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
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 (!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
2160 return;
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2161
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2162 /* 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
2163 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
2164 {
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2165 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
2166 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
2167 && 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
2168 && 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
2169 {
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2170 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
2171 break;
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2172 }
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2173 }
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2174
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2175 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
2176 /* 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
2177 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
2178
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2179 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
2180 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
2181 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
2182 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
2183 }
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2184
27502
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 /* 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
2187 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
2188 input method XIM. */
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 static XIMStyle
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
2191 best_xim_style (XIMStyles *user, XIMStyles *xim)
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2192 {
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2193 int i, j;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2194
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2195 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
2196 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
2197 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
2198 return user->supported_styles[i];
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2199
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2200 /* Return the default style. */
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2201 return XIMPreeditNothing | XIMStatusNothing;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2202 }
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2203
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2204 /* Create XIC for frame F. */
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2205
35592
52b5b50a0604 (xic_style): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 35579
diff changeset
2206 static XIMStyle xic_style;
52b5b50a0604 (xic_style): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 35579
diff changeset
2207
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2208 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
2209 create_frame_xic (struct frame *f)
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2210 {
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2211 XIM xim;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2212 XIC xic = NULL;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2213 XFontSet xfs = NULL;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2214
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2215 if (FRAME_XIC (f))
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2216 return;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2217
60582
c2a74bfb2e79 (xic_defaut_fontset): New constant.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 60555
diff changeset
2218 /* Create X fontset. */
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
2219 xfs = xic_create_xfontset (f);
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2220 xim = FRAME_X_XIM (f);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2221 if (xim)
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2222 {
27659
4137c807296b (create_frame_xic): Fix initialization of automatic aggregates for pcc.
Dave Love <fx@gnu.org>
parents: 27502
diff changeset
2223 XRectangle s_area;
4137c807296b (create_frame_xic): Fix initialization of automatic aggregates for pcc.
Dave Love <fx@gnu.org>
parents: 27502
diff changeset
2224 XPoint spot;
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2225 XVaNestedList preedit_attr;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2226 XVaNestedList status_attr;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2227
27659
4137c807296b (create_frame_xic): Fix initialization of automatic aggregates for pcc.
Dave Love <fx@gnu.org>
parents: 27502
diff changeset
2228 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
2229 spot.x = 0; spot.y = 1;
27502
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 /* Determine XIC style. */
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2232 if (xic_style == 0)
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2233 {
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2234 XIMStyles supported_list;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2235 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
2236 / sizeof supported_xim_styles[0]);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2237 supported_list.supported_styles = supported_xim_styles;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2238 xic_style = best_xim_style (&supported_list,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2239 FRAME_X_XIM_STYLES (f));
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2240 }
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2241
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2242 preedit_attr = XVaCreateNestedList (0,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2243 XNFontSet, xfs,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2244 XNForeground,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2245 FRAME_FOREGROUND_PIXEL (f),
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2246 XNBackground,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2247 FRAME_BACKGROUND_PIXEL (f),
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2248 (xic_style & XIMPreeditPosition
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2249 ? XNSpotLocation
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2250 : NULL),
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2251 &spot,
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 status_attr = XVaCreateNestedList (0,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2254 XNArea,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2255 &s_area,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2256 XNFontSet,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2257 xfs,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2258 XNForeground,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2259 FRAME_FOREGROUND_PIXEL (f),
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2260 XNBackground,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2261 FRAME_BACKGROUND_PIXEL (f),
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2262 NULL);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2263
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2264 xic = XCreateIC (xim,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2265 XNInputStyle, xic_style,
53069
1218a42792ea Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents: 53027
diff changeset
2266 XNClientWindow, FRAME_X_WINDOW (f),
1218a42792ea Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents: 53027
diff changeset
2267 XNFocusWindow, FRAME_X_WINDOW (f),
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2268 XNStatusAttributes, status_attr,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2269 XNPreeditAttributes, preedit_attr,
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2270 NULL);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2271 XFree (preedit_attr);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2272 XFree (status_attr);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2273 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2274
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2275 FRAME_XIC (f) = xic;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2276 FRAME_XIC_STYLE (f) = xic_style;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2277 FRAME_XIC_FONTSET (f) = xfs;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2278 }
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2279
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2280
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2281 /* 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
2282
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2283 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
2284 free_frame_xic (struct frame *f)
27502
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 if (FRAME_XIC (f) == NULL)
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2287 return;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2288
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2289 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
2290 xic_free_xfontset (f);
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2291
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2292 FRAME_XIC (f) = NULL;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2293 }
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
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2296 /* 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
2297 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
2298
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2299 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
2300 xic_set_preeditarea (struct window *w, int x, int y)
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2301 {
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2302 struct frame *f = XFRAME (w->frame);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2303 XVaNestedList attr;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2304 XPoint spot;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2305
52059
4b5692f6703a (xic_set_preeditarea): Add the left fringe width to spot.x.
Kenichi Handa <handa@m17n.org>
parents: 52015
diff changeset
2306 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
2307 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
2308 attr = XVaCreateNestedList (0, XNSpotLocation, &spot, NULL);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2309 XSetICValues (FRAME_XIC (f), XNPreeditAttributes, attr, NULL);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2310 XFree (attr);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2311 }
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
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2314 /* 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
2315
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2316 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
2317 xic_set_statusarea (struct frame *f)
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2318 {
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2319 XIC xic = FRAME_XIC (f);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2320 XVaNestedList attr;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2321 XRectangle area;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2322 XRectangle *needed;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2323
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2324 /* 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
2325 status area, use its current size. */
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2326 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
2327 attr = XVaCreateNestedList (0, XNAreaNeeded, &area, NULL);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2328 XSetICValues (xic, XNStatusAttributes, attr, NULL);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2329 XFree (attr);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2330
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2331 attr = XVaCreateNestedList (0, XNAreaNeeded, &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 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
2336 {
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2337 attr = XVaCreateNestedList (0, XNArea, &needed, NULL);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2338 XGetICValues (xic, XNStatusAttributes, attr, NULL);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2339 XFree (attr);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2340 }
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2341
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2342 area.width = needed->width;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2343 area.height = needed->height;
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
2344 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
2345 area.y = (FRAME_PIXEL_HEIGHT (f) - area.height
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
2346 - FRAME_MENUBAR_HEIGHT (f)
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
2347 - FRAME_TOOLBAR_HEIGHT (f)
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
2348 - FRAME_INTERNAL_BORDER_WIDTH (f));
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2349 XFree (needed);
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 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
2352 XSetICValues (xic, XNStatusAttributes, attr, NULL);
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2353 XFree (attr);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2354 }
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2355
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2356
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2357 /* 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
2358 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
2359
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2360 void
109555
05e7e7c46ff0 Use const, move declarations to header files.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109445
diff changeset
2361 xic_set_xfontset (struct frame *f, const char *base_fontname)
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2362 {
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2363 XVaNestedList attr;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2364 XFontSet xfs;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2365
57633
ead4249849ac * xterm.h (x_output): New member `xic_base_fontname'.
Jan Djärv <jan.h.d@swipnet.se>
parents: 57432
diff changeset
2366 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
2367
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
2368 xfs = xic_create_xfontset (f);
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2369
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2370 attr = XVaCreateNestedList (0, XNFontSet, xfs, NULL);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2371 if (FRAME_XIC_STYLE (f) & XIMPreeditPosition)
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2372 XSetICValues (FRAME_XIC (f), XNPreeditAttributes, attr, NULL);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2373 if (FRAME_XIC_STYLE (f) & XIMStatusArea)
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2374 XSetICValues (FRAME_XIC (f), XNStatusAttributes, attr, NULL);
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2375 XFree (attr);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2376
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2377 FRAME_XIC_FONTSET (f) = xfs;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2378 }
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2379
27157
3dafddaefc2c (x_create_im): New function to set IM and IC of a frame.
Gerd Moellmann <gerd@gnu.org>
parents: 27153
diff changeset
2380 #endif /* HAVE_X_I18N */
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2381
27157
3dafddaefc2c (x_create_im): New function to set IM and IC of a frame.
Gerd Moellmann <gerd@gnu.org>
parents: 27153
diff changeset
2382
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2383
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2384 #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
2385
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2386 /* 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
2387
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2388 static void
109372
dd04c65fb401 Convert function definitions to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109364
diff changeset
2389 x_window (struct frame *f, long window_prompting, int minibuffer_only)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2390 {
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2391 XClassHint class_hints;
6059
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2392 XSetWindowAttributes attributes;
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2393 unsigned long attribute_mask;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2394 Widget shell_widget;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2395 Widget pane_widget;
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2396 Widget frame_widget;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2397 Arg al [25];
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2398 int ac;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2399
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2400 BLOCK_INPUT;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2401
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2402 /* 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
2403 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
2404 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
2405
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2406 Elsewhere we specify the window name for the window manager. */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2407
11496
db02849ee365 (x_window): Use (or reuse) frame's namebuf instead of a
Karl Heuer <kwzh@gnu.org>
parents: 11483
diff changeset
2408 {
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46295
diff changeset
2409 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
2410 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
2411 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
2412 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2413
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2414 ac = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2415 XtSetArg (al[ac], XtNallowShellResize, 1); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2416 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
2417 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
2418 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
2419 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
2420 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
2421 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
2422 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
2423 applicationShellWidgetClass,
9742
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
2424 FRAME_X_DISPLAY (f), al, ac);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2425
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2426 f->output_data.x->widget = shell_widget;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2427 /* maybe_set_screen_title_format (shell_widget); */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2428
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2429 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
2430 (widget_value *) NULL,
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2431 shell_widget, False,
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2432 (lw_callback) NULL,
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2433 (lw_callback) NULL,
27343
43230463dfcf (x_window): Call lw_create_widget with new parameter
Gerd Moellmann <gerd@gnu.org>
parents: 27157
diff changeset
2434 (lw_callback) NULL,
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2435 (lw_callback) NULL);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2436
27987
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
2437 ac = 0;
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
2438 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
2439 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
2440 XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++;
109184
04ae6087d3c0 Fix frame sizing for Lucid/Motif/Lesstif.
Jan D <jan.h.d@swipnet.se>
parents: 109179
diff changeset
2441 XtSetArg (al[ac], XtNborderWidth, 0); ac++;
27987
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
2442 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
2443 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
2444
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2445 /* 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
2446 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
2447
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2448 ac = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2449 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2450 XtSetArg (al[ac], XtNshowGrip, 0); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2451 XtSetArg (al[ac], XtNallowResize, 1); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2452 XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2453 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
2454 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
2455 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
2456 XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++;
109184
04ae6087d3c0 Fix frame sizing for Lucid/Motif/Lesstif.
Jan D <jan.h.d@swipnet.se>
parents: 109179
diff changeset
2457 XtSetArg (al[ac], XtNborderWidth, 0); ac++;
27987
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
2458 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
2459 al, ac);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2460
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2461 f->output_data.x->edit_widget = frame_widget;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2462
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2463 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
2464
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 /* 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
2466 {
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 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
2468 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
2469 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
2470 int ac = 0;
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2471 int extra_borders = 0;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2472 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
2473 = (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
2474 ? (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
2475 + 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
2476 : 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
2477
15942
ff30ec8aab54 (x_window): Don't add ibw to menubar_size.
Richard M. Stallman <rms@gnu.org>
parents: 15891
diff changeset
2478 #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
2479 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
2480 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
2481 {
9808
4c43c9dbe130 (x_window): Make ibw 0 by default.
Richard M. Stallman <rms@gnu.org>
parents: 9742
diff changeset
2482 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
2483 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
2484 menubar_size += ibw;
7f15f77cb644 (x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents: 7946
diff changeset
2485 }
15942
ff30ec8aab54 (x_window): Don't add ibw to menubar_size.
Richard M. Stallman <rms@gnu.org>
parents: 15891
diff changeset
2486 #endif
7969
7f15f77cb644 (x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents: 7946
diff changeset
2487
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2488 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
2489
16305
00e57c8adaba (x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents: 16302
diff changeset
2490 #ifndef USE_LUCID
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2491 /* 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
2492 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
2493 Both conclusions reached experimentally. -- rms. */
16305
00e57c8adaba (x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents: 16302
diff changeset
2494 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
2495 &extra_borders, NULL);
00e57c8adaba (x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents: 16302
diff changeset
2496 extra_borders *= 2;
00e57c8adaba (x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents: 16302
diff changeset
2497 #endif
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2498
11707
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2499 /* 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
2500 and specify it.
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2501 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
2502 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
2503 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
2504 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
2505 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
2506 int xneg = window_prompting & XNegative;
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
2507 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
2508 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
2509 if (xneg)
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2510 left = -left;
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2511 if (yneg)
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2512 top = -top;
11893
1f70ffad3d6d [USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents: 11882
diff changeset
2513
1f70ffad3d6d [USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents: 11882
diff changeset
2514 if (window_prompting & USPosition)
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2515 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
2516 FRAME_PIXEL_WIDTH (f) + extra_borders,
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
2517 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
2518 (xneg ? '-' : '+'), left,
1f70ffad3d6d [USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents: 11882
diff changeset
2519 (yneg ? '-' : '+'), top);
1f70ffad3d6d [USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents: 11882
diff changeset
2520 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
2521 {
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 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
2523 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
2524 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
2525
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 /* 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
2527 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
2528 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
2529 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
2530 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
2531 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
2532 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
2533 }
11707
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2534 }
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2535
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
2536 len = strlen (shell_position) + 1;
17579
8dd146dbe737 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17556
diff changeset
2537 /* We don't free this because we don't know whether
8dd146dbe737 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17556
diff changeset
2538 it is safe to free it while the frame exists.
8dd146dbe737 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17556
diff changeset
2539 It isn't worth the trouble of arranging to free it
8dd146dbe737 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17556
diff changeset
2540 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
2541 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
2542 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
2543 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
2544 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
2545 }
bb11213734d6 (x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6523
diff changeset
2546
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2547 XtManageChild (pane_widget);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2548 XtRealizeWidget (shell_widget);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2549
91633
e33a0659fabe (Fx_create_frame): Do not override the explicitly set parent
Jan Djärv <jan.h.d@swipnet.se>
parents: 91327
diff changeset
2550 if (FRAME_X_EMBEDDED_P (f))
e33a0659fabe (Fx_create_frame): Do not override the explicitly set parent
Jan Djärv <jan.h.d@swipnet.se>
parents: 91327
diff changeset
2551 XReparentWindow (FRAME_X_DISPLAY (f), XtWindow (shell_widget),
e33a0659fabe (Fx_create_frame): Do not override the explicitly set parent
Jan Djärv <jan.h.d@swipnet.se>
parents: 91327
diff changeset
2552 f->output_data.x->parent_desc, 0, 0);
e33a0659fabe (Fx_create_frame): Do not override the explicitly set parent
Jan Djärv <jan.h.d@swipnet.se>
parents: 91327
diff changeset
2553
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2554 FRAME_X_WINDOW (f) = XtWindow (frame_widget);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2555
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2556 validate_x_resource_name ();
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2557
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46295
diff changeset
2558 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
2559 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
2560 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
2561
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2562 #ifdef HAVE_X_I18N
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2563 FRAME_XIC (f) = NULL;
51130
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2564 if (use_xim)
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2565 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
2566 #endif
13227
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2567
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2568 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
2569 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
2570 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
2571 &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
2572
9703
85ac0e4030d4 (x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents: 9690
diff changeset
2573 hack_wm_protocols (f, shell_widget);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2574
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2575 #ifdef HACK_EDITRES
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2576 XtAddEventHandler (shell_widget, 0, True, _XEditResCheckMessages, 0);
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2577 #endif
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2578
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2579 /* 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
2580 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
2581 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
2582 */
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2583 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
2584 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
2585 XA_ATOM, 32, PropModeAppend,
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2586 (unsigned char*) NULL, 0);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2587
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2588 /* 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
2589 attributes.event_mask = STANDARD_EVENT_SET;
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2590
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2591 #ifdef HAVE_X_I18N
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2592 if (FRAME_XIC (f))
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2593 {
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2594 /* XIM server might require some X events. */
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2595 unsigned long fevent = NoEventMask;
53069
1218a42792ea Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents: 53027
diff changeset
2596 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
2597 attributes.event_mask |= fevent;
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2598 }
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2599 #endif /* HAVE_X_I18N */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2600
6059
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2601 attribute_mask = CWEventMask;
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2602 XChangeWindowAttributes (XtDisplay (shell_widget), XtWindow (shell_widget),
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2603 attribute_mask, &attributes);
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2604
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2605 XtMapWidget (frame_widget);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2606
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2607 /* x_set_name normally ignores requests to set the name if the
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2608 requested name is the same as the current name. This is the one
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2609 place where that assumption isn't correct; f->name is set, but
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2610 the X server hasn't been told. */
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2611 {
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2612 Lisp_Object name;
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2613 int explicit = f->explicit_name;
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2614
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2615 f->explicit_name = 0;
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2616 name = f->name;
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2617 f->name = Qnil;
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2618 x_set_name (f, name, explicit);
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2619 }
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2620
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2621 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
103705
bc2b1f7e7bc0 Fix typo.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103704
diff changeset
2622 f->output_data.x->current_cursor
bc2b1f7e7bc0 Fix typo.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103704
diff changeset
2623 = 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
2624
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2625 UNBLOCK_INPUT;
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2626
25320
107c9221181c (x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents: 25289
diff changeset
2627 /* 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
2628 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
2629 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
2630 }
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2631
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2632 #else /* not USE_X_TOOLKIT */
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
2633 #ifdef USE_GTK
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
2634 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
2635 x_window (FRAME_PTR f)
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
2636 {
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
2637 if (! xg_create_frame_widgets (f))
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
2638 error ("Unable to create window");
49434
a4d0ee33dcce Fix input methods for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents: 49322
diff changeset
2639
a4d0ee33dcce Fix input methods for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents: 49322
diff changeset
2640 #ifdef HAVE_X_I18N
a4d0ee33dcce Fix input methods for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents: 49322
diff changeset
2641 FRAME_XIC (f) = NULL;
54185
f6e4e454800a xfns.c (x_window): Fixed indentation
Jan Djärv <jan.h.d@swipnet.se>
parents: 54142
diff changeset
2642 if (use_xim)
51130
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2643 {
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2644 BLOCK_INPUT;
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2645 create_frame_xic (f);
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2646 if (FRAME_XIC (f))
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2647 {
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2648 /* XIM server might require some X events. */
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2649 unsigned long fevent = NoEventMask;
53069
1218a42792ea Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents: 53027
diff changeset
2650 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
2651
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2652 if (fevent != NoEventMask)
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2653 {
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2654 XSetWindowAttributes attributes;
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2655 XWindowAttributes wattr;
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2656 unsigned long attribute_mask;
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 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
2659 &wattr);
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2660 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
2661 attribute_mask = CWEventMask;
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2662 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
2663 attribute_mask, &attributes);
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2664 }
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2665 }
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2666 UNBLOCK_INPUT;
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2667 }
49434
a4d0ee33dcce Fix input methods for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents: 49322
diff changeset
2668 #endif
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
2669 }
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
2670
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
2671 #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
2672 /* 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
2673
21846
486ac68ce051 Fix -Wimplicit warnings.
Andreas Schwab <schwab@suse.de>
parents: 21779
diff changeset
2674 void
109374
88a5b905a895 Convert function definitions to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109372
diff changeset
2675 x_window (struct frame *f)
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2676 {
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2677 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
2678 XSetWindowAttributes attributes;
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2679 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
2680
83505
57e924639750 Fix previous commit.
Karoly Lorentey <lorentey@elte.hu>
parents: 83504
diff changeset
2681 attributes.background_pixel = FRAME_BACKGROUND_PIXEL (f);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2682 attributes.border_pixel = f->output_data.x->border_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2683 attributes.bit_gravity = StaticGravity;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2684 attributes.backing_store = NotUseful;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2685 attributes.save_under = True;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2686 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
2687 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
2688 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
2689 | CWColormap);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2690
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2691 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
2692 FRAME_X_WINDOW (f)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2693 = 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
2694 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
2695 f->left_pos,
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
2696 f->top_pos,
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
2697 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
2698 f->border_width,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2699 CopyFromParent, /* depth */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2700 InputOutput, /* class */
28144
71ebba3566ec (X_I18N_INHIBITED): Don't define.
Gerd Moellmann <gerd@gnu.org>
parents: 28096
diff changeset
2701 FRAME_X_VISUAL (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2702 attribute_mask, &attributes);
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2703
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2704 #ifdef HAVE_X_I18N
51175
a072cc265dff (x_window): Fix typo.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 51130
diff changeset
2705 if (use_xim)
51130
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2706 {
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2707 create_frame_xic (f);
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2708 if (FRAME_XIC (f))
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2709 {
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2710 /* XIM server might require some X events. */
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2711 unsigned long fevent = NoEventMask;
53069
1218a42792ea Implement multiple display handling for GTK.
Jan Djärv <jan.h.d@swipnet.se>
parents: 53027
diff changeset
2712 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
2713 attributes.event_mask |= fevent;
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2714 attribute_mask = CWEventMask;
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2715 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
2716 attribute_mask, &attributes);
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2717 }
0e2a60d0ca7b (x_window, x_window): Use use_xim.
Dave Love <fx@gnu.org>
parents: 50392
diff changeset
2718 }
27502
52e8cb1333f2 (xic_set_preeditarea): Take window parameter and
Gerd Moellmann <gerd@gnu.org>
parents: 27343
diff changeset
2719 #endif /* HAVE_X_I18N */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2720
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2721 validate_x_resource_name ();
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2722
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46295
diff changeset
2723 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
2724 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
2725 XSetClassHint (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &class_hints);
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2726
11897
cbd3724a9696 (x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents: 11894
diff changeset
2727 /* 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
2728 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
2729 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
2730
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
2731 /* 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
2732 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
2733 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
2734 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
2735
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2736 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
2737 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
2738 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
2739 &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
2740 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
2741
26a1d7b2670b (x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents: 7802
diff changeset
2742 /* 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
2743 {
26a1d7b2670b (x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents: 7802
diff changeset
2744 Atom protocols[2];
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2745 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
2746 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
2747 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
2748 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2749
817
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2750 /* x_set_name normally ignores requests to set the name if the
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2751 requested name is the same as the current name. This is the one
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2752 place where that assumption isn't correct; f->name is set, but
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2753 the X server hasn't been told. */
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2754 {
6519
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
2755 Lisp_Object name;
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2756 int explicit = f->explicit_name;
817
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2757
6519
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
2758 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
2759 name = f->name;
817
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2760 f->name = Qnil;
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2761 x_set_name (f, name, explicit);
817
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2762 }
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2763
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2764 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
103706
795208dc99c5 And again...
Jan Djärv <jan.h.d@swipnet.se>
parents: 103705
diff changeset
2765 f->output_data.x->current_cursor
795208dc99c5 And again...
Jan Djärv <jan.h.d@swipnet.se>
parents: 103705
diff changeset
2766 = f->output_data.x->text_cursor);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2767
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2768 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2769
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
2770 if (FRAME_X_WINDOW (f) == 0)
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2771 error ("Unable to create window");
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2772 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2773
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
2774 #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
2775 #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
2776
56513
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
2777 /* 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
2778
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
2779 static void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
2780 x_icon_verify (struct frame *f, Lisp_Object parms)
56513
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
2781 {
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
2782 Lisp_Object icon_x, icon_y;
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
2783
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
2784 /* 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
2785 icons in an icon window. */
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
2786 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
2787 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
2788 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
2789 {
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
2790 CHECK_NUMBER (icon_x);
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
2791 CHECK_NUMBER (icon_y);
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
2792 }
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
2793 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
2794 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
2795 }
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
2796
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2797 /* Handle the icon stuff for this window. Perhaps later we might
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2798 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
2799 well. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2800
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2801 static void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
2802 x_icon (struct frame *f, Lisp_Object parms)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2803 {
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2804 Lisp_Object icon_x, icon_y;
83760
aa5347e75afa (check_x_display_info): Yet Another Int/Lisp_Object Mixup.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83648
diff changeset
2805 #if 0
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2806 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
83760
aa5347e75afa (check_x_display_info): Yet Another Int/Lisp_Object Mixup.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83648
diff changeset
2807 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2808
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2809 /* 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
2810 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
2811 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
2812 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
2813 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2814 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
2815 CHECK_NUMBER (icon_x);
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
2816 CHECK_NUMBER (icon_y);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2817 }
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2818 else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2819 error ("Both left and top icon corners of icon must be specified");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2820
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2821 BLOCK_INPUT;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2822
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
2823 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
2824 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
2825
69428
1b5fec6d607f (x_icon): Disable redundant call to `x_wm_set_window_state'.
Károly Lőrentey <lorentey@elte.hu>
parents: 69404
diff changeset
2826 #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
2827 but x_create_frame still needs it. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2828 /* 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
2829 x_wm_set_window_state
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
2830 (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
2831 Qicon)
2294
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
2832 ? IconicState
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
2833 : 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
2834 #endif
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2835
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46295
diff changeset
2836 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
2837 ? 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
2838 : f->name)));
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
2839
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2840 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2841 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2842
31637
c1f4bdbf8465 (ALLOC_XPM_COLORS): Define if we can use Emacs' color
Gerd Moellmann <gerd@gnu.org>
parents: 31633
diff changeset
2843 /* Make the GCs needed for this window, setting the
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2844 background, border and mouse colors; also create the
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2845 mouse cursor and the gray border tile. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2846
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2847 static void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
2848 x_make_gc (struct frame *f)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2849 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2850 XGCValues gc_values;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2851
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
2852 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
2853
31637
c1f4bdbf8465 (ALLOC_XPM_COLORS): Define if we can use Emacs' color
Gerd Moellmann <gerd@gnu.org>
parents: 31633
diff changeset
2854 /* Create the GCs of this frame.
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2855 Note that many default values are used. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2856
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
2857 gc_values.foreground = FRAME_FOREGROUND_PIXEL (f);
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
2858 gc_values.background = FRAME_BACKGROUND_PIXEL (f);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2859 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
2860 f->output_data.x->normal_gc
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2861 = XCreateGC (FRAME_X_DISPLAY (f),
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2862 FRAME_X_WINDOW (f),
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
2863 GCLineWidth | GCForeground | GCBackground,
34321
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2864 &gc_values);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2865
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2866 /* Reverse video style. */
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
2867 gc_values.foreground = FRAME_BACKGROUND_PIXEL (f);
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
2868 gc_values.background = FRAME_FOREGROUND_PIXEL (f);
34321
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2869 f->output_data.x->reverse_gc
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2870 = XCreateGC (FRAME_X_DISPLAY (f),
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2871 FRAME_X_WINDOW (f),
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
2872 GCForeground | GCBackground | GCLineWidth,
34321
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2873 &gc_values);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2874
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2875 /* Cursor has cursor-color background, background-color foreground. */
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
2876 gc_values.foreground = FRAME_BACKGROUND_PIXEL (f);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2877 gc_values.background = f->output_data.x->cursor_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2878 gc_values.fill_style = FillOpaqueStippled;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2879 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
2880 = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
2881 (GCForeground | GCBackground
101237
bcad6975ee7a (x_make_gc): Don't allocate stipple member for gc_values; it is not
Chong Yidong <cyd@stupidchicken.com>
parents: 100951
diff changeset
2882 | GCFillStyle | GCLineWidth),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2883 &gc_values);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2884
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
2885 /* Reliefs. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
2886 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
2887 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
2888
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2889 /* Create the gray border tile used when the pointer is not in
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2890 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
2891 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
2892 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
2893 = (XCreatePixmapFromBitmapData
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2894 (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
2895 gray_bits, gray_width, gray_height,
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
2896 FRAME_FOREGROUND_PIXEL (f),
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
2897 FRAME_BACKGROUND_PIXEL (f),
37253
7c3a00620335 (compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents: 37210
diff changeset
2898 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
2899
1982e2983822 * xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents: 2328
diff changeset
2900 UNBLOCK_INPUT;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2901 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2902
34321
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2903
105426
d0a6d64c3cfc Fix typos in comments.
Juanma Barranquero <lekktu@gmail.com>
parents: 104815
diff changeset
2904 /* Free what was allocated in x_make_gc. */
34321
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2905
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2906 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
2907 x_free_gcs (struct frame *f)
34321
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2908 {
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2909 Display *dpy = FRAME_X_DISPLAY (f);
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2910
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2911 BLOCK_INPUT;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2912
34321
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2913 if (f->output_data.x->normal_gc)
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 XFreeGC (dpy, f->output_data.x->normal_gc);
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2916 f->output_data.x->normal_gc = 0;
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2917 }
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2918
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2919 if (f->output_data.x->reverse_gc)
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 XFreeGC (dpy, f->output_data.x->reverse_gc);
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2922 f->output_data.x->reverse_gc = 0;
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2923 }
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->cursor_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->cursor_gc);
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2928 f->output_data.x->cursor_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->border_tile)
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 XFreePixmap (dpy, f->output_data.x->border_tile);
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2934 f->output_data.x->border_tile = 0;
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2935 }
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2936
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2937 UNBLOCK_INPUT;
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
41ecc8525dbc (x_free_gcs): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 33994
diff changeset
2940
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2941 /* 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
2942 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
2943 constructed. */
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2944
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2945 static Lisp_Object
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
2946 unwind_create_frame (Lisp_Object frame)
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2947 {
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2948 struct frame *f = XFRAME (frame);
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2949
83281
b00208784797 Prevent core dump when connection is lost during frame creation.
Karoly Lorentey <lorentey@elte.hu>
parents: 83277
diff changeset
2950 /* If frame is already dead, nothing to do. This can happen if the
b00208784797 Prevent core dump when connection is lost during frame creation.
Karoly Lorentey <lorentey@elte.hu>
parents: 83277
diff changeset
2951 display is disconnected after the frame has become official, but
b00208784797 Prevent core dump when connection is lost during frame creation.
Karoly Lorentey <lorentey@elte.hu>
parents: 83277
diff changeset
2952 before x_create_frame removes the unwind protect. */
b00208784797 Prevent core dump when connection is lost during frame creation.
Karoly Lorentey <lorentey@elte.hu>
parents: 83277
diff changeset
2953 if (!FRAME_LIVE_P (f))
b00208784797 Prevent core dump when connection is lost during frame creation.
Karoly Lorentey <lorentey@elte.hu>
parents: 83277
diff changeset
2954 return Qnil;
b00208784797 Prevent core dump when connection is lost during frame creation.
Karoly Lorentey <lorentey@elte.hu>
parents: 83277
diff changeset
2955
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2956 /* If frame is ``official'', nothing to do. */
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2957 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
2958 {
34895
53e52b3525bf Use #if GLYPH_DEBUG instead of #ifdef GLYPH_DEBUG.
Gerd Moellmann <gerd@gnu.org>
parents: 34662
diff changeset
2959 #if GLYPH_DEBUG
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2960 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
2961 #endif
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2962
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2963 x_free_frame_resources (f);
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2964
59904
adc18da68682 (unwind_create_frame) [!GLYPH_DEBUG]: Fix xassert.
Kim F. Storm <storm@cua.dk>
parents: 59789
diff changeset
2965 #if GLYPH_DEBUG
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2966 /* Check that reference counts are indeed correct. */
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2967 xassert (dpyinfo->reference_count == dpyinfo_refcount);
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2968 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
2969 #endif
34638
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34598
diff changeset
2970 return Qt;
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2971 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
2972
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2973 return Qnil;
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2974 }
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
2975
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
2976
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
2977 static void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
2978 x_default_font_parameter (struct frame *f, Lisp_Object parms)
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
2979 {
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
2980 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
96084
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
2981 Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL,
106085
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
2982 RES_TYPE_STRING);
109035
20747b4a7983 Don't use font names from GConf if font backend can't handle it (bug#6478).
Jan D. <jan.h.d@swipnet.se>
parents: 107850
diff changeset
2983 Lisp_Object font = Qnil;
96084
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
2984 if (EQ (font_param, Qunbound))
106162
4cee82a6f25b Always suggest system font because .emacs may not have been read yet.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106098
diff changeset
2985 font_param = Qnil;
4cee82a6f25b Always suggest system font because .emacs may not have been read yet.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106098
diff changeset
2986
4cee82a6f25b Always suggest system font because .emacs may not have been read yet.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106098
diff changeset
2987 if (NILP (font_param))
106085
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
2988 {
109069
325f0ae2b5bf xfns.c (x_default_font_parameter): Remove got_from_system (Bug#6526).
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
2989 /* System font should take precedendce over X resources. We suggest this
106162
4cee82a6f25b Always suggest system font because .emacs may not have been read yet.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106098
diff changeset
2990 regardless of font-use-system-font because .emacs may not have been
4cee82a6f25b Always suggest system font because .emacs may not have been read yet.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106098
diff changeset
2991 read yet. */
4cee82a6f25b Always suggest system font because .emacs may not have been read yet.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106098
diff changeset
2992 const char *system_font = xsettings_get_system_font ();
109035
20747b4a7983 Don't use font names from GConf if font backend can't handle it (bug#6478).
Jan D. <jan.h.d@swipnet.se>
parents: 107850
diff changeset
2993 if (system_font)
20747b4a7983 Don't use font names from GConf if font backend can't handle it (bug#6478).
Jan D. <jan.h.d@swipnet.se>
parents: 107850
diff changeset
2994 {
20747b4a7983 Don't use font names from GConf if font backend can't handle it (bug#6478).
Jan D. <jan.h.d@swipnet.se>
parents: 107850
diff changeset
2995 char *name = xstrdup (system_font);
20747b4a7983 Don't use font names from GConf if font backend can't handle it (bug#6478).
Jan D. <jan.h.d@swipnet.se>
parents: 107850
diff changeset
2996 font = font_open_by_name (f, name);
20747b4a7983 Don't use font names from GConf if font backend can't handle it (bug#6478).
Jan D. <jan.h.d@swipnet.se>
parents: 107850
diff changeset
2997 free (name);
20747b4a7983 Don't use font names from GConf if font backend can't handle it (bug#6478).
Jan D. <jan.h.d@swipnet.se>
parents: 107850
diff changeset
2998 }
106085
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
2999 }
109035
20747b4a7983 Don't use font names from GConf if font backend can't handle it (bug#6478).
Jan D. <jan.h.d@swipnet.se>
parents: 107850
diff changeset
3000
20747b4a7983 Don't use font names from GConf if font backend can't handle it (bug#6478).
Jan D. <jan.h.d@swipnet.se>
parents: 107850
diff changeset
3001 if (NILP (font))
20747b4a7983 Don't use font names from GConf if font backend can't handle it (bug#6478).
Jan D. <jan.h.d@swipnet.se>
parents: 107850
diff changeset
3002 font = !NILP (font_param) ? font_param
20747b4a7983 Don't use font names from GConf if font backend can't handle it (bug#6478).
Jan D. <jan.h.d@swipnet.se>
parents: 107850
diff changeset
3003 : x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING);
20747b4a7983 Don't use font names from GConf if font backend can't handle it (bug#6478).
Jan D. <jan.h.d@swipnet.se>
parents: 107850
diff changeset
3004
20747b4a7983 Don't use font names from GConf if font backend can't handle it (bug#6478).
Jan D. <jan.h.d@swipnet.se>
parents: 107850
diff changeset
3005 if (! FONTP (font) && ! STRINGP (font))
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3006 {
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3007 char *names[]
96289
2e5fb8825124 (x_default_font_parameter): If Xft is available, first try
Chong Yidong <cyd@stupidchicken.com>
parents: 96085
diff changeset
3008 = {
2e5fb8825124 (x_default_font_parameter): If Xft is available, first try
Chong Yidong <cyd@stupidchicken.com>
parents: 96085
diff changeset
3009 #ifdef HAVE_XFT
2e5fb8825124 (x_default_font_parameter): If Xft is available, first try
Chong Yidong <cyd@stupidchicken.com>
parents: 96085
diff changeset
3010 /* This will find the normal Xft font. */
107045
435c323b6002 Change default XFT font to 10pt, and default frame height to 35 rows (Bug#3643).
Chong Yidong <cyd@stupidchicken.com>
parents: 107023
diff changeset
3011 "monospace-10",
96289
2e5fb8825124 (x_default_font_parameter): If Xft is available, first try
Chong Yidong <cyd@stupidchicken.com>
parents: 96085
diff changeset
3012 #endif
2e5fb8825124 (x_default_font_parameter): If Xft is available, first try
Chong Yidong <cyd@stupidchicken.com>
parents: 96085
diff changeset
3013 "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1",
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3014 "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1",
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3015 "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1",
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3016 /* This was formerly the first thing tried, but it finds
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3017 too many fonts and takes too long. */
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3018 "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1",
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3019 /* If those didn't work, look for something which will
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3020 at least work. */
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3021 "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1",
90462
5981c99ef5ba (x_default_font_parameter): Try also "fixed", and signal
Kenichi Handa <handa@m17n.org>
parents: 90428
diff changeset
3022 "fixed",
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3023 NULL };
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3024 int i;
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3025
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3026 for (i = 0; names[i]; i++)
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3027 {
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3028 font = font_open_by_name (f, names[i]);
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3029 if (! NILP (font))
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3030 break;
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3031 }
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3032 if (NILP (font))
90462
5981c99ef5ba (x_default_font_parameter): Try also "fixed", and signal
Kenichi Handa <handa@m17n.org>
parents: 90428
diff changeset
3033 error ("No suitable font was found");
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3034 }
96084
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
3035 else if (!NILP (font_param))
96079
efbaf6995245 * w32fns.c, xfns.c (Qfont_param): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95974
diff changeset
3036 {
efbaf6995245 * w32fns.c, xfns.c (Qfont_param): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95974
diff changeset
3037 /* Remember the explicit font parameter, so we can re-apply it after
efbaf6995245 * w32fns.c, xfns.c (Qfont_param): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95974
diff changeset
3038 we've applied the `default' face settings. */
96084
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
3039 x_set_frame_parameters (f, Fcons (Fcons (Qfont_param, font_param), Qnil));
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
3040 }
106085
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
3041
109069
325f0ae2b5bf xfns.c (x_default_font_parameter): Remove got_from_system (Bug#6526).
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
3042 /* This call will make X resources override any system font setting. */
325f0ae2b5bf xfns.c (x_default_font_parameter): Remove got_from_system (Bug#6526).
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
3043 x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING);
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3044 }
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
3045
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
3046
99346
9c62c9e7bd57 (Fx_wm_set_size_hint): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 98223
diff changeset
3047 DEFUN ("x-wm-set-size-hint", Fx_wm_set_size_hint, Sx_wm_set_size_hint,
9c62c9e7bd57 (Fx_wm_set_size_hint): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 98223
diff changeset
3048 0, 1, 0,
9c62c9e7bd57 (Fx_wm_set_size_hint): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 98223
diff changeset
3049 doc: /* Send the size hints for frame FRAME to the window manager.
9c62c9e7bd57 (Fx_wm_set_size_hint): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 98223
diff changeset
3050 If FRAME is nil, use the selected frame. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3051 (Lisp_Object frame)
99346
9c62c9e7bd57 (Fx_wm_set_size_hint): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 98223
diff changeset
3052 {
9c62c9e7bd57 (Fx_wm_set_size_hint): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 98223
diff changeset
3053 struct frame *f;
9c62c9e7bd57 (Fx_wm_set_size_hint): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 98223
diff changeset
3054 if (NILP (frame))
9c62c9e7bd57 (Fx_wm_set_size_hint): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 98223
diff changeset
3055 frame = selected_frame;
9c62c9e7bd57 (Fx_wm_set_size_hint): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 98223
diff changeset
3056 f = XFRAME (frame);
9c62c9e7bd57 (Fx_wm_set_size_hint): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 98223
diff changeset
3057 BLOCK_INPUT;
100382
9608fb92d17d (Fx_wm_set_size_hint): Check if the frame is an X frame.
Chong Yidong <cyd@stupidchicken.com>
parents: 99369
diff changeset
3058 if (FRAME_X_P (f))
9608fb92d17d (Fx_wm_set_size_hint): Check if the frame is an X frame.
Chong Yidong <cyd@stupidchicken.com>
parents: 99369
diff changeset
3059 x_wm_set_size_hint (f, 0, 0);
99346
9c62c9e7bd57 (Fx_wm_set_size_hint): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 98223
diff changeset
3060 UNBLOCK_INPUT;
99369
04ea320c6c8c (Fx_wm_set_size_hint): Add missing return value.
Andreas Schwab <schwab@suse.de>
parents: 99346
diff changeset
3061 return Qnil;
99346
9c62c9e7bd57 (Fx_wm_set_size_hint): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 98223
diff changeset
3062 }
9c62c9e7bd57 (Fx_wm_set_size_hint): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 98223
diff changeset
3063
107779
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3064 static void
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3065 set_machine_and_pid_properties (struct frame *f)
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3066 {
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3067 /* See the above comment "Note: Encoding strategy". */
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3068 XTextProperty text;
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3069 int bytes, stringp;
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3070 int do_free_text_value = 0;
107781
da85212a72c2 xfns.c (set_machine_and_pid_properties): Fix parantesis
Jan D <jan.h.d@swipnet.se>
parents: 107780
diff changeset
3071 long pid = (long) getpid ();
107779
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3072
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3073 text.value = x_encode_text (Vsystem_name,
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3074 Qcompound_text, 0, &bytes, &stringp,
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3075 &do_free_text_value);
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3076 text.encoding = (stringp ? XA_STRING
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3077 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3078 text.format = 8;
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3079 text.nitems = bytes;
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3080 XSetWMClientMachine (FRAME_X_DISPLAY (f),
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3081 FRAME_OUTER_WINDOW (f),
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3082 &text);
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3083 if (do_free_text_value)
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3084 xfree (text.value);
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3085
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3086 XChangeProperty (FRAME_X_DISPLAY (f),
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3087 FRAME_OUTER_WINDOW (f),
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3088 XInternAtom (FRAME_X_DISPLAY (f),
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3089 "_NET_WM_PID",
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3090 False),
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3091 XA_CARDINAL, 32, PropModeReplace,
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3092 (unsigned char *) &pid, 1);
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3093 }
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3094
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3095 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3096 1, 1, 0,
39988
eac4e9ae201c Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents: 39907
diff changeset
3097 doc: /* Make a new X window, which is called a "frame" in Emacs terms.
79392
5bb5f9a8abab (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79085
diff changeset
3098 Return an Emacs frame object.
96574
8fc8962839b7 (Fx_create_frame): Doc fix
Jason Rumney <jasonr@gnu.org>
parents: 96553
diff changeset
3099 PARMS is an alist of frame parameters.
39905
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
3100 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
3101 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
3102 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
3103 be shared by the new frame.
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
3104
39988
eac4e9ae201c Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents: 39907
diff changeset
3105 This function is an internal primitive--use `make-frame' instead. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3106 (Lisp_Object parms)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3107 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3108 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
3109 Lisp_Object frame, tem;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3110 Lisp_Object name;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3111 int minibuffer_only = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3112 long window_prompting = 0;
107023
5e52c68c1f65 xfns.c (Fx_create_frame): Remove window size matching code from
Jan D. <jan.h.d@swipnet.se>
parents: 106978
diff changeset
3113 int width, height;
46285
3f111801efb4 Rename BINDING_STACK_SIZE to SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents: 45968
diff changeset
3114 int count = SPECPDL_INDEX ();
15566
3d03a3fb8757 (Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents: 15495
diff changeset
3115 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
3116 Lisp_Object display;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3117 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
3118 Lisp_Object parent;
11774
0b5cb5170084 (Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents: 11772
diff changeset
3119 struct kboard *kb;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3120
68396
75dead191600 (Fx_create_frame): Put all specified parms into f->param_alist
Richard M. Stallman <rms@gnu.org>
parents: 67842
diff changeset
3121 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
3122
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3123 /* 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
3124 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
3125 Vx_resource_name = Vinvocation_name;
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3126
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3127 display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_NUMBER);
83177
91cf385601e5 Fix creating frames on different X servers.
Karoly Lorentey <lorentey@elte.hu>
parents: 83167
diff changeset
3128 if (EQ (display, Qunbound))
83167
69ebc75cb461 Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents: 83123
diff changeset
3129 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
3130 if (EQ (display, Qunbound))
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3131 display = Qnil;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3132 dpyinfo = check_x_display_info (display);
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3133 kb = dpyinfo->terminal->kboard;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3134
84685
502394270fc6 (x_delete_terminal): Use terminal->name as liveness status.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83760
diff changeset
3135 if (!dpyinfo->terminal->name)
502394270fc6 (x_delete_terminal): Use terminal->name as liveness status.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83760
diff changeset
3136 error ("Terminal is not live, can't create new frames on it");
83525
b2e7507b55c6 Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents: 83505
diff changeset
3137
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3138 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
3139 if (!STRINGP (name)
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3140 && ! EQ (name, Qunbound)
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3141 && ! NILP (name))
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3142 error ("Invalid frame name--not a string or nil");
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
3143
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3144 if (STRINGP (name))
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3145 Vx_resource_name = name;
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3146
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3147 /* 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
3148 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
3149 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
3150 parent = Qnil;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3151 if (! NILP (parent))
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
3152 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
3153
15566
3d03a3fb8757 (Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents: 15495
diff changeset
3154 /* 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
3155 /* 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
3156 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
3157 frame = Qnil;
3d03a3fb8757 (Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents: 15495
diff changeset
3158 GCPRO4 (parms, parent, name, frame);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3159 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
3160 RES_TYPE_SYMBOL);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3161 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
3162 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
3163 else if (EQ (tem, Qonly))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3164 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3165 f = make_minibuffer_frame ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3166 minibuffer_only = 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3167 }
9103
948e8acb6990 (x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9022
diff changeset
3168 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
3169 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
3170 else
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3171 f = make_frame (1);
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3172
15566
3d03a3fb8757 (Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents: 15495
diff changeset
3173 XSETFRAME (frame, f);
3d03a3fb8757 (Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents: 15495
diff changeset
3174
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
3175 /* 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
3176 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
3177
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3178 f->terminal = dpyinfo->terminal;
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3179 f->terminal->reference_count++;
83004
7900111db01c Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents: 82992
diff changeset
3180
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3181 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
3182 f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output));
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
3183 memset (f->output_data.x, 0, sizeof (struct x_output));
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3184 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
3185 FRAME_FONTSET (f) = -1;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3186 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
3187 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
3188 #ifdef USE_TOOLKIT_SCROLL_BARS
1e12db2b25f0 (x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents: 39591
diff changeset
3189 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
3190 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
3191 #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
3192
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
3193 f->icon_name
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3194 = 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
3195 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
3196 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
3197 f->icon_name = Qnil;
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
3198
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3199 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
3200
ae1e5666e49f (Fx_create_frame): Move unwind_create_frame setup down.
Richard M. Stallman <rms@gnu.org>
parents: 71476
diff changeset
3201 /* 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
3202 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
3203 #if GLYPH_DEBUG
92109
4d9fc08769fa Consolidate the image_cache to the terminal struct.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91931
diff changeset
3204 image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount;
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
3205 dpyinfo_refcount = dpyinfo->reference_count;
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
3206 #endif /* GLYPH_DEBUG */
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3207
27987
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
3208 /* 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
3209 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
3210 {
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
3211 Lisp_Object black;
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
3212 struct gcpro gcpro1;
38345
3238db7bdfef (Fx_create_frame): Initialize frame colors to -1,
Gerd Moellmann <gerd@gnu.org>
parents: 38183
diff changeset
3213
3238db7bdfef (Fx_create_frame): Initialize frame colors to -1,
Gerd Moellmann <gerd@gnu.org>
parents: 38183
diff changeset
3214 /* 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
3215 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
3216 to free colors we haven't allocated. */
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
3217 FRAME_FOREGROUND_PIXEL (f) = -1;
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
3218 FRAME_BACKGROUND_PIXEL (f) = -1;
38345
3238db7bdfef (Fx_create_frame): Initialize frame colors to -1,
Gerd Moellmann <gerd@gnu.org>
parents: 38183
diff changeset
3219 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
3220 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
3221 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
3222 f->output_data.x->mouse_pixel = -1;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
3223
27987
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
3224 black = build_string ("black");
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
3225 GCPRO1 (black);
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
3226 FRAME_FOREGROUND_PIXEL (f)
27987
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
3227 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
3228 FRAME_BACKGROUND_PIXEL (f)
27987
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
3229 = 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
3230 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
3231 = 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
3232 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
3233 = 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
3234 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
3235 = 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
3236 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
3237 = 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
3238 UNGCPRO;
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
3239 }
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
3240
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3241 /* 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
3242
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3243 if (!NILP (parent))
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3244 {
18612
88efccff8970 Fix bugs with inappropriate mixing of Lisp_Object with int.
Richard M. Stallman <rms@gnu.org>
parents: 18594
diff changeset
3245 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
3246 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
3247 }
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3248 else
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3249 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3250 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
3251 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
3252 }
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3253
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3254 /* 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
3255 be set. */
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3256 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
3257 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3258 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
3259 f->explicit_name = 0;
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3260 }
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3261 else
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3262 {
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3263 f->name = name;
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3264 f->explicit_name = 1;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3265 /* 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
3266 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
3267 }
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3268
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3269 f->resx = dpyinfo->resx;
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3270 f->resy = dpyinfo->resy;
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3271
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3272 #ifdef HAVE_FREETYPE
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3273 #ifdef HAVE_XFT
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
3274 register_font_driver (&xftfont_driver, f);
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3275 #else /* not HAVE_XFT */
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
3276 register_font_driver (&ftxfont_driver, f);
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3277 #endif /* not HAVE_XFT */
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3278 #endif /* HAVE_FREETYPE */
102108
ce4d81298570 (Fx_create_frame): Give Xft driver a higher priority.
Chong Yidong <cyd@stupidchicken.com>
parents: 101836
diff changeset
3279 register_font_driver (&xfont_driver, f);
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
3280
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
3281 x_default_parameter (f, parms, Qfont_backend, Qnil,
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
3282 "fontBackend", "FontBackend", RES_TYPE_STRING);
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
3283
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3284 /* Extract the window parameters from the supplied values
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3285 that are needed to determine window geometry. */
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
3286 x_default_font_parameter (f, parms);
101836
06bbdc2cfd6f (Fx_create_frame): Signal an error if no font is found (Bug#2147).
Chong Yidong <cyd@stupidchicken.com>
parents: 101237
diff changeset
3287 if (!FRAME_FONT (f))
06bbdc2cfd6f (Fx_create_frame): Signal an error if no font is found (Bug#2147).
Chong Yidong <cyd@stupidchicken.com>
parents: 101237
diff changeset
3288 {
06bbdc2cfd6f (Fx_create_frame): Signal an error if no font is found (Bug#2147).
Chong Yidong <cyd@stupidchicken.com>
parents: 101237
diff changeset
3289 delete_frame (frame, Qnoelisp);
06bbdc2cfd6f (Fx_create_frame): Signal an error if no font is found (Bug#2147).
Chong Yidong <cyd@stupidchicken.com>
parents: 101237
diff changeset
3290 error ("Invalid frame font");
06bbdc2cfd6f (Fx_create_frame): Signal an error if no font is found (Bug#2147).
Chong Yidong <cyd@stupidchicken.com>
parents: 101237
diff changeset
3291 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3292
91633
e33a0659fabe (Fx_create_frame): Do not override the explicitly set parent
Jan Djärv <jan.h.d@swipnet.se>
parents: 91327
diff changeset
3293 /* Frame contents get displaced if an embedded X window has a border. */
e33a0659fabe (Fx_create_frame): Do not override the explicitly set parent
Jan Djärv <jan.h.d@swipnet.se>
parents: 91327
diff changeset
3294 if (! FRAME_X_EMBEDDED_P (f))
107850
686c788ffbb6 (Fx_create_frame, x_create_tip_frame): Set default border width to zero.
Jan D. <jan.h.d@swipnet.se>
parents: 107839
diff changeset
3295 x_default_parameter (f, parms, Qborder_width, make_number (0),
91633
e33a0659fabe (Fx_create_frame): Do not override the explicitly set parent
Jan Djärv <jan.h.d@swipnet.se>
parents: 91327
diff changeset
3296 "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
3297
40715
221a78cc7b5f (Fx_create_frame): Doc fix.
Pavel Janík <Pavel@Janik.cz>
parents: 40700
diff changeset
3298 /* 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
3299 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
3300 it). */
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3301 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
3302 {
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3303 Lisp_Object value;
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3304
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
3305 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
3306 "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
3307 if (! EQ (value, Qunbound))
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3308 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
3309 parms);
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3310 }
95954
184aae567806 * xfns.c (Fx_create_frame): internal-border-width default to 0 for Gtk.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95877
diff changeset
3311 x_default_parameter (f, parms, Qinternal_border_width,
184aae567806 * xfns.c (Fx_create_frame): internal-border-width default to 0 for Gtk.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95877
diff changeset
3312 #ifdef USE_GTK /* We used to impose 0 in xg_create_frame_widgets. */
184aae567806 * xfns.c (Fx_create_frame): internal-border-width default to 0 for Gtk.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95877
diff changeset
3313 make_number (0),
184aae567806 * xfns.c (Fx_create_frame): internal-border-width default to 0 for Gtk.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95877
diff changeset
3314 #else
184aae567806 * xfns.c (Fx_create_frame): internal-border-width default to 0 for Gtk.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95877
diff changeset
3315 make_number (1),
184aae567806 * xfns.c (Fx_create_frame): internal-border-width default to 0 for Gtk.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95877
diff changeset
3316 #endif
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3317 "internalBorderWidth", "internalBorderWidth",
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3318 RES_TYPE_NUMBER);
107395
05f285327bae Put non-GTK X scroll-bars on left.
Chong Yidong <cyd@stupidchicken.com>
parents: 107383
diff changeset
3319 x_default_parameter (f, parms, Qvertical_scroll_bars,
05f285327bae Put non-GTK X scroll-bars on left.
Chong Yidong <cyd@stupidchicken.com>
parents: 107383
diff changeset
3320 #if defined(USE_GTK) && defined(USE_TOOLKIT_SCROLL_BARS)
05f285327bae Put non-GTK X scroll-bars on left.
Chong Yidong <cyd@stupidchicken.com>
parents: 107383
diff changeset
3321 Qright,
05f285327bae Put non-GTK X scroll-bars on left.
Chong Yidong <cyd@stupidchicken.com>
parents: 107383
diff changeset
3322 #else
05f285327bae Put non-GTK X scroll-bars on left.
Chong Yidong <cyd@stupidchicken.com>
parents: 107383
diff changeset
3323 Qleft,
05f285327bae Put non-GTK X scroll-bars on left.
Chong Yidong <cyd@stupidchicken.com>
parents: 107383
diff changeset
3324 #endif
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3325 "verticalScrollBars", "ScrollBars",
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3326 RES_TYPE_SYMBOL);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3327
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3328 /* 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
3329 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
3330 "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
3331 x_default_parameter (f, parms, Qbackground_color, build_string ("white"),
26808
d8a6c42deb4e Indentation fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 26729
diff changeset
3332 "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
3333 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
3334 "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
3335 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
3336 "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
3337 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
3338 "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
3339 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
3340 "screenGamma", "ScreenGamma", RES_TYPE_FLOAT);
28690
01a3287bb747 (x_set_line_spacing): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 28597
diff changeset
3341 x_default_parameter (f, parms, Qline_spacing, Qnil,
01a3287bb747 (x_set_line_spacing): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 28597
diff changeset
3342 "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
3343 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
3344 "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
3345 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
3346 "rightFringe", "RightFringe", RES_TYPE_NUMBER);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3347
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3348 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
3349 "scrollBarForeground",
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3350 "ScrollBarForeground", 1);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3351 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
3352 "scrollBarBackground",
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3353 "ScrollBarBackground", 0);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3354
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3355 /* 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
3356 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
3357 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
3358 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
3359 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
3360 happen. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3361 init_frame_faces (f);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
3362
109058
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 109035
diff changeset
3363 /* The X resources controlling the menu-bar and tool-bar are
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 109035
diff changeset
3364 processed specially at startup, and reflected in the mode
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 109035
diff changeset
3365 variables; ignore them here. */
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 109035
diff changeset
3366 x_default_parameter (f, parms, Qmenu_bar_lines,
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 109035
diff changeset
3367 NILP (Vmenu_bar_mode)
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 109035
diff changeset
3368 ? make_number (0) : make_number (1),
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 109035
diff changeset
3369 NULL, NULL, RES_TYPE_NUMBER);
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 109035
diff changeset
3370 x_default_parameter (f, parms, Qtool_bar_lines,
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 109035
diff changeset
3371 NILP (Vtool_bar_mode)
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 109035
diff changeset
3372 ? make_number (0) : make_number (1),
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 109035
diff changeset
3373 NULL, NULL, RES_TYPE_NUMBER);
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 109035
diff changeset
3374
13083
16638ebb209f (Fx_create_frame): Set up buffer-predicate slot.
Richard M. Stallman <rms@gnu.org>
parents: 12832
diff changeset
3375 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
3376 "bufferPredicate", "BufferPredicate",
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3377 RES_TYPE_SYMBOL);
14381
4d038c841cf4 (Qtitle): Declared.
Richard M. Stallman <rms@gnu.org>
parents: 14186
diff changeset
3378 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
3379 "title", "Title", RES_TYPE_STRING);
38183
3ef7b5a020b2 (Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37946
diff changeset
3380 x_default_parameter (f, parms, Qwait_for_wm, Qt,
3ef7b5a020b2 (Qwait_for_wm): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37946
diff changeset
3381 "waitForWM", "WaitForWM", RES_TYPE_BOOLEAN);
42721
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
3382 x_default_parameter (f, parms, Qfullscreen, Qnil,
462e0bbae65d (Qfullscreen, Qfullwidth, Qfullheight, Qfullboth): New variables.
Eli Zaretskii <eliz@gnu.org>
parents: 42247
diff changeset
3383 "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
3384
36459
919d77f8d0ff (Fx_create_frame): Adjust the frame's height for presence
Gerd Moellmann <gerd@gnu.org>
parents: 36448
diff changeset
3385 /* 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
3386 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
3387
25320
107c9221181c (x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents: 25289
diff changeset
3388 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
3389 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
3390
56513
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
3391 x_icon_verify (f, parms);
5044b3527ce8 (x_icon_verify): New function.
Luc Teirlinck <teirllm@auburn.edu>
parents: 55546
diff changeset
3392
35733
4f422aadd415 (Fx_create_frame): Add the tool bar height to the frame
Gerd Moellmann <gerd@gnu.org>
parents: 35592
diff changeset
3393 /* 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
3394 #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
3395 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
3396 #else
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3397 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
3398 #endif
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
3399
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3400 x_icon (f, parms);
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3401 x_make_gc (f);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3402
25320
107c9221181c (x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents: 25289
diff changeset
3403 /* Now consider the frame official. */
107c9221181c (x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents: 25289
diff changeset
3404 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
3405 Vframe_list = Fcons (frame, Vframe_list);
107c9221181c (x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents: 25289
diff changeset
3406
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3407 /* 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
3408 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
3409 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
3410 "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
3411
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3412 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
3413 "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
3414 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
3415 "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
3416 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
3417 "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
3418 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
3419 "scrollBarWidth", "ScrollBarWidth",
06f887a1c834 (Fx_create_frame): Move x_default_parameter calls that
Gerd Moellmann <gerd@gnu.org>
parents: 26954
diff changeset
3420 RES_TYPE_NUMBER);
95159
3a5987224fad Seiji Zenitani <zenitani at mac.com>
Glenn Morris <rgm@gnu.org>
parents: 94963
diff changeset
3421 x_default_parameter (f, parms, Qalpha, Qnil,
3a5987224fad Seiji Zenitani <zenitani at mac.com>
Glenn Morris <rgm@gnu.org>
parents: 94963
diff changeset
3422 "alpha", "Alpha", RES_TYPE_NUMBER);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3423
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
3424 /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3425 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
3426 FRAME_LINES (f). */
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
3427 width = FRAME_COLS (f);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
3428 height = FRAME_LINES (f);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
3429
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
3430 SET_FRAME_COLS (f, 0);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
3431 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
3432 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
3433
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
3434 #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
3435 /* Create the menu bar. */
107c9221181c (x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents: 25289
diff changeset
3436 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
3437 {
107c9221181c (x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents: 25289
diff changeset
3438 /* 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
3439 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
3440 initialize_frame_menubar (f);
107c9221181c (x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents: 25289
diff changeset
3441
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
3442 #ifndef USE_GTK
25320
107c9221181c (x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents: 25289
diff changeset
3443 /* 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
3444 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
3445 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
3446 f->output_data.x->menubar_widget,
107c9221181c (x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents: 25289
diff changeset
3447 f->output_data.x->edit_widget);
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
3448 #endif /* not USE_GTK */
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
3449 }
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
3450 #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
3451
107c9221181c (x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents: 25289
diff changeset
3452 /* 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
3453 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
3454 bar so that its size can be taken into account. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3455 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
3456 x_wm_set_size_hint (f, window_prompting, 0);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3457 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3458
25320
107c9221181c (x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents: 25289
diff changeset
3459 /* 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
3460 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
3461 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
3462 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
3463 {
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3464 Lisp_Object visibility;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3465
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
3466 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
3467 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
3468 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
3469 visibility = Qt;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3470
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3471 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
3472 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
3473 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
3474 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
3475 else
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3476 /* 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
3477 ;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3478 }
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3479
107779
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3480 BLOCK_INPUT;
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3481
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3482 /* Set machine name and pid for the purpose of window managers. */
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3483 set_machine_and_pid_properties(f);
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3484
52298
1a4bd2bec861 Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents: 52095
diff changeset
3485 /* 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
3486 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
3487 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
3488 {
1a4bd2bec861 Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents: 52095
diff changeset
3489 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
3490 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
3491 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
3492 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
3493 (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
3494 }
1a4bd2bec861 Create and initialize a client leader window so session management
Jan Djärv <jan.h.d@swipnet.se>
parents: 52095
diff changeset
3495
107779
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3496 UNBLOCK_INPUT;
41e0da544208 Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
jhd <jhd@f12.localdomain>
parents: 107538
diff changeset
3497
67363
87de4735ecc9 (Fx_create_frame): Initialize Vdefault_minibuffer_frame, when needed.
Károly Lőrentey <lorentey@elte.hu>
parents: 67264
diff changeset
3498 /* Initialize `default-minibuffer-frame' in case this is the first
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3499 frame on this terminal. */
67363
87de4735ecc9 (Fx_create_frame): Initialize Vdefault_minibuffer_frame, when needed.
Károly Lőrentey <lorentey@elte.hu>
parents: 67264
diff changeset
3500 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
3501 && (!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
3502 || !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
3503 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
3504
68396
75dead191600 (Fx_create_frame): Put all specified parms into f->param_alist
Richard M. Stallman <rms@gnu.org>
parents: 67842
diff changeset
3505 /* 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
3506 by x_get_arg and friends, now go in the misc. alist of the frame. */
85330
0bc184c59770 * xfns.c (Fx_create_frame, Fx_display_list):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85311
diff changeset
3507 for (tem = parms; CONSP (tem); tem = XCDR (tem))
68396
75dead191600 (Fx_create_frame): Put all specified parms into f->param_alist
Richard M. Stallman <rms@gnu.org>
parents: 67842
diff changeset
3508 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
3509 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
3510
25320
107c9221181c (x_window) [USE_X_TOOLKIT]: Remove test for
Gerd Moellmann <gerd@gnu.org>
parents: 25289
diff changeset
3511 UNGCPRO;
36594
756c28377036 (Fx_create_frame): Clear Vwindow_list.
Gerd Moellmann <gerd@gnu.org>
parents: 36459
diff changeset
3512
756c28377036 (Fx_create_frame): Clear Vwindow_list.
Gerd Moellmann <gerd@gnu.org>
parents: 36459
diff changeset
3513 /* 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
3514 and similar functions. */
756c28377036 (Fx_create_frame): Clear Vwindow_list.
Gerd Moellmann <gerd@gnu.org>
parents: 36459
diff changeset
3515 Vwindow_list = Qnil;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
3516
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3517 return unbind_to (count, frame);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3518 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3519
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
3520
11537
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3521 /* 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
3522 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
3523 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
3524
6485
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3525 Lisp_Object
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
3526 x_get_focus_frame (struct frame *frame)
6485
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3527 {
11537
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3528 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
3529 Lisp_Object xfocus;
11537
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3530 if (! dpyinfo->x_focus_frame)
6485
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3531 return Qnil;
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3532
11537
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3533 XSETFRAME (xfocus, dpyinfo->x_focus_frame);
6485
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3534 return xfocus;
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3535 }
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3536
28044
88db4c84b6fd Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents: 28010
diff changeset
3537
88db4c84b6fd Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents: 28010
diff changeset
3538 /* 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
3539 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
3540 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
3541
88db4c84b6fd Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents: 28010
diff changeset
3542 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
3543 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
3544 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
3545 following a user-command. */
88db4c84b6fd Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents: 28010
diff changeset
3546
88db4c84b6fd Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents: 28010
diff changeset
3547 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
3548 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
3549 FRAME nil means use the selected frame. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3550 (Lisp_Object frame)
28044
88db4c84b6fd Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents: 28010
diff changeset
3551 {
88db4c84b6fd Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents: 28010
diff changeset
3552 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
3553 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
3554
88db4c84b6fd Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents: 28010
diff changeset
3555 BLOCK_INPUT;
69152
f2147c1027b6 * xterm.h (x_catch_errors) Return value changed to void.
Chong Yidong <cyd@stupidchicken.com>
parents: 69065
diff changeset
3556 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
3557 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
3558 RevertToParent, CurrentTime);
81947
f0ff13637b00 (Fx_focus_frame): Call x_ewmh_activate_frame
Jan Djärv <jan.h.d@swipnet.se>
parents: 81375
diff changeset
3559 x_ewmh_activate_frame (f);
69173
fdee8318ddc9 * xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary
Chong Yidong <cyd@stupidchicken.com>
parents: 69152
diff changeset
3560 x_uncatch_errors ();
28044
88db4c84b6fd Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents: 28010
diff changeset
3561 UNBLOCK_INPUT;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
3562
28044
88db4c84b6fd Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents: 28010
diff changeset
3563 return Qnil;
88db4c84b6fd Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents: 28010
diff changeset
3564 }
88db4c84b6fd Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents: 28010
diff changeset
3565
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3566
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26571
diff changeset
3567 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
3568 doc: /* Internal function called by `color-defined-p', which see. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3569 (Lisp_Object color, Lisp_Object frame)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3570 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3571 XColor foo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3572 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
3573
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
3574 CHECK_STRING (color);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3575
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46295
diff changeset
3576 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
3577 return Qt;
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3578 else
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3579 return Qnil;
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3580 }
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3581
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26571
diff changeset
3582 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
3583 doc: /* Internal function called by `color-values', which see. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3584 (Lisp_Object color, Lisp_Object frame)
8675
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3585 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3586 XColor foo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3587 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
3588
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
3589 CHECK_STRING (color);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3590
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46295
diff changeset
3591 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
3592 return list3 (make_number (foo.red),
892ea79efee6 (Fxw_color_values): Simplify; use list3.
Kim F. Storm <storm@cua.dk>
parents: 71993
diff changeset
3593 make_number (foo.green),
892ea79efee6 (Fxw_color_values): Simplify; use list3.
Kim F. Storm <storm@cua.dk>
parents: 71993
diff changeset
3594 make_number (foo.blue));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3595 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3596 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3597 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3598
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26571
diff changeset
3599 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
3600 doc: /* Internal function called by `display-color-p', which see. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3601 (Lisp_Object terminal)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3602 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3603 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3604
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3605 if (dpyinfo->n_planes <= 2)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3606 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3607
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3608 switch (dpyinfo->visual->class)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3609 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3610 case StaticColor:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3611 case PseudoColor:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3612 case TrueColor:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3613 case DirectColor:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3614 return Qt;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3615
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3616 default:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3617 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3618 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3619 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3620
8779
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
3621 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
3622 0, 1, 0,
39988
eac4e9ae201c Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents: 39907
diff changeset
3623 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
3624 Note that color displays do support shades of gray.
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3625 The optional argument TERMINAL specifies which display to ask about.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
3626 TERMINAL should be a terminal object, 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
3627 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3628 (Lisp_Object terminal)
8779
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
3629 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3630 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3631
12347
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3632 if (dpyinfo->n_planes <= 1)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3633 return Qnil;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3634
12347
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3635 switch (dpyinfo->visual->class)
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3636 {
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3637 case StaticColor:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3638 case PseudoColor:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3639 case TrueColor:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3640 case DirectColor:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3641 case StaticGray:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3642 case GrayScale:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3643 return Qt;
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3644
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3645 default:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3646 return Qnil;
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3647 }
8779
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
3648 }
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
3649
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3650 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
3651 0, 1, 0,
86073
0e4c465d1806 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 85875
diff changeset
3652 doc: /* Return the width in pixels of the X display TERMINAL.
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3653 The optional argument TERMINAL specifies which display to ask about.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
3654 TERMINAL should be a terminal object, 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
3655 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3656 (Lisp_Object terminal)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3657 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3658 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3659
98223
033f7f08bc55 (Fx_display_pixel_width, Fx_display_pixel_height)
Chong Yidong <cyd@stupidchicken.com>
parents: 97142
diff changeset
3660 return make_number (x_display_pixel_width (dpyinfo));
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3661 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3662
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3663 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
3664 Sx_display_pixel_height, 0, 1, 0,
86073
0e4c465d1806 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 85875
diff changeset
3665 doc: /* Return the height in pixels of the X display TERMINAL.
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3666 The optional argument TERMINAL specifies which display to ask about.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
3667 TERMINAL should be a terminal object, 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
3668 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3669 (Lisp_Object terminal)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3670 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3671 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3672
98223
033f7f08bc55 (Fx_display_pixel_width, Fx_display_pixel_height)
Chong Yidong <cyd@stupidchicken.com>
parents: 97142
diff changeset
3673 return make_number (x_display_pixel_height (dpyinfo));
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3674 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3675
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3676 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
3677 0, 1, 0,
86073
0e4c465d1806 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 85875
diff changeset
3678 doc: /* Return the number of bitplanes of the X display TERMINAL.
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3679 The optional argument TERMINAL specifies which display to ask about.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
3680 TERMINAL should be a terminal object, 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
3681 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3682 (Lisp_Object terminal)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3683 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3684 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3685
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3686 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
3687 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3688
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3689 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
3690 0, 1, 0,
86073
0e4c465d1806 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 85875
diff changeset
3691 doc: /* Return the number of color cells of the X display TERMINAL.
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3692 The optional argument TERMINAL specifies which display to ask about.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
3693 TERMINAL should be a terminal object, 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
3694 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3695 (Lisp_Object terminal)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3696 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3697 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3698
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
3699 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
3700 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
3701
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
3702 /* 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
3703 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
3704 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
3705 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
3706 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
3707 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
3708
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
3709 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
3710 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3711
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3712 DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3713 Sx_server_max_request_size,
39905
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
3714 0, 1, 0,
86073
0e4c465d1806 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 85875
diff changeset
3715 doc: /* Return the maximum request size of the X server of display TERMINAL.
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3716 The optional argument TERMINAL specifies which display to ask about.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
3717 TERMINAL should be a terminal object, 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
3718 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3719 (Lisp_Object terminal)
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3720 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3721 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3722
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3723 return make_number (MAXREQUEST (dpyinfo->display));
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3724 }
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3725
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3726 DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
86073
0e4c465d1806 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 85875
diff changeset
3727 doc: /* Return the "vendor ID" string of the X server of display TERMINAL.
57765
77c93cbb1721 (Fx_server_vendor, Fx_server_version): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 57714
diff changeset
3728 \(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
3729 that operating systems cannot be developed and distributed noncommercially.)
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3730 The optional argument TERMINAL specifies which display to ask about.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
3731 TERMINAL should be a terminal object, 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
3732 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3733 (Lisp_Object terminal)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3734 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3735 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3736 char *vendor = ServerVendor (dpyinfo->display);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3737
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3738 if (! vendor) vendor = "";
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3739 return build_string (vendor);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3740 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3741
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3742 DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
86073
0e4c465d1806 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 85875
diff changeset
3743 doc: /* Return the version numbers of the X server of display TERMINAL.
39905
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
3744 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
3745 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
3746 number. See also the function `x-server-vendor'.
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
3747
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3748 The optional argument TERMINAL specifies which display to ask about.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
3749 TERMINAL should be a terminal object, 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
3750 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3751 (Lisp_Object terminal)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3752 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3753 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3754 Display *dpy = dpyinfo->display;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3755
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3756 return Fcons (make_number (ProtocolVersion (dpy)),
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3757 Fcons (make_number (ProtocolRevision (dpy)),
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3758 Fcons (make_number (VendorRelease (dpy)), Qnil)));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3759 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3760
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3761 DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3762 doc: /* Return the number of screens on the X server of display TERMINAL.
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3763 The optional argument TERMINAL specifies which display to ask about.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
3764 TERMINAL should be a terminal object, 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
3765 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3766 (Lisp_Object terminal)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3767 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3768 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3769
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3770 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
3771 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3772
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3773 DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0,
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3774 doc: /* Return the height in millimeters of the X display TERMINAL.
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3775 The optional argument TERMINAL specifies which display to ask about.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
3776 TERMINAL should be a terminal object, 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
3777 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3778 (Lisp_Object terminal)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3779 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3780 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3781
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3782 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
3783 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3784
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3785 DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3786 doc: /* Return the width in millimeters of the X display TERMINAL.
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3787 The optional argument TERMINAL specifies which display to ask about.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
3788 TERMINAL should be a terminal object, 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
3789 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3790 (Lisp_Object terminal)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3791 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3792 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3793
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3794 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
3795 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3796
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3797 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
3798 Sx_display_backing_store, 0, 1, 0,
86073
0e4c465d1806 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 85875
diff changeset
3799 doc: /* Return an indication of whether X display TERMINAL does backing store.
39905
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
3800 The value may be `always', `when-mapped', or `not-useful'.
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3801 The optional argument TERMINAL specifies which display to ask about.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
3802 TERMINAL should be a terminal object, 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
3803 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3804 (Lisp_Object terminal)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3805 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3806 struct x_display_info *dpyinfo = check_x_display_info (terminal);
31543
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3807 Lisp_Object result;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3808
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3809 switch (DoesBackingStore (dpyinfo->screen))
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3810 {
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3811 case Always:
31543
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3812 result = intern ("always");
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3813 break;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3814
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3815 case WhenMapped:
31543
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3816 result = intern ("when-mapped");
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3817 break;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3818
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3819 case NotUseful:
31543
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3820 result = intern ("not-useful");
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3821 break;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3822
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3823 default:
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3824 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
3825 result = Qnil;
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3826 }
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3827
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3828 return result;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3829 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3830
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3831 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
3832 Sx_display_visual_class, 0, 1, 0,
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3833 doc: /* Return the visual class of the X display TERMINAL.
39905
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
3834 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
3835 `static-color', `pseudo-color', `true-color', or `direct-color'.
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
3836
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3837 The optional argument TERMINAL specifies which display to ask about.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
3838 TERMINAL should a terminal object, 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
3839 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3840 (Lisp_Object terminal)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3841 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3842 struct x_display_info *dpyinfo = check_x_display_info (terminal);
31543
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3843 Lisp_Object result;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3844
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3845 switch (dpyinfo->visual->class)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3846 {
31543
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3847 case StaticGray:
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3848 result = intern ("static-gray");
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3849 break;
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3850 case GrayScale:
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3851 result = intern ("gray-scale");
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3852 break;
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3853 case StaticColor:
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3854 result = intern ("static-color");
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3855 break;
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3856 case PseudoColor:
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3857 result = intern ("pseudo-color");
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3858 break;
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3859 case TrueColor:
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3860 result = intern ("true-color");
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3861 break;
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3862 case DirectColor:
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3863 result = intern ("direct-color");
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3864 break;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3865 default:
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3866 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
3867 result = Qnil;
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3868 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
3869
31543
9c5e42fa3ba5 (png_load, jpeg_load): Declare some variables volatile
Gerd Moellmann <gerd@gnu.org>
parents: 30601
diff changeset
3870 return result;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3871 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3872
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3873 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
3874 Sx_display_save_under, 0, 1, 0,
86073
0e4c465d1806 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 85875
diff changeset
3875 doc: /* Return t if the X display TERMINAL supports the save-under feature.
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3876 The optional argument TERMINAL specifies which display to ask about.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
3877 TERMINAL should be a terminal object, 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
3878 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
3879 (Lisp_Object terminal)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3880 {
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
3881 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3882
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3883 if (DoesSaveUnders (dpyinfo->screen) == True)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3884 return Qt;
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3885 else
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3886 return Qnil;
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3887 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3888
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3889 int
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
3890 x_pixel_width (register struct frame *f)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3891 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
3892 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
3893 }
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3894
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3895 int
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
3896 x_pixel_height (register struct frame *f)
2067
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3897 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
3898 return FRAME_PIXEL_HEIGHT (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3899 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3900
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3901 int
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
3902 x_char_width (register struct frame *f)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3903 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
3904 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
3905 }
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3906
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3907 int
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
3908 x_char_height (register struct frame *f)
2067
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3909 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
3910 return FRAME_LINE_HEIGHT (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3911 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3912
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3913 int
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
3914 x_screen_planes (register struct frame *f)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3915 {
19825
cdfaf8ce5208 (x_screen_planes): Fix type of argument.
Richard M. Stallman <rms@gnu.org>
parents: 19095
diff changeset
3916 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
3917 }
28044
88db4c84b6fd Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents: 28010
diff changeset
3918
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3919
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3920
27993
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 X Displays
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3923 ************************************************************************/
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3924
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3925
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3926 /* Mapping visual names to visuals. */
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3927
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3928 static struct visual_class
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3929 {
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3930 char *name;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3931 int class;
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 visual_classes[] =
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3934 {
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3935 {"StaticGray", StaticGray},
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3936 {"GrayScale", GrayScale},
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3937 {"StaticColor", StaticColor},
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3938 {"PseudoColor", PseudoColor},
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3939 {"TrueColor", TrueColor},
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3940 {"DirectColor", DirectColor},
42123
7f5f06b97bfc (x_frame_parms): Add missing braces around initializer.
Pavel Janík <Pavel@Janik.cz>
parents: 42006
diff changeset
3941 {NULL, 0}
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3942 };
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3943
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3944
4606
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
3945 #ifndef HAVE_XSCREENNUMBEROFSCREEN
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3946
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3947 /* 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
3948 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
3949
4606
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
3950 int
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
3951 XScreenNumberOfScreen (scr)
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
3952 register Screen *scr;
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
3953 {
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3954 Display *dpy = scr->display;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3955 int i;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3956
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3957 for (i = 0; i < dpy->nscreens; ++i)
40325
2eb0395c1697 (XScreenNumberOfScreen): Fix struct to pointer
Gerd Moellmann <gerd@gnu.org>
parents: 40279
diff changeset
3958 if (scr == dpy->screens + i)
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3959 break;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3960
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3961 return i;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3962 }
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3963
4606
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
3964 #endif /* not HAVE_XSCREENNUMBEROFSCREEN */
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
3965
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3966
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3967 /* 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
3968 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
3969
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3970 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
3971 select_visual (struct x_display_info *dpyinfo)
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3972 {
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3973 Display *dpy = dpyinfo->display;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3974 Screen *screen = dpyinfo->screen;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3975 Lisp_Object value;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3976
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3977 /* See if a visual is specified. */
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3978 value = display_x_get_resource (dpyinfo,
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3979 build_string ("visualClass"),
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3980 build_string ("VisualClass"),
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3981 Qnil, Qnil);
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3982 if (STRINGP (value))
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3983 {
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3984 /* 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
3985 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
3986 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
3987 char *s = (char *) alloca (SBYTES (value) + 1);
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3988 char *dash;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3989 int i, class = -1;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3990 XVisualInfo vinfo;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3991
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46295
diff changeset
3992 strcpy (s, SDATA (value));
109315
8f3464b85afb Use strchr, strrchr instead of index, rindex
Andreas Schwab <schwab@linux-m68k.org>
parents: 109302
diff changeset
3993 dash = strchr (s, '-');
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3994 if (dash)
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3995 {
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3996 dpyinfo->n_planes = atoi (dash + 1);
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3997 *dash = '\0';
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3998 }
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
3999 else
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4000 /* 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
4001 an error will be printed below. */
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4002 dpyinfo->n_planes = 0;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4003
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4004 /* Determine the visual class. */
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4005 for (i = 0; visual_classes[i].name; ++i)
95221
063d15c54b69 * dispextern.h, xfaces.c (xstrcasecmp): Renamed from xstricmp.
Jason Rumney <jasonr@gnu.org>
parents: 95159
diff changeset
4006 if (xstrcasecmp (s, visual_classes[i].name) == 0)
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4007 {
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4008 class = visual_classes[i].class;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4009 break;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4010 }
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4011
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4012 /* 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
4013 if (class == -1
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4014 || !XMatchVisualInfo (dpy, XScreenNumberOfScreen (screen),
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4015 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
4016 fatal ("Invalid visual specification `%s'", SDATA (value));
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4017
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4018 dpyinfo->visual = vinfo.visual;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4019 }
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4020 else
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4021 {
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4022 int n_visuals;
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4023 XVisualInfo *vinfo, vinfo_template;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4024
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4025 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
4026
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4027 vinfo_template.visualid = XVisualIDFromVisual (dpyinfo->visual);
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4028 vinfo_template.screen = XScreenNumberOfScreen (screen);
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4029 vinfo = XGetVisualInfo (dpy, VisualIDMask | VisualScreenMask,
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4030 &vinfo_template, &n_visuals);
107839
117dfaee55b8 xfns.c (select_visual): Don't call error if XGetVisualInfo returns
Jan D. <jan.h.d@swipnet.se>
parents: 107819
diff changeset
4031 if (n_visuals <= 0)
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4032 fatal ("Can't get proper X visual info");
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4033
28199
56a776500341 * xfns.c (select_visual): Don't set dpyinfo->n_planes to the
Gerd Moellmann <gerd@gnu.org>
parents: 28144
diff changeset
4034 dpyinfo->n_planes = vinfo->depth;
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4035 XFree ((char *) vinfo);
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4036 }
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4037 }
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4038
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4039
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4040 /* 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
4041 Open a new connection if necessary. */
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4042
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4043 struct x_display_info *
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
4044 x_display_info_for_name (Lisp_Object name)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4045 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4046 Lisp_Object names;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4047 struct x_display_info *dpyinfo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4048
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
4049 CHECK_STRING (name);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4050
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83004
diff changeset
4051 #if 0
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83004
diff changeset
4052 if (! EQ (Vinitial_window_system, intern ("x")))
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83004
diff changeset
4053 error ("Not using X Windows"); /* That doesn't stop us anymore. */
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83004
diff changeset
4054 #endif
12381
67cb86bbdb55 (Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents: 12347
diff changeset
4055
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4056 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
4057 dpyinfo;
25646
9154af188477 Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents: 25628
diff changeset
4058 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
4059 {
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4060 Lisp_Object tem;
25646
9154af188477 Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents: 25628
diff changeset
4061 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
4062 if (!NILP (tem))
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4063 return dpyinfo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4064 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4065
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
4066 /* 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
4067 Vx_resource_name = Vinvocation_name;
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
4068
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4069 validate_x_resource_name ();
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4070
34976
05c36b1fa618 (x_display_info_for_name): Cast 0 to "char *" in the call
Eli Zaretskii <eliz@gnu.org>
parents: 34911
diff changeset
4071 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
4072 (char *) SDATA (Vx_resource_name));
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4073
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4074 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
4075 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
4076
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4077 x_in_use = 1;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4078 XSETFASTINT (Vwindow_system_version, 11);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4079
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4080 return dpyinfo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4081 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4082
27993
3a34e2d1bf3c (select_visual): Rewritten. Recognize user-specified
Gerd Moellmann <gerd@gnu.org>
parents: 27987
diff changeset
4083
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4084 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
4085 1, 3, 0,
39988
eac4e9ae201c Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents: 39907
diff changeset
4086 doc: /* Open a connection to an X server.
39905
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
4087 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
4088 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
4089 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
4090 terminate Emacs if we can't open the connection. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4091 (Lisp_Object display, Lisp_Object xrm_string, Lisp_Object must_succeed)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4092 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4093 unsigned char *xrm_option;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4094 struct x_display_info *dpyinfo;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4095
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
4096 CHECK_STRING (display);
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
4097 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
4098 CHECK_STRING (xrm_string);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4099
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83004
diff changeset
4100 #if 0
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83004
diff changeset
4101 if (! EQ (Vinitial_window_system, intern ("x")))
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83004
diff changeset
4102 error ("Not using X Windows"); /* That doesn't stop us anymore. */
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83004
diff changeset
4103 #endif
12381
67cb86bbdb55 (Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents: 12347
diff changeset
4104
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
4105 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
4106 xrm_option = (unsigned char *) SDATA (xrm_string);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4107 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4108 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
4109
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
4110 validate_x_resource_name ();
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
4111
7802
d687e885fa6a (Fx_open_connection): Set up Vx_resource_name and xrm_option
Richard M. Stallman <rms@gnu.org>
parents: 7797
diff changeset
4112 /* 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
4113 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
4114 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
4115 (char *) SDATA (Vx_resource_name));
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4116
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4117 if (dpyinfo == 0)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4118 {
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4119 if (!NILP (must_succeed))
39907
c62141d21872 Fix multi-line string.
Gerd Moellmann <gerd@gnu.org>
parents: 39905
diff changeset
4120 fatal ("Cannot connect to X server %s.\n\
c62141d21872 Fix multi-line string.
Gerd Moellmann <gerd@gnu.org>
parents: 39905
diff changeset
4121 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
4122 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
4123 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
4124 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
4125 SDATA (display));
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4126 else
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46295
diff changeset
4127 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
4128 }
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4129
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4130 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
4131
9327
b3398cf56fba (Fx_open_connection): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents: 9285
diff changeset
4132 XSETFASTINT (Vwindow_system_version, 11);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4133 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4134 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4135
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4136 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
4137 Sx_close_connection, 1, 1, 0,
83442
db27bb9f0d2f Cosmetic fixes in xfns.c.
Karoly Lorentey <lorentey@elte.hu>
parents: 83431
diff changeset
4138 doc: /* Close the connection to TERMINAL's X server.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
4139 For TERMINAL, specify a terminal object, a frame or a display name (a
83442
db27bb9f0d2f Cosmetic fixes in xfns.c.
Karoly Lorentey <lorentey@elte.hu>
parents: 83431
diff changeset
4140 string). If TERMINAL is nil, that stands for the selected frame's
db27bb9f0d2f Cosmetic fixes in xfns.c.
Karoly Lorentey <lorentey@elte.hu>
parents: 83431
diff changeset
4141 terminal. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4142 (Lisp_Object terminal)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4143 {
83442
db27bb9f0d2f Cosmetic fixes in xfns.c.
Karoly Lorentey <lorentey@elte.hu>
parents: 83431
diff changeset
4144 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4145
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4146 if (dpyinfo->reference_count > 0)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4147 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
4148
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
4149 x_delete_terminal (dpyinfo->terminal);
8782
51241477cfc5 Delete X11 conditionals.
Richard M. Stallman <rms@gnu.org>
parents: 8780
diff changeset
4150
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4151 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4152 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4153
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4154 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
4155 doc: /* Return the list of display names that Emacs has connections to. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4156 (void)
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4157 {
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4158 Lisp_Object tail, result;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4159
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4160 result = Qnil;
85330
0bc184c59770 * xfns.c (Fx_create_frame, Fx_display_list):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85311
diff changeset
4161 for (tail = x_display_name_list; CONSP (tail); tail = XCDR (tail))
25646
9154af188477 Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents: 25628
diff changeset
4162 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
4163
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4164 return result;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4165 }
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4166
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4167 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
4168 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
4169 If ON is nil, allow buffering of requests.
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
4170 Turning on synchronization prohibits the Xlib routines from buffering
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
4171 requests and seriously degrades performance, but makes debugging much
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
4172 easier.
83442
db27bb9f0d2f Cosmetic fixes in xfns.c.
Karoly Lorentey <lorentey@elte.hu>
parents: 83431
diff changeset
4173 The optional second argument TERMINAL specifies which display to act on.
103052
e68707cf48a5 * keyboard.c (Fset_input_meta_mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 102108
diff changeset
4174 TERMINAL should be a terminal object, a frame or a display name (a string).
83442
db27bb9f0d2f Cosmetic fixes in xfns.c.
Karoly Lorentey <lorentey@elte.hu>
parents: 83431
diff changeset
4175 If TERMINAL is omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4176 (Lisp_Object on, Lisp_Object terminal)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4177 {
83442
db27bb9f0d2f Cosmetic fixes in xfns.c.
Karoly Lorentey <lorentey@elte.hu>
parents: 83431
diff changeset
4178 struct x_display_info *dpyinfo = check_x_display_info (terminal);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4179
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4180 XSynchronize (dpyinfo->display, !EQ (on, Qnil));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4181
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4182 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4183 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4184
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4185 /* Wait for responses to all X commands issued so far for frame F. */
5536
f900f7bba4c2 (x_sync): New function.
Richard M. Stallman <rms@gnu.org>
parents: 5429
diff changeset
4186
f900f7bba4c2 (x_sync): New function.
Richard M. Stallman <rms@gnu.org>
parents: 5429
diff changeset
4187 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
4188 x_sync (FRAME_PTR f)
5536
f900f7bba4c2 (x_sync): New function.
Richard M. Stallman <rms@gnu.org>
parents: 5429
diff changeset
4189 {
5558
42ec75481b8b (x_sync): Block input.
Richard M. Stallman <rms@gnu.org>
parents: 5536
diff changeset
4190 BLOCK_INPUT;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4191 XSync (FRAME_X_DISPLAY (f), False);
5558
42ec75481b8b (x_sync): Block input.
Richard M. Stallman <rms@gnu.org>
parents: 5536
diff changeset
4192 UNBLOCK_INPUT;
5536
f900f7bba4c2 (x_sync): New function.
Richard M. Stallman <rms@gnu.org>
parents: 5429
diff changeset
4193 }
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4194
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4195
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4196 /***********************************************************************
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4197 Window properties
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4198 ***********************************************************************/
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4199
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4200 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
4201 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
4202 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
4203 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
4204 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
4205 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
4206 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
4207 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
4208 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
4209 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
4210 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
4211 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
4212 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
4213 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
4214 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
4215 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
4216 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
4217
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4218 Value is VALUE. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4219 (Lisp_Object prop, Lisp_Object value, Lisp_Object frame, Lisp_Object type, Lisp_Object format, Lisp_Object outer_p)
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4220 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4221 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
4222 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
4223 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
4224 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
4225 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
4226 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
4227 Window w;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4228
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
4229 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
4230
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4231 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
4232 {
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4233 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
4234 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
4235
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4236 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
4237 && 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
4238 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
4239 }
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4240
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4241 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
4242 {
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4243 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
4244 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
4245 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
4246
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4247 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
4248 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
4249 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
4250 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
4251 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
4252 /* 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
4253 "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
4254 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
4255 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
4256 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
4257 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
4258
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4259 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
4260 }
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4261 else
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4262 {
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4263 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
4264 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
4265 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
4266 }
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4267
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4268 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
4269 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
4270 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
4271 {
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4272 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
4273 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
4274 }
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4275
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4276 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
4277 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
4278
53787
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4279 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
4280 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
4281 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
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 if (CONSP (value)) xfree (data);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4284
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4285 /* 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
4286 XFlush (FRAME_X_DISPLAY (f));
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4287 UNBLOCK_INPUT;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4288
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4289 return value;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4290 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4291
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4292
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4293 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
4294 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
4295 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
4296 FRAME nil or omitted means use the selected frame. Value is PROP. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4297 (Lisp_Object prop, Lisp_Object frame)
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4298 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4299 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
4300 Atom prop_atom;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4301
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
4302 CHECK_STRING (prop);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4303 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
4304 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
4305 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
4306
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4307 /* 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
4308 XFlush (FRAME_X_DISPLAY (f));
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4309 UNBLOCK_INPUT;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4310
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4311 return prop;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4312 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4313
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4314
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4315 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
4316 1, 6, 0,
39988
eac4e9ae201c Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents: 39907
diff changeset
4317 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
4318 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
4319 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
4320 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
4321 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
4322 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
4323 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
4324 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
4325
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4326 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
4327 no value of TYPE. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4328 (Lisp_Object prop, Lisp_Object frame, Lisp_Object type, Lisp_Object source, Lisp_Object delete_p, Lisp_Object vector_ret_p)
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4329 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4330 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
4331 Atom prop_atom;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4332 int rc;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4333 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
4334 unsigned char *tmp_data = NULL;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4335 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
4336 Atom target_type = XA_STRING;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4337 int actual_format;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4338 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
4339 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
4340 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
4341
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4342 GCPRO1 (prop_value);
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
4343 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
4344
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4345 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
4346 {
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4347 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
4348 {
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4349 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
4350 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
4351 else
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4352 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
4353
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4354 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
4355 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
4356 }
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 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
4358 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
4359 }
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4360
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4361 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
4362 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
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 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
4365 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
4366 else
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4367 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
4368 }
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4369
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46295
diff changeset
4370 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
4371 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
4372 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
4373 &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
4374 &bytes_remaining, &tmp_data);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4375 if (rc == Success)
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4376 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4377 int size = bytes_remaining;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4378
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4379 XFree (tmp_data);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4380 tmp_data = NULL;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4381
53787
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4382 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
4383 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
4384 ! NILP (delete_p), target_type,
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4385 &actual_type, &actual_format,
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4386 &actual_size, &bytes_remaining,
60133
cfda6afe9273 (hack_wm_protocols): Use correct type for last parameter
Andreas Schwab <schwab@suse.de>
parents: 59980
diff changeset
4387 &tmp_data);
39277
df33715cdcf8 (Fx_window_property): Handle case that property gets
Gerd Moellmann <gerd@gnu.org>
parents: 39159
diff changeset
4388 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
4389 {
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
4390 /* 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
4391 "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
4392 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
4393 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
4394 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
4395 converts from 32 bit elements received from the X server to long
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
4396 and passes the long array to us. Thus, for that case memcpy can not
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
4397 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
4398 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
4399
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
4400 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
4401 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
4402 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
4403
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
4404 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
4405 {
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
4406 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
4407 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
4408 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
4409
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
4410 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
4411 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
4412 }
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
4413
53787
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4414 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
4415 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
4416 else
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4417 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
4418 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
4419 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
4420 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
4421 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
4422 }
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4423
b8e5f3d01bb6 * xfns.c (x-send-client-message): Moved to xselect.c
Jan Djärv <jan.h.d@swipnet.se>
parents: 53335
diff changeset
4424 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
4425 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4426
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4427 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
4428 UNGCPRO;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4429 return prop_value;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4430 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4431
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4432
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4433
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4434 /***********************************************************************
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4435 Busy cursor
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4436 ***********************************************************************/
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4437
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4438 /* 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
4439 hourglass_atimer.
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4440
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4441 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
4442 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
4443 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
4444 shown on the frames. */
27864
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4445
96664
b306a69b9d7f applying patch to consolidate non-GUI portion of hourglass implementation as posted at http://thread.gmane.org/gmane.emacs.devel/98341
Adrian Robert <Adrian.B.Robert@gmail.com>
parents: 96574
diff changeset
4446 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
4447 show_hourglass (struct atimer *timer)
27864
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4448 {
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4449 /* 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
4450 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
4451 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
4452 hourglass_atimer = NULL;
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4453
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4454 if (!hourglass_shown_p)
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4455 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4456 Lisp_Object rest, frame;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4457
27864
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4458 BLOCK_INPUT;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4459
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4460 FOR_EACH_FRAME (rest, frame)
34662
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4461 {
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4462 struct frame *f = XFRAME (frame);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4463
34662
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4464 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
4465 {
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4466 Display *dpy = FRAME_X_DISPLAY (f);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4467
34662
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4468 #ifdef USE_X_TOOLKIT
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4469 if (f->output_data.x->widget)
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4470 #else
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4471 if (FRAME_OUTER_WINDOW (f))
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4472 #endif
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4473 {
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4474 f->output_data.x->hourglass_p = 1;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4475
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4476 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
4477 {
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4478 unsigned long mask = CWCursor;
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4479 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
4480 #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
4481 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
4482 #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
4483 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
4484 #endif
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4485 attrs.cursor = f->output_data.x->hourglass_cursor;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4486
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4487 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
4488 = XCreateWindow (dpy, parent,
34662
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4489 0, 0, 32000, 32000, 0, 0,
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4490 InputOnly,
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4491 CopyFromParent,
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4492 mask, &attrs);
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4493 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4494
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4495 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
4496 XFlush (dpy);
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4497 }
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4498 }
d8005f5e0a23 (show_busy_cursor): Check for live frames more
Gerd Moellmann <gerd@gnu.org>
parents: 34638
diff changeset
4499 }
27864
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4500
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4501 hourglass_shown_p = 1;
27864
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4502 UNBLOCK_INPUT;
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4503 }
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4504 }
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4505
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4506
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4507 /* 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
4508 shown. */
27864
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4509
96664
b306a69b9d7f applying patch to consolidate non-GUI portion of hourglass implementation as posted at http://thread.gmane.org/gmane.emacs.devel/98341
Adrian Robert <Adrian.B.Robert@gmail.com>
parents: 96574
diff changeset
4510 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
4511 hide_hourglass (void)
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4512 {
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4513 if (hourglass_shown_p)
27864
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4514 {
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4515 Lisp_Object rest, frame;
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4516
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4517 BLOCK_INPUT;
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4518 FOR_EACH_FRAME (rest, frame)
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4519 {
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4520 struct frame *f = XFRAME (frame);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4521
27864
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4522 if (FRAME_X_P (f)
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4523 /* Watch out for newly created frames. */
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4524 && f->output_data.x->hourglass_window)
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 XUnmapWindow (FRAME_X_DISPLAY (f),
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4527 f->output_data.x->hourglass_window);
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4528 /* 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
4529 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
4530 XSync (FRAME_X_DISPLAY (f), False);
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4531 f->output_data.x->hourglass_p = 0;
27864
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4532 }
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4533 }
27864
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4534
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
4535 hourglass_shown_p = 0;
27864
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4536 UNBLOCK_INPUT;
ea05cbe65943 (inhibit_busy_cursor, busy_count): Removed.
Gerd Moellmann <gerd@gnu.org>
parents: 27798
diff changeset
4537 }
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4538 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4539
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4540
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4541
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4542 /***********************************************************************
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4543 Tool tips
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4544 ***********************************************************************/
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4545
109100
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
4546 static Lisp_Object x_create_tip_frame (struct x_display_info *,
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
4547 Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
4548 static void compute_tip_xy (struct frame *, Lisp_Object, Lisp_Object,
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109069
diff changeset
4549 Lisp_Object, int, int, int *, int *);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4550
34450
5de00bff5de3 (Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents: 34321
diff changeset
4551 /* 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
4552
5de00bff5de3 (Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents: 34321
diff changeset
4553 Lisp_Object tip_frame;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4554
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4555 /* 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
4556 fires. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4557
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4558 Lisp_Object tip_timer;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4559 Window tip_window;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4560
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4561 /* 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
4562 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
4563
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4564 Lisp_Object last_show_tip_args;
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4565
38574
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
4566 /* Maximum size for tooltips; a cons (COLUMNS . ROWS). */
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
4567
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
4568 Lisp_Object Vx_max_tooltip_size;
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
4569
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
4570
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
4571 static Lisp_Object
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
4572 unwind_create_tip_frame (Lisp_Object frame)
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
4573 {
34638
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34598
diff changeset
4574 Lisp_Object deleted;
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34598
diff changeset
4575
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34598
diff changeset
4576 deleted = unwind_create_frame (frame);
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34598
diff changeset
4577 if (EQ (deleted, Qt))
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34598
diff changeset
4578 {
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34598
diff changeset
4579 tip_window = None;
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34598
diff changeset
4580 tip_frame = Qnil;
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34598
diff changeset
4581 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4582
34638
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34598
diff changeset
4583 return deleted;
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
4584 }
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
4585
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
4586
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4587 /* 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
4588 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
4589 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
4590
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
4591 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
4592 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
4593 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
4594 when this happens. */
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4595
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4596 static Lisp_Object
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
4597 x_create_tip_frame (struct x_display_info *dpyinfo, Lisp_Object parms, Lisp_Object text)
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4598 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4599 struct frame *f;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4600 Lisp_Object frame, tem;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4601 Lisp_Object name;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4602 long window_prompting = 0;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4603 int width, height;
46285
3f111801efb4 Rename BINDING_STACK_SIZE to SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents: 45968
diff changeset
4604 int count = SPECPDL_INDEX ();
25715
feaedc03dbc8 (x_set_background_color): Remove unused variable(s).
Gerd Moellmann <gerd@gnu.org>
parents: 25691
diff changeset
4605 struct gcpro gcpro1, gcpro2, gcpro3;
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4606 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
4607 Lisp_Object buffer;
a9cbe17061fc (x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents: 36594
diff changeset
4608 struct buffer *old_buffer;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4609
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4610 check_x ();
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4611
84685
502394270fc6 (x_delete_terminal): Use terminal->name as liveness status.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83760
diff changeset
4612 if (!dpyinfo->terminal->name)
502394270fc6 (x_delete_terminal): Use terminal->name as liveness status.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 83760
diff changeset
4613 error ("Terminal is not live, can't create new frames on it");
83525
b2e7507b55c6 Fix C-x 5 2 on the controlling tty; fix some possible crash conditions and a memory leak.
Karoly Lorentey <lorentey@elte.hu>
parents: 83505
diff changeset
4614
69404
26f292c725f1 (x_create_tip_frame): Preserve received parms by copying them.
Eli Zaretskii <eliz@gnu.org>
parents: 69173
diff changeset
4615 parms = Fcopy_alist (parms);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4616
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4617 /* 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
4618 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
4619 if (!STRINGP (name)
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4620 && !EQ (name, Qunbound)
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4621 && !NILP (name))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4622 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
4623
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4624 frame = Qnil;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4625 GCPRO3 (parms, name, frame);
34450
5de00bff5de3 (Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents: 34321
diff changeset
4626 f = make_frame (1);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4627 XSETFRAME (frame, f);
36869
a9cbe17061fc (x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents: 36594
diff changeset
4628
a9cbe17061fc (x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents: 36594
diff changeset
4629 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
4630 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
4631 old_buffer = current_buffer;
a9cbe17061fc (x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents: 36594
diff changeset
4632 set_buffer_internal_1 (XBUFFER (buffer));
38574
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
4633 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
4634 specbind (Qinhibit_read_only, Qt);
43663119f752 (x_create_tip_frame): Bind inhibit-read-only and
Kenichi Handa <handa@m17n.org>
parents: 54392
diff changeset
4635 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
4636 Ferase_buffer ();
a9cbe17061fc (x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents: 36594
diff changeset
4637 Finsert (1, &text);
a9cbe17061fc (x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents: 36594
diff changeset
4638 set_buffer_internal_1 (old_buffer);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4639
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4640 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
4641 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
4642
83431
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
4643 f->terminal = dpyinfo->terminal;
76396de7f50a Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents: 83429
diff changeset
4644 f->terminal->reference_count++;
82990
2ecd1f669db9 Fixed X support, preliminary support for X-tty combo sessions.
Karoly Lorentey <lorentey@elte.hu>
parents: 53339
diff changeset
4645
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
4646 /* 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
4647 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
4648 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
4649 counts etc. */
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4650 f->output_method = output_x_window;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4651 f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output));
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
4652 memset (f->output_data.x, 0, sizeof (struct x_output));
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4653 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
4654 FRAME_FONTSET (f) = -1;
29882
c12b0f070cd1 (x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents: 29866
diff changeset
4655 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
4656 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
4657 #ifdef USE_TOOLKIT_SCROLL_BARS
1e12db2b25f0 (x_set_scroll_bar_background) [USE_TOOLKIT_SCROLL_BARS]:
Miles Bader <miles@gnu.org>
parents: 39591
diff changeset
4658 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
4659 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
4660 #endif /* USE_TOOLKIT_SCROLL_BARS */
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4661 f->icon_name = Qnil;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4662 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
4663 #if GLYPH_DEBUG
92109
4d9fc08769fa Consolidate the image_cache to the terminal struct.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91931
diff changeset
4664 image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount;
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
4665 dpyinfo_refcount = dpyinfo->reference_count;
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
4666 #endif /* GLYPH_DEBUG */
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4667 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
4668 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
4669
29882
c12b0f070cd1 (x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents: 29866
diff changeset
4670 /* 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
4671 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
4672 {
c12b0f070cd1 (x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents: 29866
diff changeset
4673 Lisp_Object black;
c12b0f070cd1 (x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents: 29866
diff changeset
4674 struct gcpro gcpro1;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4675
83234
ad592995fd24 Trivial changes in x_create_tip_frame.
Karoly Lorentey <lorentey@elte.hu>
parents: 83231
diff changeset
4676 /* Function x_decode_color can signal an error. Make
ad592995fd24 Trivial changes in x_create_tip_frame.
Karoly Lorentey <lorentey@elte.hu>
parents: 83231
diff changeset
4677 sure to initialize color slots so that we won't try
ad592995fd24 Trivial changes in x_create_tip_frame.
Karoly Lorentey <lorentey@elte.hu>
parents: 83231
diff changeset
4678 to free colors we haven't allocated. */
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
4679 FRAME_FOREGROUND_PIXEL (f) = -1;
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
4680 FRAME_BACKGROUND_PIXEL (f) = -1;
83234
ad592995fd24 Trivial changes in x_create_tip_frame.
Karoly Lorentey <lorentey@elte.hu>
parents: 83231
diff changeset
4681 f->output_data.x->cursor_pixel = -1;
ad592995fd24 Trivial changes in x_create_tip_frame.
Karoly Lorentey <lorentey@elte.hu>
parents: 83231
diff changeset
4682 f->output_data.x->cursor_foreground_pixel = -1;
ad592995fd24 Trivial changes in x_create_tip_frame.
Karoly Lorentey <lorentey@elte.hu>
parents: 83231
diff changeset
4683 f->output_data.x->border_pixel = -1;
ad592995fd24 Trivial changes in x_create_tip_frame.
Karoly Lorentey <lorentey@elte.hu>
parents: 83231
diff changeset
4684 f->output_data.x->mouse_pixel = -1;
ad592995fd24 Trivial changes in x_create_tip_frame.
Karoly Lorentey <lorentey@elte.hu>
parents: 83231
diff changeset
4685
29882
c12b0f070cd1 (x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents: 29866
diff changeset
4686 black = build_string ("black");
c12b0f070cd1 (x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents: 29866
diff changeset
4687 GCPRO1 (black);
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
4688 FRAME_FOREGROUND_PIXEL (f)
29882
c12b0f070cd1 (x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents: 29866
diff changeset
4689 = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
83504
7aa43f830ce4 Fix tooltip border color.
Karoly Lorentey <lorentey@elte.hu>
parents: 83502
diff changeset
4690 FRAME_BACKGROUND_PIXEL (f)
29882
c12b0f070cd1 (x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents: 29866
diff changeset
4691 = 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
4692 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
4693 = 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
4694 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
4695 = 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
4696 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
4697 = 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
4698 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
4699 = 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
4700 UNGCPRO;
c12b0f070cd1 (x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents: 29866
diff changeset
4701 }
c12b0f070cd1 (x_create_tip_frame): Initialize frame's colors like
Gerd Moellmann <gerd@gnu.org>
parents: 29866
diff changeset
4702
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4703 /* 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
4704 be set. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4705 if (EQ (name, Qunbound) || NILP (name))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4706 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4707 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
4708 f->explicit_name = 0;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4709 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4710 else
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4711 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4712 f->name = name;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4713 f->explicit_name = 1;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4714 /* 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
4715 specbind (Qx_resource_name, name);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4716 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4717
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
4718 f->resx = dpyinfo->resx;
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
4719 f->resy = dpyinfo->resy;
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
4720
95877
dce1d4eb3ebd (Fx_create_frame, x_create_tip_frame): Register X
Kenichi Handa <handa@m17n.org>
parents: 95850
diff changeset
4721 register_font_driver (&xfont_driver, f);
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
4722 #ifdef HAVE_FREETYPE
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
4723 #ifdef HAVE_XFT
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
4724 register_font_driver (&xftfont_driver, f);
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
4725 #else /* not HAVE_XFT */
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
4726 register_font_driver (&ftxfont_driver, f);
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
4727 #endif /* not HAVE_XFT */
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
4728 #endif /* HAVE_FREETYPE */
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
4729
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
4730 x_default_parameter (f, parms, Qfont_backend, Qnil,
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
4731 "fontBackend", "FontBackend", RES_TYPE_STRING);
90423
654ff3b48a81 Include "font.h".
Kenichi Handa <handa@m17n.org>
parents: 90376
diff changeset
4732
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
4733 /* 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
4734 needed to determine window geometry. */
94939
da7871784939 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 92109
diff changeset
4735 x_default_font_parameter (f, parms);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4736
107850
686c788ffbb6 (Fx_create_frame, x_create_tip_frame): Set default border width to zero.
Jan D. <jan.h.d@swipnet.se>
parents: 107839
diff changeset
4737 x_default_parameter (f, parms, Qborder_width, make_number (0),
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4738 "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4739
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4740 /* 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
4741 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
4742 it). */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4743 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
4744 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4745 Lisp_Object value;
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 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
4748 "internalBorder", "internalBorder", RES_TYPE_NUMBER);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4749 if (! EQ (value, Qunbound))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4750 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
4751 parms);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4752 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4753
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4754 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
4755 "internalBorderWidth", "internalBorderWidth",
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4756 RES_TYPE_NUMBER);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4757
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4758 /* 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
4759 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
4760 "foreground", "Foreground", RES_TYPE_STRING);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4761 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
4762 "background", "Background", RES_TYPE_STRING);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4763 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
4764 "pointerColor", "Foreground", RES_TYPE_STRING);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4765 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
4766 "cursorColor", "Foreground", RES_TYPE_STRING);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4767 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
4768 "borderColor", "BorderColor", RES_TYPE_STRING);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4769
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4770 /* 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
4771 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
4772 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
4773 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
4774 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
4775 happen. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4776 init_frame_faces (f);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4777
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4778 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
4779
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
4780 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
4781
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4782 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4783 XSetWindowAttributes attrs;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4784 unsigned long mask;
106561
85bf88fe0269 Set the extended window manager hint for tooltip windows.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106201
diff changeset
4785 Atom type = FRAME_X_DISPLAY_INFO (f)->Xatom_net_window_type_tooltip;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4786
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4787 BLOCK_INPUT;
33657
e9cf01c7cda6 (x_create_tip_frame): Use CWSaveUnder only if the
Gerd Moellmann <gerd@gnu.org>
parents: 33601
diff changeset
4788 mask = CWBackPixel | CWOverrideRedirect | CWEventMask;
e9cf01c7cda6 (x_create_tip_frame): Use CWSaveUnder only if the
Gerd Moellmann <gerd@gnu.org>
parents: 33601
diff changeset
4789 if (DoesSaveUnders (dpyinfo->screen))
e9cf01c7cda6 (x_create_tip_frame): Use CWSaveUnder only if the
Gerd Moellmann <gerd@gnu.org>
parents: 33601
diff changeset
4790 mask |= CWSaveUnder;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4791
27987
ce9edc646960 (x_defined_color, x_set_mouse_color, lookup_rgb_color)
Gerd Moellmann <gerd@gnu.org>
parents: 27963
diff changeset
4792 /* 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
4793 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
4794 3.2.8). */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4795 attrs.override_redirect = True;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4796 attrs.save_under = True;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4797 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
4798 /* 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
4799 attrs.event_mask = StructureNotifyMask;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4800 tip_window
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4801 = FRAME_X_WINDOW (f)
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4802 = XCreateWindow (FRAME_X_DISPLAY (f),
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4803 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
4804 /* x, y, width, height */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4805 0, 0, 1, 1,
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4806 /* Border. */
100820
36e4d4d2137d (x_create_tip_frame): Set border width of the X window.
Chong Yidong <cyd@stupidchicken.com>
parents: 100632
diff changeset
4807 f->border_width,
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4808 CopyFromParent, InputOutput, CopyFromParent,
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4809 mask, &attrs);
106561
85bf88fe0269 Set the extended window manager hint for tooltip windows.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106201
diff changeset
4810 XChangeProperty (FRAME_X_DISPLAY (f), tip_window,
85bf88fe0269 Set the extended window manager hint for tooltip windows.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106201
diff changeset
4811 FRAME_X_DISPLAY_INFO (f)->Xatom_net_window_type,
85bf88fe0269 Set the extended window manager hint for tooltip windows.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106201
diff changeset
4812 XA_ATOM, 32, PropModeReplace,
85bf88fe0269 Set the extended window manager hint for tooltip windows.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106201
diff changeset
4813 (unsigned char *)&type, 1);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4814 UNBLOCK_INPUT;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4815 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4816
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4817 x_make_gc (f);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4818
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4819 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
4820 "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4821 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
4822 "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4823 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
4824 "cursorType", "CursorType", RES_TYPE_SYMBOL);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4825
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
4826 /* 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
4827 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
4828 FRAME_LINES (f). */
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
4829 width = FRAME_COLS (f);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
4830 height = FRAME_LINES (f);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
4831 SET_FRAME_COLS (f, 0);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
4832 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
4833 change_frame_size (f, height, width, 1, 0, 0);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4834
47731
755c4233cfba * frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents: 47434
diff changeset
4835 /* Add `tooltip' frame parameter's default value. */
109290
1b5ca039f5f2 Fix faulty `if' statement in delete_frame.
Chong Yidong <cyd@stupidchicken.com>
parents: 107526
diff changeset
4836 if (NILP (Fframe_parameter (frame, Qtooltip)))
1b5ca039f5f2 Fix faulty `if' statement in delete_frame.
Chong Yidong <cyd@stupidchicken.com>
parents: 107526
diff changeset
4837 Fmodify_frame_parameters (frame, Fcons (Fcons (Qtooltip, Qt), Qnil));
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4838
79079
1e0460efd25e *** empty log message ***
Glenn Morris <rgm@gnu.org>
parents: 79076
diff changeset
4839 /* FIXME - can this be done in a similar way to normal frames?
1e0460efd25e *** empty log message ***
Glenn Morris <rgm@gnu.org>
parents: 79076
diff changeset
4840 http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */
1e0460efd25e *** empty log message ***
Glenn Morris <rgm@gnu.org>
parents: 79076
diff changeset
4841
79076
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4842 /* Set the `display-type' frame parameter before setting up faces. */
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4843 {
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4844 Lisp_Object disptype;
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4845
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4846 if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1)
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4847 disptype = intern ("mono");
79085
1ac5ff9d4bd4 Line break fix.
Richard M. Stallman <rms@gnu.org>
parents: 79079
diff changeset
4848 else if (FRAME_X_DISPLAY_INFO (f)->visual->class == GrayScale
1ac5ff9d4bd4 Line break fix.
Richard M. Stallman <rms@gnu.org>
parents: 79079
diff changeset
4849 || FRAME_X_DISPLAY_INFO (f)->visual->class == StaticGray)
79076
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4850 disptype = intern ("grayscale");
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4851 else
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4852 disptype = intern ("color");
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4853
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4854 if (NILP (Fframe_parameter (frame, Qdisplay_type)))
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4855 Fmodify_frame_parameters (frame, Fcons (Fcons (Qdisplay_type, disptype),
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4856 Qnil));
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4857 }
9dd45fcaa2f0 John Paul Wallington <jpw at pobox.com>
Glenn Morris <rgm@gnu.org>
parents: 79055
diff changeset
4858
35042
3088c9745e92 (x_create_tip_frame): Call face-set-after-frame-default,
Gerd Moellmann <gerd@gnu.org>
parents: 34976
diff changeset
4859 /* 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
4860 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
4861
0bd627ce1af8 (x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents: 35402
diff changeset
4862 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
4863 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
4864 `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
4865 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
4866 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
4867 {
0bd627ce1af8 (x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents: 35402
diff changeset
4868 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
4869
0bd627ce1af8 (x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents: 35402
diff changeset
4870 /* 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
4871 tip_frame = frame;
96553
156404854aad (x_create_tip_frame): Pass parameter argument to
Chong Yidong <cyd@stupidchicken.com>
parents: 96494
diff changeset
4872 call2 (Qface_set_after_frame_default, frame, Qnil);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4873
35508
0bd627ce1af8 (x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents: 35402
diff changeset
4874 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
4875 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
4876 Qnil));
0bd627ce1af8 (x_create_tip_frame): Prevent changing the tooltip's
Gerd Moellmann <gerd@gnu.org>
parents: 35402
diff changeset
4877 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4878
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4879 f->no_split = 1;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4880
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4881 UNGCPRO;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4882
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4883 /* 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
4884 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
4885 visible won't work. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4886 Vframe_list = Fcons (frame, Vframe_list);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4887
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4888 /* 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
4889 its display. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4890 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
4891
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4892 /* 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
4893 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
4894 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
4895 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
4896 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
4897 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
4898
34524
d4b8782e7f7b (image_cache_refcount, dpyinfo_refcount) [GLYPH_DEBUG]:
Gerd Moellmann <gerd@gnu.org>
parents: 34512
diff changeset
4899 /* Discard the unwind_protect. */
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4900 return unbind_to (count, frame);
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
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4903
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4904 /* 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
4905 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
4906 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
4907 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
4908 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
4909
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4910 static void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
4911 compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx, Lisp_Object dy, int width, int height, int *root_x, int *root_y)
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4912 {
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4913 Lisp_Object left, top;
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4914 int win_x, win_y;
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4915 Window root, child;
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4916 unsigned pmask;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4917
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4918 /* User-specified position? */
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4919 left = Fcdr (Fassq (Qleft, parms));
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4920 top = Fcdr (Fassq (Qtop, parms));
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4921
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4922 /* 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
4923 show it. */
41449
4416668397d7 (compute_tip_xy): Initialize root_x and root_y from
Jason Rumney <jasonr@gnu.org>
parents: 41132
diff changeset
4924 if (!INTEGERP (left) || !INTEGERP (top))
37253
7c3a00620335 (compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents: 37210
diff changeset
4925 {
7c3a00620335 (compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents: 37210
diff changeset
4926 BLOCK_INPUT;
7c3a00620335 (compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents: 37210
diff changeset
4927 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
4928 &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
4929 UNBLOCK_INPUT;
7c3a00620335 (compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents: 37210
diff changeset
4930 }
7c3a00620335 (compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents: 37210
diff changeset
4931
7c3a00620335 (compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents: 37210
diff changeset
4932 if (INTEGERP (top))
7c3a00620335 (compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents: 37210
diff changeset
4933 *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
4934 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
4935 *root_y = 0; /* Can happen for negative dy */
98223
033f7f08bc55 (Fx_display_pixel_width, Fx_display_pixel_height)
Chong Yidong <cyd@stupidchicken.com>
parents: 97142
diff changeset
4936 else if (*root_y + XINT (dy) + height
033f7f08bc55 (Fx_display_pixel_width, Fx_display_pixel_height)
Chong Yidong <cyd@stupidchicken.com>
parents: 97142
diff changeset
4937 <= x_display_pixel_height (FRAME_X_DISPLAY_INFO (f)))
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
4938 /* It fits below the pointer */
98223
033f7f08bc55 (Fx_display_pixel_width, Fx_display_pixel_height)
Chong Yidong <cyd@stupidchicken.com>
parents: 97142
diff changeset
4939 *root_y += XINT (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
4940 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
4941 /* 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
4942 *root_y -= height + XINT (dy);
37253
7c3a00620335 (compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents: 37210
diff changeset
4943 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
4944 /* 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
4945 *root_y = 0;
37253
7c3a00620335 (compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents: 37210
diff changeset
4946
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4947 if (INTEGERP (left))
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4948 *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
4949 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
4950 *root_x = 0; /* Can happen for negative dx */
98223
033f7f08bc55 (Fx_display_pixel_width, Fx_display_pixel_height)
Chong Yidong <cyd@stupidchicken.com>
parents: 97142
diff changeset
4951 else if (*root_x + XINT (dx) + width
033f7f08bc55 (Fx_display_pixel_width, Fx_display_pixel_height)
Chong Yidong <cyd@stupidchicken.com>
parents: 97142
diff changeset
4952 <= x_display_pixel_width (FRAME_X_DISPLAY_INFO (f)))
42247
35dd407f04cd (compute_tip_xy): If tooltip won't fit on the screen
Richard M. Stallman <rms@gnu.org>
parents: 42123
diff changeset
4953 /* 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
4954 *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
4955 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
4956 /* 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
4957 *root_x -= width + XINT (dx);
7c3a00620335 (compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents: 37210
diff changeset
4958 else
42247
35dd407f04cd (compute_tip_xy): If tooltip won't fit on the screen
Richard M. Stallman <rms@gnu.org>
parents: 42123
diff changeset
4959 /* 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
4960 *root_x = 0;
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4961 }
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4962
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4963
30224
b9f781194989 (Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents: 29947
diff changeset
4964 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
4965 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
4966 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
4967
76700
742ee8b5b284 (Fx_show_tip): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 75348
diff changeset
4968 This is an internal function; Lisp code should call `tooltip-show'.
742ee8b5b284 (Fx_show_tip): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 75348
diff changeset
4969
39905
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
4970 FRAME nil or omitted means use the selected frame.
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
4971
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
4972 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
4973 change the tooltip's appearance.
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
4974
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
4975 Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
4976 means use the default timeout of 5 seconds.
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
4977
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
4978 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
4979 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
4980 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
4981 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
4982 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
4983 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
4984 DY added (default is -10).
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
4985
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
4986 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
4987 Text larger than the specified size is clipped. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4988 (Lisp_Object string, Lisp_Object frame, Lisp_Object parms, Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy)
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4989 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4990 struct frame *f;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4991 struct window *w;
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
4992 int root_x, root_y;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4993 struct buffer *old_buffer;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4994 struct text_pos pos;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
4995 int i, width, height;
26980
f0d5e95ccce9 (Fx_show_tip): Gcpro `timeout' too.
Dave Love <fx@gnu.org>
parents: 26978
diff changeset
4996 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
4997 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
4998 int count = SPECPDL_INDEX ();
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
4999
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5000 specbind (Qinhibit_redisplay, Qt);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5001
26980
f0d5e95ccce9 (Fx_show_tip): Gcpro `timeout' too.
Dave Love <fx@gnu.org>
parents: 26978
diff changeset
5002 GCPRO4 (string, parms, frame, timeout);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5003
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
5004 CHECK_STRING (string);
91931
f7cf6a90e284 (Fx_show_tip): Set string to " " if empty.
Jan Djärv <jan.h.d@swipnet.se>
parents: 91902
diff changeset
5005 if (SCHARS (string) == 0)
f7cf6a90e284 (Fx_show_tip): Set string to " " if empty.
Jan Djärv <jan.h.d@swipnet.se>
parents: 91902
diff changeset
5006 string = make_unibyte_string (" ", 1);
f7cf6a90e284 (Fx_show_tip): Set string to " " if empty.
Jan Djärv <jan.h.d@swipnet.se>
parents: 91902
diff changeset
5007
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5008 f = check_x_frame (frame);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5009 if (NILP (timeout))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5010 timeout = make_number (5);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5011 else
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
5012 CHECK_NATNUM (timeout);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5013
30224
b9f781194989 (Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents: 29947
diff changeset
5014 if (NILP (dx))
b9f781194989 (Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents: 29947
diff changeset
5015 dx = make_number (5);
b9f781194989 (Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents: 29947
diff changeset
5016 else
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
5017 CHECK_NUMBER (dx);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5018
30224
b9f781194989 (Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents: 29947
diff changeset
5019 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
5020 dy = make_number (-10);
30224
b9f781194989 (Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents: 29947
diff changeset
5021 else
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
5022 CHECK_NUMBER (dy);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5023
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5024 if (NILP (last_show_tip_args))
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5025 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
5026
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5027 if (!NILP (tip_frame))
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5028 {
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5029 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
5030 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
5031 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
5032
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5033 if (EQ (frame, last_frame)
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5034 && !NILP (Fequal (last_string, string))
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5035 && !NILP (Fequal (last_parms, parms)))
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5036 {
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5037 struct frame *f = XFRAME (tip_frame);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5038
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5039 /* Only DX and DY have changed. */
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5040 if (!NILP (tip_timer))
35402
302fbe91e359 (Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 35360
diff changeset
5041 {
302fbe91e359 (Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 35360
diff changeset
5042 Lisp_Object timer = tip_timer;
302fbe91e359 (Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 35360
diff changeset
5043 tip_timer = Qnil;
302fbe91e359 (Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 35360
diff changeset
5044 call1 (Qcancel_timer, timer);
302fbe91e359 (Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 35360
diff changeset
5045 }
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5046
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5047 BLOCK_INPUT;
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
5048 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
5049 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
5050 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
5051 root_x, root_y);
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5052 UNBLOCK_INPUT;
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5053 goto start_timer;
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5054 }
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5055 }
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5056
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5057 /* Hide a previous tip, if any. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5058 Fx_hide_tip ();
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5059
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5060 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
5061 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
5062 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
5063
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5064 /* Add default values to frame parameters. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5065 if (NILP (Fassq (Qname, parms)))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5066 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
5067 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
5068 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
5069 if (NILP (Fassq (Qborder_width, parms)))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5070 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
5071 if (NILP (Fassq (Qborder_color, parms)))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5072 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
5073 if (NILP (Fassq (Qbackground_color, parms)))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5074 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
5075 parms);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5076
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5077 /* 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
5078 variable tip_frame. */
36869
a9cbe17061fc (x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents: 36594
diff changeset
5079 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
5080 f = XFRAME (frame);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5081
38574
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
5082 /* 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
5083 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
5084 w->left_col = w->top_line = make_number (0);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5085
38574
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
5086 if (CONSP (Vx_max_tooltip_size)
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
5087 && INTEGERP (XCAR (Vx_max_tooltip_size))
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
5088 && XINT (XCAR (Vx_max_tooltip_size)) > 0
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
5089 && INTEGERP (XCDR (Vx_max_tooltip_size))
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
5090 && XINT (XCDR (Vx_max_tooltip_size)) > 0)
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
5091 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
5092 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
5093 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
5094 }
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
5095 else
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
5096 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
5097 w->total_cols = make_number (80);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
5098 w->total_lines = make_number (40);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
5099 }
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
5100
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 51175
diff changeset
5101 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
5102 adjust_glyphs (f);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5103 w->pseudo_window_p = 1;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5104
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5105 /* 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
5106 old_buffer = current_buffer;
36869
a9cbe17061fc (x_create_tip_frame): Add parameter TEXT. Set the
Gerd Moellmann <gerd@gnu.org>
parents: 36594
diff changeset
5107 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
5108 current_buffer->truncate_lines = Qnil;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5109 clear_glyph_matrix (w->desired_matrix);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5110 clear_glyph_matrix (w->current_matrix);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5111 SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
107818
c7670de45d8a Don't abort try_window with fonts change when showing tooltip (Bug#2423).
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 107817
diff changeset
5112 try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5113
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5114 /* 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
5115 width = height = 0;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5116 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
5117 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5118 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
5119 struct glyph *last;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5120 int row_width;
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 /* 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
5123 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
5124 break;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5125
25082
ba6bf065b287 (x_create_tip_frame): Don't set bitmapIcon resource.
Gerd Moellmann <gerd@gnu.org>
parents: 25075
diff changeset
5126 /* 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
5127 row->full_width_p = 1;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5128
107819
834292200403 xfns.c (Fx_show_tip): Subtract last glyph's width only when it is for padding.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 107818
diff changeset
5129 row_width = row->pixel_width;
28410
2812a333e746 (free_image_cache): Free the cache structure itself
Gerd Moellmann <gerd@gnu.org>
parents: 28355
diff changeset
5130 /* 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
5131 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
5132 if (row->used[TEXT_AREA])
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5133 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5134 last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1];
107819
834292200403 xfns.c (Fx_show_tip): Subtract last glyph's width only when it is for padding.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 107818
diff changeset
5135 if (INTEGERP (last->object))
834292200403 xfns.c (Fx_show_tip): Subtract last glyph's width only when it is for padding.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 107818
diff changeset
5136 row_width -= last->pixel_width;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5137 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5138
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5139 height += row->height;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5140 width = max (width, row_width);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5141 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5142
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5143 /* 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
5144 window should have. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5145 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
5146 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
5147
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5148 /* 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
5149 show it. */
37253
7c3a00620335 (compute_tip_xy): Add parameters WIDTH and HEIGHT.
Gerd Moellmann <gerd@gnu.org>
parents: 37210
diff changeset
5150 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
5151
30224
b9f781194989 (Fx_show_tip): If frame parameters contain a position,
Gerd Moellmann <gerd@gnu.org>
parents: 29947
diff changeset
5152 BLOCK_INPUT;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5153 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
5154 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
5155 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
5156 UNBLOCK_INPUT;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5157
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5158 /* Draw into the window. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5159 w->must_be_updated_p = 1;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5160 update_single_window (w, 1);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5161
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5162 /* Restore original current buffer. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5163 set_buffer_internal_1 (old_buffer);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5164 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
5165
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5166 start_timer:
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5167 /* 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
5168 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
5169 intern ("x-hide-tip"));
26954
e388d69f4269 (Fx_show_tip): Add missing UNGCPRO.
Dave Love <fx@gnu.org>
parents: 26876
diff changeset
5170
e388d69f4269 (Fx_show_tip): Add missing UNGCPRO.
Dave Love <fx@gnu.org>
parents: 26876
diff changeset
5171 UNGCPRO;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5172 return unbind_to (count, Qnil);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5173 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5174
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5175
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5176 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
5177 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
5178 Value is t if tooltip was open, nil otherwise. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
5179 (void)
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5180 {
34450
5de00bff5de3 (Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents: 34321
diff changeset
5181 int count;
34476
329225ae6b61 (Fx_hide_tip): Simplified.
Gerd Moellmann <gerd@gnu.org>
parents: 34452
diff changeset
5182 Lisp_Object deleted, frame, timer;
329225ae6b61 (Fx_hide_tip): Simplified.
Gerd Moellmann <gerd@gnu.org>
parents: 34452
diff changeset
5183 struct gcpro gcpro1, gcpro2;
34450
5de00bff5de3 (Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents: 34321
diff changeset
5184
5de00bff5de3 (Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents: 34321
diff changeset
5185 /* Return quickly if nothing to do. */
34476
329225ae6b61 (Fx_hide_tip): Simplified.
Gerd Moellmann <gerd@gnu.org>
parents: 34452
diff changeset
5186 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
5187 return Qnil;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5188
34476
329225ae6b61 (Fx_hide_tip): Simplified.
Gerd Moellmann <gerd@gnu.org>
parents: 34452
diff changeset
5189 frame = tip_frame;
329225ae6b61 (Fx_hide_tip): Simplified.
Gerd Moellmann <gerd@gnu.org>
parents: 34452
diff changeset
5190 timer = tip_timer;
329225ae6b61 (Fx_hide_tip): Simplified.
Gerd Moellmann <gerd@gnu.org>
parents: 34452
diff changeset
5191 GCPRO2 (frame, timer);
329225ae6b61 (Fx_hide_tip): Simplified.
Gerd Moellmann <gerd@gnu.org>
parents: 34452
diff changeset
5192 tip_frame = tip_timer = deleted = Qnil;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5193
46285
3f111801efb4 Rename BINDING_STACK_SIZE to SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents: 45968
diff changeset
5194 count = SPECPDL_INDEX ();
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5195 specbind (Qinhibit_redisplay, Qt);
34450
5de00bff5de3 (Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents: 34321
diff changeset
5196 specbind (Qinhibit_quit, Qt);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5197
34476
329225ae6b61 (Fx_hide_tip): Simplified.
Gerd Moellmann <gerd@gnu.org>
parents: 34452
diff changeset
5198 if (!NILP (timer))
35402
302fbe91e359 (Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 35360
diff changeset
5199 call1 (Qcancel_timer, timer);
34476
329225ae6b61 (Fx_hide_tip): Simplified.
Gerd Moellmann <gerd@gnu.org>
parents: 34452
diff changeset
5200
329225ae6b61 (Fx_hide_tip): Simplified.
Gerd Moellmann <gerd@gnu.org>
parents: 34452
diff changeset
5201 if (FRAMEP (frame))
329225ae6b61 (Fx_hide_tip): Simplified.
Gerd Moellmann <gerd@gnu.org>
parents: 34452
diff changeset
5202 {
100632
389db2f016a4 * frame.c (delete_frame): New function derived from
Martin Rudalics <rudalics@gmx.at>
parents: 100382
diff changeset
5203 delete_frame (frame, Qnil);
34450
5de00bff5de3 (Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents: 34321
diff changeset
5204 deleted = Qt;
33713
91b2daa9479f (Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents: 33657
diff changeset
5205
91b2daa9479f (Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents: 33657
diff changeset
5206 #ifdef USE_LUCID
91b2daa9479f (Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents: 33657
diff changeset
5207 /* 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
5208 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
5209 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
5210 {
91b2daa9479f (Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents: 33657
diff changeset
5211 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
5212 Widget w = f->output_data.x->menubar_widget;
39675
a4def4204419 *** empty log message ***
Pavel Janík <Pavel@Janik.cz>
parents: 39619
diff changeset
5213
33713
91b2daa9479f (Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents: 33657
diff changeset
5214 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
5215 && w != NULL)
33713
91b2daa9479f (Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents: 33657
diff changeset
5216 {
91b2daa9479f (Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents: 33657
diff changeset
5217 BLOCK_INPUT;
91b2daa9479f (Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents: 33657
diff changeset
5218 xlwmenu_redisplay (w);
91b2daa9479f (Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents: 33657
diff changeset
5219 UNBLOCK_INPUT;
91b2daa9479f (Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents: 33657
diff changeset
5220 }
91b2daa9479f (Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents: 33657
diff changeset
5221 }
91b2daa9479f (Fx_hide_tip) [USE_LUCID]: Add a hack to redisplay
Gerd Moellmann <gerd@gnu.org>
parents: 33657
diff changeset
5222 #endif /* USE_LUCID */
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5223 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5224
34476
329225ae6b61 (Fx_hide_tip): Simplified.
Gerd Moellmann <gerd@gnu.org>
parents: 34452
diff changeset
5225 UNGCPRO;
34450
5de00bff5de3 (Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents: 34321
diff changeset
5226 return unbind_to (count, deleted);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5227 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5228
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5229
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5230
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5231 /***********************************************************************
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5232 File selection dialog
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5233 ***********************************************************************/
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5234
67761
5b8799d65159 * xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents: 67654
diff changeset
5235 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
5236 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
5237 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
5238 doc: /* Return t if the old Gtk+ file selection dialog is used. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
5239 (void)
67761
5b8799d65159 * xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents: 67654
diff changeset
5240 {
5b8799d65159 * xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents: 67654
diff changeset
5241 #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
5242 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
5243 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
5244
5b8799d65159 * xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents: 67654
diff changeset
5245 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
5246 && 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
5247 && 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
5248 && 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
5249 return Qt;
5b8799d65159 * xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents: 67654
diff changeset
5250 #endif
5b8799d65159 * xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents: 67654
diff changeset
5251 return Qnil;
5b8799d65159 * xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents: 67654
diff changeset
5252 }
5b8799d65159 * xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents: 67654
diff changeset
5253
5b8799d65159 * xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents: 67654
diff changeset
5254
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5255 #ifdef USE_MOTIF
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5256 /* 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
5257
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5258 static void
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5259 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
5260 Widget widget;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5261 XtPointer call_data, client_data;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5262 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5263 int *result = (int *) client_data;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5264 XmAnyCallbackStruct *cb = (XmAnyCallbackStruct *) call_data;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5265 *result = cb->reason;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5266 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5267
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5268
37556
171c0f4964a9 (file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37253
diff changeset
5269 /* 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
5270 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
5271 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
5272 in this case. */
171c0f4964a9 (file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37253
diff changeset
5273
171c0f4964a9 (file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37253
diff changeset
5274 static void
171c0f4964a9 (file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37253
diff changeset
5275 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
5276 Widget widget;
171c0f4964a9 (file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37253
diff changeset
5277 XtPointer call_data, client_data;
171c0f4964a9 (file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37253
diff changeset
5278 {
171c0f4964a9 (file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37253
diff changeset
5279 int *result = (int *) client_data;
171c0f4964a9 (file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37253
diff changeset
5280 *result = XmCR_CANCEL;
171c0f4964a9 (file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37253
diff changeset
5281 }
171c0f4964a9 (file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37253
diff changeset
5282
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
5283 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
5284 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
5285 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
5286 {
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
5287 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
5288 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
5289
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
5290 /* 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
5291 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
5292 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
5293 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
5294 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
5295 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
5296
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
5297 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
5298 }
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
5299
37556
171c0f4964a9 (file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37253
diff changeset
5300
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
5301 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
5302 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
5303 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
5304 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
5305 or directory must exist. ONLY-DIR-P is ignored." */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
5306 (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p)
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5307 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5308 int result;
25679
8b09c5927f1c (QCfile): Moved to xdisp.c.
Gerd Moellmann <gerd@gnu.org>
parents: 25646
diff changeset
5309 struct frame *f = SELECTED_FRAME ();
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5310 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
5311 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
5312 Widget dialog, text, help;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5313 Arg al[10];
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5314 int ac = 0;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5315 extern XtAppContext Xt_app_con;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5316 XmString dir_xmstring, pattern_xmstring;
46295
b77ef572e1c9 Use macro SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents: 46285
diff changeset
5317 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
5318 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
5319
72774
e00572984112 (Fx_file_dialog): Call check_x.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 72529
diff changeset
5320 check_x ();
e00572984112 (Fx_file_dialog): Call check_x.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 72529
diff changeset
5321
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
5322 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
5323
58283
c163562b2d59 * xmenu.c (x_menu_in_use): Removed.
Jan Djärv <jan.h.d@swipnet.se>
parents: 58214
diff changeset
5324 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
5325 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
5326
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
5327 CHECK_STRING (prompt);
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40608
diff changeset
5328 CHECK_STRING (dir);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5329
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5330 /* Prevent redisplay. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5331 specbind (Qinhibit_redisplay, Qt);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5332
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5333 BLOCK_INPUT;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5334
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5335 /* 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
5336 directory and using "*" as pattern. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5337 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
5338 dir_xmstring = XmStringCreateLocalized (SDATA (dir));
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5339 pattern_xmstring = XmStringCreateLocalized ("*");
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5340
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46295
diff changeset
5341 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
5342 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
5343 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
5344 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
5345 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
5346 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
5347 "fsb", al, ac);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5348 XmStringFree (dir_xmstring);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5349 XmStringFree (pattern_xmstring);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5350
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5351 /* Add callbacks for OK and Cancel. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5352 XtAddCallback (dialog, XmNokCallback, file_dialog_cb,
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5353 (XtPointer) &result);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5354 XtAddCallback (dialog, XmNcancelCallback, file_dialog_cb,
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5355 (XtPointer) &result);
37556
171c0f4964a9 (file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37253
diff changeset
5356 XtAddCallback (dialog, XmNunmapCallback, file_dialog_unmap_cb,
171c0f4964a9 (file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37253
diff changeset
5357 (XtPointer) &result);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5358
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
5359 /* 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
5360 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
5361 XtUnmanageChild (help);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5362
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5363 /* Mark OK button as default. */
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5364 XtVaSetValues (XmFileSelectionBoxGetChild (dialog, XmDIALOG_OK_BUTTON),
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5365 XmNshowAsDefault, True, NULL);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5366
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5367 /* 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
5368 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
5369 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
5370 the result file name, then. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5371 text = XmFileSelectionBoxGetChild (dialog, XmDIALOG_TEXT);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5372 if (!NILP (mustmatch))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5373 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5374 Widget label;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5375 label = XmFileSelectionBoxGetChild (dialog, XmDIALOG_SELECTION_LABEL);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5376 XtSetSensitive (text, False);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5377 XtSetSensitive (label, False);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5378 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5379
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5380 /* 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
5381 XtManageChild (dialog);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5382
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5383 if (STRINGP (default_filename))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5384 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5385 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
5386 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
5387 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
5388
c955f6add62a * fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents: 57765
diff changeset
5389 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
5390 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
5391 (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
5392
c955f6add62a * fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents: 57765
diff changeset
5393 /* 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
5394 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
5395
c955f6add62a * fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents: 57765
diff changeset
5396 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
5397
c955f6add62a * fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents: 57765
diff changeset
5398 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
5399 {
c955f6add62a * fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents: 57765
diff changeset
5400 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
5401 /* 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
5402 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
5403 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
5404 }
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
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5406 XmStringFree (default_xmstring);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5407 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5408
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
5409 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
5410
49117
f8288cd7d1cd *** empty log message ***
Jan Djärv <jan.h.d@swipnet.se>
parents: 49080
diff changeset
5411 /* 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
5412 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
5413 result = 0;
37556
171c0f4964a9 (file_dialog_unmap_cb): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 37253
diff changeset
5414 while (result == 0)
38548
58603538f196 (Fx_file_dialog): Block/unblock input while processing
Gerd Moellmann <gerd@gnu.org>
parents: 38542
diff changeset
5415 {
49117
f8288cd7d1cd *** empty log message ***
Jan Djärv <jan.h.d@swipnet.se>
parents: 49080
diff changeset
5416 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
5417 x_menu_wait_for_event (0);
49117
f8288cd7d1cd *** empty log message ***
Jan Djärv <jan.h.d@swipnet.se>
parents: 49080
diff changeset
5418 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
5419 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
5420 && 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
5421 {
0096c58ce34a * xmenu.c (popup_get_selection): Pop down on C-g.
Jan Djärv <jan.h.d@swipnet.se>
parents: 58463
diff changeset
5422 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
5423
0096c58ce34a * xmenu.c (popup_get_selection): Pop down on C-g.
Jan Djärv <jan.h.d@swipnet.se>
parents: 58463
diff changeset
5424 /* 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
5425 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
5426 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
5427 }
59904
adc18da68682 (unwind_create_frame) [!GLYPH_DEBUG]: Fix xassert.
Kim F. Storm <storm@cua.dk>
parents: 59789
diff changeset
5428
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
5429 (void) x_dispatch_event (&event, FRAME_X_DISPLAY (f));
49117
f8288cd7d1cd *** empty log message ***
Jan Djärv <jan.h.d@swipnet.se>
parents: 49080
diff changeset
5430 }
29866
c31c4d7dd0e0 (Fx_file_dialog) [HAVE_MOTIF_2_1]: Handle events
Gerd Moellmann <gerd@gnu.org>
parents: 29728
diff changeset
5431
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5432 /* Get the result. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5433 if (result == XmCR_OK)
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5434 {
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5435 XmString text;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5436 String data;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5437
30573
3bb43339533c (Fx_file_dialog): Use NULL instead of 0 at the end of
Gerd Moellmann <gerd@gnu.org>
parents: 30383
diff changeset
5438 XtVaGetValues (dialog, XmNtextString, &text, NULL);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5439 XmStringGetLtoR (text, XmFONTLIST_DEFAULT_TAG, &data);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5440 XmStringFree (text);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5441 file = build_string (data);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5442 XtFree (data);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5443 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5444 else
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5445 file = Qnil;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5446
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5447 UNBLOCK_INPUT;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5448 UNGCPRO;
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5449
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5450 /* Make "Cancel" equivalent to C-g. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5451 if (NILP (file))
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5452 Fsignal (Qquit, Qnil);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5453
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
5454 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
5455
4c87a7783f95 * xfns.c (Fx_file_dialog, Motif and GTK): DECODE_FILE before
Jan Djärv <jan.h.d@swipnet.se>
parents: 68880
diff changeset
5456 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
5457 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5458
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5459 #endif /* USE_MOTIF */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5460
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5461 #ifdef USE_GTK
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5462
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
5463 static Lisp_Object
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
5464 clean_up_dialog (Lisp_Object arg)
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
5465 {
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
5466 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
5467
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
5468 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
5469 }
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
5470
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
5471 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
5472 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
5473 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
5474 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
5475 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
5476 directories. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
5477 (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p)
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5478 {
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5479 FRAME_PTR f = SELECTED_FRAME ();
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5480 char *fn;
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5481 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
5482 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
5483 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
5484 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5485 char *cdef_file;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5486
72774
e00572984112 (Fx_file_dialog): Call check_x.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 72529
diff changeset
5487 check_x ();
e00572984112 (Fx_file_dialog): Call check_x.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents: 72529
diff changeset
5488
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
5489 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
5490
58283
c163562b2d59 * xmenu.c (x_menu_in_use): Removed.
Jan Djärv <jan.h.d@swipnet.se>
parents: 58214
diff changeset
5491 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
5492 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
5493
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5494 CHECK_STRING (prompt);
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5495 CHECK_STRING (dir);
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5496
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5497 /* Prevent redisplay. */
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5498 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
5499 record_unwind_protect (clean_up_dialog, Qnil);
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5500
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5501 BLOCK_INPUT;
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5502
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5503 if (STRINGP (default_filename))
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5504 cdef_file = SDATA (default_filename);
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5505 else
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5506 cdef_file = SDATA (dir);
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5507
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
5508 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
5509 ! 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
5510 ! NILP (only_dir_p));
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5511
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5512 if (fn)
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5513 {
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5514 file = build_string (fn);
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5515 xfree (fn);
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5516 }
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5517
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5518 UNBLOCK_INPUT;
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5519 UNGCPRO;
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5520
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5521 /* Make "Cancel" equivalent to C-g. */
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5522 if (NILP (file))
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5523 Fsignal (Qquit, Qnil);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5524
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
5525 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
5526
4c87a7783f95 * xfns.c (Fx_file_dialog, Motif and GTK): DECODE_FILE before
Jan Djärv <jan.h.d@swipnet.se>
parents: 68880
diff changeset
5527 return unbind_to (count, decoded_file);
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5528 }
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5529
95795
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5530
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5531 #ifdef HAVE_FREETYPE
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5532
95850
5301c67af098 (Fx_select_font): Rename from x-font-dialog.
Chong Yidong <cyd@stupidchicken.com>
parents: 95795
diff changeset
5533 DEFUN ("x-select-font", Fx_select_font, Sx_select_font, 0, 2, 0,
5301c67af098 (Fx_select_font): Rename from x-font-dialog.
Chong Yidong <cyd@stupidchicken.com>
parents: 95795
diff changeset
5534 doc: /* Read a font name using a GTK font selection dialog.
5301c67af098 (Fx_select_font): Rename from x-font-dialog.
Chong Yidong <cyd@stupidchicken.com>
parents: 95795
diff changeset
5535 Return a GTK-style font string corresponding to the selection.
5301c67af098 (Fx_select_font): Rename from x-font-dialog.
Chong Yidong <cyd@stupidchicken.com>
parents: 95795
diff changeset
5536
5301c67af098 (Fx_select_font): Rename from x-font-dialog.
Chong Yidong <cyd@stupidchicken.com>
parents: 95795
diff changeset
5537 If FRAME is omitted or nil, it defaults to the selected frame. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
5538 (Lisp_Object frame, Lisp_Object ignored)
95795
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5539 {
95850
5301c67af098 (Fx_select_font): Rename from x-font-dialog.
Chong Yidong <cyd@stupidchicken.com>
parents: 95795
diff changeset
5540 FRAME_PTR f = check_x_frame (frame);
95974
337a71ccee89 (Fx_select_font): Give GTK font dialog the default font name.
Chong Yidong <cyd@stupidchicken.com>
parents: 95954
diff changeset
5541 char *name;
106085
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
5542 Lisp_Object font;
103840
a9bb4a9d0ebd xfns.c (Fx_select_font): Remember last font selected in
Jan Djärv <jan.h.d@swipnet.se>
parents: 103706
diff changeset
5543 Lisp_Object font_param;
a9bb4a9d0ebd xfns.c (Fx_select_font): Remember last font selected in
Jan Djärv <jan.h.d@swipnet.se>
parents: 103706
diff changeset
5544 char *default_name = NULL;
106085
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
5545 struct gcpro gcpro1, gcpro2;
95795
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5546 int count = SPECPDL_INDEX ();
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5547
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5548 check_x ();
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5549
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5550 if (popup_activated ())
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5551 error ("Trying to use a menu from within a menu-entry");
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5552
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5553 /* Prevent redisplay. */
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5554 specbind (Qinhibit_redisplay, Qt);
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5555 record_unwind_protect (clean_up_dialog, Qnil);
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5556
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5557 BLOCK_INPUT;
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5558
106085
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
5559 GCPRO2(font_param, font);
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
5560
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
5561 XSETFONT (font, FRAME_FONT (f));
106201
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5562 font_param = Ffont_get (font, intern (":name"));
106085
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
5563 if (STRINGP (font_param))
106201
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5564 default_name = xstrdup (SDATA (font_param));
106085
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
5565 else
95795
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5566 {
106085
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
5567 font_param = Fframe_parameter (frame, Qfont_param);
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
5568 if (STRINGP (font_param))
106201
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5569 default_name = xstrdup (SDATA (font_param));
95974
337a71ccee89 (Fx_select_font): Give GTK font dialog the default font name.
Chong Yidong <cyd@stupidchicken.com>
parents: 95954
diff changeset
5570 }
103840
a9bb4a9d0ebd xfns.c (Fx_select_font): Remember last font selected in
Jan Djärv <jan.h.d@swipnet.se>
parents: 103706
diff changeset
5571
106085
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
5572 if (default_name == NULL && x_last_font_name != NULL)
106201
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5573 default_name = xstrdup (x_last_font_name);
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5574
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5575 /* Convert fontconfig names to Gtk names, i.e. remove - before number */
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5576 if (default_name)
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5577 {
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5578 char *p = strrchr (default_name, '-');
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5579 if (p)
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5580 {
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5581 char *ep = p+1;
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5582 while (isdigit (*ep))
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5583 ++ep;
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5584 if (*ep == '\0') *p = ' ';
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5585 }
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5586 }
106085
cd4cbab8bb21 Handle system default font and changing font parameters.
Jan Djärv <jan.h.d@swipnet.se>
parents: 105959
diff changeset
5587
103840
a9bb4a9d0ebd xfns.c (Fx_select_font): Remember last font selected in
Jan Djärv <jan.h.d@swipnet.se>
parents: 103706
diff changeset
5588 name = xg_get_font_name (f, default_name);
106201
01190029e5d3 Set Xft defaults if no XSETTING is found, better default for Gtk+ font dialog.
Jan Djärv <jan.h.d@swipnet.se>
parents: 106162
diff changeset
5589 xfree (default_name);
95974
337a71ccee89 (Fx_select_font): Give GTK font dialog the default font name.
Chong Yidong <cyd@stupidchicken.com>
parents: 95954
diff changeset
5590
337a71ccee89 (Fx_select_font): Give GTK font dialog the default font name.
Chong Yidong <cyd@stupidchicken.com>
parents: 95954
diff changeset
5591 if (name)
337a71ccee89 (Fx_select_font): Give GTK font dialog the default font name.
Chong Yidong <cyd@stupidchicken.com>
parents: 95954
diff changeset
5592 {
337a71ccee89 (Fx_select_font): Give GTK font dialog the default font name.
Chong Yidong <cyd@stupidchicken.com>
parents: 95954
diff changeset
5593 font = build_string (name);
103840
a9bb4a9d0ebd xfns.c (Fx_select_font): Remember last font selected in
Jan Djärv <jan.h.d@swipnet.se>
parents: 103706
diff changeset
5594 g_free (x_last_font_name);
a9bb4a9d0ebd xfns.c (Fx_select_font): Remember last font selected in
Jan Djärv <jan.h.d@swipnet.se>
parents: 103706
diff changeset
5595 x_last_font_name = name;
95795
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5596 }
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5597
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5598 UNBLOCK_INPUT;
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5599
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5600 if (NILP (font))
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5601 Fsignal (Qquit, Qnil);
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5602
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5603 return unbind_to (count, font);
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5604 }
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5605 #endif /* HAVE_FREETYPE */
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5606
49322
2cbb0b823e83 GTK version
Jan Djärv <jan.h.d@swipnet.se>
parents: 49117
diff changeset
5607 #endif /* USE_GTK */
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5608
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5609
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5610 /***********************************************************************
34549
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5611 Keyboard
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5612 ***********************************************************************/
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5613
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5614 #ifdef HAVE_XKBGETKEYBOARD
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5615 #include <X11/XKBlib.h>
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5616 #include <X11/keysym.h>
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5617 #endif
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5618
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5619 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
5620 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
5621 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
5622 FRAME nil means use the selected frame.
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
5623 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
5624 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
5625 present and mapped to the usual X keysyms. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
5626 (Lisp_Object frame)
34549
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5627 {
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5628 #ifdef HAVE_XKBGETKEYBOARD
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5629 XkbDescPtr kb;
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5630 struct frame *f = check_x_frame (frame);
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5631 Display *dpy = FRAME_X_DISPLAY (f);
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5632 Lisp_Object have_keys;
34911
4cdfcac861d7 (Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents: 34895
diff changeset
5633 int major, minor, op, event, error;
34549
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5634
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5635 BLOCK_INPUT;
34911
4cdfcac861d7 (Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents: 34895
diff changeset
5636
4cdfcac861d7 (Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents: 34895
diff changeset
5637 /* 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
5638 major = XkbMajorVersion;
4cdfcac861d7 (Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents: 34895
diff changeset
5639 minor = XkbMinorVersion;
4cdfcac861d7 (Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents: 34895
diff changeset
5640 if (!XkbLibraryVersion (&major, &minor))
35191
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5641 {
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5642 UNBLOCK_INPUT;
67654
f6416d33b0a2 (Fx_backspace_delete_keys_p): In case we cannot determine
Dan Nicolaescu <dann@ics.uci.edu>
parents: 67581
diff changeset
5643 return Qlambda;
35191
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5644 }
34911
4cdfcac861d7 (Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents: 34895
diff changeset
5645
4cdfcac861d7 (Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents: 34895
diff changeset
5646 /* 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
5647 major = XkbMajorVersion;
4cdfcac861d7 (Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents: 34895
diff changeset
5648 minor = XkbMinorVersion;
4cdfcac861d7 (Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents: 34895
diff changeset
5649 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
5650 {
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5651 UNBLOCK_INPUT;
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;
35191
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5653 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5654
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
5655 /* 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
5656 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
5657 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
5658 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
5659 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
5660 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
5661 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
5662 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
5663 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
5664 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
5665 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
5666 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
5667 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
5668 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
5669 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
5670
34911
4cdfcac861d7 (Fx_backspace_delete_keys_p): Check library and server
Gerd Moellmann <gerd@gnu.org>
parents: 34895
diff changeset
5671 have_keys = Qnil;
35191
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5672 kb = XkbGetMap (dpy, XkbAllMapComponentsMask, XkbUseCoreKbd);
34549
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5673 if (kb)
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5674 {
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5675 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
5676
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5677 if (XkbGetNames (dpy, XkbAllNamesMask, kb) == Success)
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5678 {
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5679 for (i = kb->min_key_code;
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5680 (i < kb->max_key_code
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5681 && (delete_keycode == 0 || backspace_keycode == 0));
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5682 ++i)
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5683 {
38574
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
5684 /* 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
5685 the PS file generated by `xkbprint -label name
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
5686 $DISPLAY'. */
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
5687 if (memcmp ("DELE", kb->names->keys[i].name, 4) == 0)
35191
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5688 delete_keycode = i;
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109143
diff changeset
5689 else if (memcmp ("BKSP", kb->names->keys[i].name, 4) == 0)
35191
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5690 backspace_keycode = i;
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5691 }
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5692
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5693 XkbFreeNames (kb, 0, True);
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5694 }
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5695
3de883052d49 (Fx_backspace_delete_keys_p): Use XkbGetMap and
Gerd Moellmann <gerd@gnu.org>
parents: 35146
diff changeset
5696 XkbFreeClientMap (kb, 0, True);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5697
34549
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5698 if (delete_keycode
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5699 && backspace_keycode
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5700 && XKeysymToKeycode (dpy, XK_Delete) == delete_keycode
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5701 && XKeysymToKeycode (dpy, XK_BackSpace) == backspace_keycode)
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5702 have_keys = Qt;
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5703 }
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5704 UNBLOCK_INPUT;
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5705 return have_keys;
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5706 #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
5707 return Qlambda;
34549
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5708 #endif /* not HAVE_XKBGETKEYBOARD */
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5709 }
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5710
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5711
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5712
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5713 /***********************************************************************
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5714 Initialization
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5715 ***********************************************************************/
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5716
51175
a072cc265dff (x_window): Fix typo.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 51130
diff changeset
5717 /* 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
5718 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
5719
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5720 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
5721 {
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5722 x_set_autoraise,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5723 x_set_autolower,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5724 x_set_background_color,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5725 x_set_border_color,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5726 x_set_border_width,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5727 x_set_cursor_color,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5728 x_set_cursor_type,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5729 x_set_font,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5730 x_set_foreground_color,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5731 x_set_icon_name,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5732 x_set_icon_type,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5733 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
5734 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
5735 x_set_mouse_color,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5736 x_explicitly_set_name,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5737 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
5738 x_set_title,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5739 x_set_unsplittable,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5740 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
5741 x_set_visibility,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5742 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
5743 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
5744 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
5745 x_set_screen_gamma,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5746 x_set_line_spacing,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5747 x_set_fringe_width,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5748 x_set_fringe_width,
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5749 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
5750 x_set_fullscreen,
95159
3a5987224fad Seiji Zenitani <zenitani at mac.com>
Glenn Morris <rgm@gnu.org>
parents: 94963
diff changeset
5751 x_set_font_backend,
103674
1867be80e595 * w32fns.c (w32_frame_parm_handlers): Set 0 for sticky.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103052
diff changeset
5752 x_set_alpha,
1867be80e595 * w32fns.c (w32_frame_parm_handlers): Set 0 for sticky.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103052
diff changeset
5753 x_set_sticky,
50370
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5754 };
0c01548d7ed3 The following changes consolidates the common code related to
Kim F. Storm <storm@cua.dk>
parents: 50236
diff changeset
5755
21846
486ac68ce051 Fix -Wimplicit warnings.
Andreas Schwab <schwab@suse.de>
parents: 21779
diff changeset
5756 void
109126
aec1143e8d85 Convert (most) functions in src to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109100
diff changeset
5757 syms_of_xfns (void)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5758 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5759 /* 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
5760 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
5761
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5762 /* 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
5763 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
5764 /*&&& init symbols here &&&*/
105877
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105671
diff changeset
5765 Qnone = intern_c_string ("none");
1874
19cf50641d6c * frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
5766 staticpro (&Qnone);
105877
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105671
diff changeset
5767 Qsuppress_icon = intern_c_string ("suppress-icon");
2328
82e4fed9cdd6 * xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents: 2295
diff changeset
5768 staticpro (&Qsuppress_icon);
105877
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105671
diff changeset
5769 Qundefined_color = intern_c_string ("undefined-color");
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5770 staticpro (&Qundefined_color);
105877
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105671
diff changeset
5771 Qcompound_text = intern_c_string ("compound-text");
30351
a67fcab978bb (x_encode_text): New function.
Kenichi Handa <handa@m17n.org>
parents: 30224
diff changeset
5772 staticpro (&Qcompound_text);
105877
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105671
diff changeset
5773 Qcancel_timer = intern_c_string ("cancel-timer");
35402
302fbe91e359 (Qcancel_timer): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 35360
diff changeset
5774 staticpro (&Qcancel_timer);
105877
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105671
diff changeset
5775 Qfont_param = intern_c_string ("font-parameter");
96079
efbaf6995245 * w32fns.c, xfns.c (Qfont_param): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95974
diff changeset
5776 staticpro (&Qfont_param);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5777 /* 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
5778
26876
578acd06aa3b Include intervals.h.
Kenichi Handa <handa@m17n.org>
parents: 26808
diff changeset
5779 /* Text property `display' should be nonsticky by default. */
578acd06aa3b Include intervals.h.
Kenichi Handa <handa@m17n.org>
parents: 26808
diff changeset
5780 Vtext_property_default_nonsticky
578acd06aa3b Include intervals.h.
Kenichi Handa <handa@m17n.org>
parents: 26808
diff changeset
5781 = Fcons (Fcons (Qdisplay, Qt), Vtext_property_default_nonsticky);
578acd06aa3b Include intervals.h.
Kenichi Handa <handa@m17n.org>
parents: 26808
diff changeset
5782
578acd06aa3b Include intervals.h.
Kenichi Handa <handa@m17n.org>
parents: 26808
diff changeset
5783
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5784 Fput (Qundefined_color, Qerror_conditions,
105877
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105671
diff changeset
5785 pure_cons (Qundefined_color, pure_cons (Qerror, Qnil)));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5786 Fput (Qundefined_color, Qerror_message,
105877
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105671
diff changeset
5787 make_pure_c_string ("Undefined color"));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
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-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
5790 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
5791 Changing the value does not affect existing frames
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
5792 unless you set the mouse color. */);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5793 Vx_pointer_shape = Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5794
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5795 #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
5796 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
5797 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
5798 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
5799 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
5800 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5801 Vx_nontext_pointer_shape = Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5802
39988
eac4e9ae201c Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents: 39907
diff changeset
5803 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
5804 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
5805 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
5806 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
5807 Vx_hourglass_pointer_shape = Qnil;
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 35859
diff changeset
5808
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5809 #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
5810 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
5811 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
5812 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
5813 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
5814 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5815 Vx_mode_pointer_shape = Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5816
16396
4e4cc27b2a2a (x_set_internal_border_width): Only change
Richard M. Stallman <rms@gnu.org>
parents: 16357
diff changeset
5817 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
5818 &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
5819 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
5820 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
5821 or when you set the mouse color. */);
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5822 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
5823
33960
1f92a2d65681 (Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 33747
diff changeset
5824 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
5825 &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
5826 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
5827 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
5828 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
5829 Vx_window_horizontal_drag_shape = Qnil;
1f92a2d65681 (Vx_window_horizontal_drag_shape): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 33747
diff changeset
5830
39988
eac4e9ae201c Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents: 39907
diff changeset
5831 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
5832 doc: /* A string indicating the foreground color of the cursor box. */);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5833 Vx_cursor_fore_pixel = Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5834
39988
eac4e9ae201c Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents: 39907
diff changeset
5835 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
5836 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
5837 Text larger than this is clipped. */);
38574
79a0d7b341b3 (Vx_max_tooltip_size): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 38548
diff changeset
5838 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
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 ("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
5841 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
5842 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
5843 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
5844 /* 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
5845 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
5846 Vx_no_window_manager = Qnil;
8170
d92a24366b22 (x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8103
diff changeset
5847
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5848 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
5849 &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
5850 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
5851
542a86892257 Put doc strings in comments.
Gerd Moellmann <gerd@gnu.org>
parents: 39862
diff changeset
5852 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
5853 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
5854 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
5855 Chinese, Japanese, and Korean. */);
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5856 Vx_pixel_size_width_font_regexp = Qnil;
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5857
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
5858 /* 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
5859 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
5860 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
5861 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
5862 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
5863 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
5864 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
5865
67842
095b05723996 * xfns.c: x_show_hidden_files, new variable.
Jan Djärv <jan.h.d@swipnet.se>
parents: 67761
diff changeset
5866 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
5867 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
5868 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
5869 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
5870 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
5871
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
5872 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
5873 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
5874 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
5875 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
5876 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
5877
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
5878 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
5879 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
5880 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
5881 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
5882 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
5883
105877
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105671
diff changeset
5884 Fprovide (intern_c_string ("x"), Qnil);
66502
dd57bcb034c0 (syms_of_xfns): Provide `x' as feature.
Richard M. Stallman <rms@gnu.org>
parents: 65936
diff changeset
5885
8170
d92a24366b22 (x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8103
diff changeset
5886 #ifdef USE_X_TOOLKIT
105877
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105671
diff changeset
5887 Fprovide (intern_c_string ("x-toolkit"), Qnil);
12094
a9fda5417acf (syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents: 12080
diff changeset
5888 #ifdef USE_MOTIF
105877
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105671
diff changeset
5889 Fprovide (intern_c_string ("motif"), Qnil);
37210
8b47704e0150 (Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37173
diff changeset
5890
39988
eac4e9ae201c Change doc-string comments to `new style' [w/`doc:' keyword].
Miles Bader <miles@gnu.org>
parents: 39907
diff changeset
5891 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
5892 doc: /* Version info for LessTif/Motif. */);
37210
8b47704e0150 (Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37173
diff changeset
5893 Vmotif_version_string = build_string (XmVERSION_STRING);
8b47704e0150 (Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37173
diff changeset
5894 #endif /* USE_MOTIF */
8b47704e0150 (Vmotif_version_string) [USE_MOTIF]: New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 37173
diff changeset
5895 #endif /* USE_X_TOOLKIT */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5896
52334
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
5897 #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
5898 /* 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
5899 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
5900 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
5901 accepts --with-x-toolkit=gtk. */
105877
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105671
diff changeset
5902 Fprovide (intern_c_string ("x-toolkit"), Qnil);
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105671
diff changeset
5903 Fprovide (intern_c_string ("gtk"), Qnil);
52334
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
5904
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
5905 DEFVAR_LISP ("gtk-version-string", &Vgtk_version_string,
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
5906 doc: /* Version info for GTK+. */);
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
5907 {
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
5908 char gtk_version[40];
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
5909 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
5910 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
105942
5fc80e6b5b7c * xfns.c (syms_of_xfns): Use make_pure_string instead of build_string.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105877
diff changeset
5911 Vgtk_version_string = make_pure_string (gtk_version, strlen (gtk_version), strlen (gtk_version), 0);
52334
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
5912 }
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
5913 #endif /* USE_GTK */
a721547105d6 (Vgtk_version_string): New variable.
Lute Kamstra <lute@gnu.org>
parents: 52298
diff changeset
5914
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5915 /* X window properties. */
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5916 defsubr (&Sx_change_window_property);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5917 defsubr (&Sx_delete_window_property);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5918 defsubr (&Sx_window_property);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5919
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26571
diff changeset
5920 defsubr (&Sxw_display_color_p);
8779
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
5921 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
5922 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
5923 defsubr (&Sxw_color_values);
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
5924 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
5925 defsubr (&Sx_server_vendor);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5926 defsubr (&Sx_server_version);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5927 defsubr (&Sx_display_pixel_width);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5928 defsubr (&Sx_display_pixel_height);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5929 defsubr (&Sx_display_mm_width);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5930 defsubr (&Sx_display_mm_height);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5931 defsubr (&Sx_display_screens);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5932 defsubr (&Sx_display_planes);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5933 defsubr (&Sx_display_color_cells);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5934 defsubr (&Sx_display_visual_class);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5935 defsubr (&Sx_display_backing_store);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5936 defsubr (&Sx_display_save_under);
99346
9c62c9e7bd57 (Fx_wm_set_size_hint): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 98223
diff changeset
5937 defsubr (&Sx_wm_set_size_hint);
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
5938 defsubr (&Sx_create_frame);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5939 defsubr (&Sx_open_connection);
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5940 defsubr (&Sx_close_connection);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5941 defsubr (&Sx_display_list);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5942 defsubr (&Sx_synchronize);
28044
88db4c84b6fd Remove a buch of really old code in #if 0.
Gerd Moellmann <gerd@gnu.org>
parents: 28010
diff changeset
5943 defsubr (&Sx_focus_frame);
34549
708ea44ef3c0 (Fx_backspace_delete_keys_p): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 34524
diff changeset
5944 defsubr (&Sx_backspace_delete_keys_p);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49473
diff changeset
5945
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5946 /* Setting callback functions for fontset handler. */
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5947 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
5948
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5949 defsubr (&Sx_show_tip);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5950 defsubr (&Sx_hide_tip);
34450
5de00bff5de3 (Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents: 34321
diff changeset
5951 tip_timer = Qnil;
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5952 staticpro (&tip_timer);
34450
5de00bff5de3 (Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents: 34321
diff changeset
5953 tip_frame = Qnil;
5de00bff5de3 (Fx_hide_tip): Avoid unnecessary work when there's
Gerd Moellmann <gerd@gnu.org>
parents: 34321
diff changeset
5954 staticpro (&tip_frame);
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5955
35067
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5956 last_show_tip_args = Qnil;
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5957 staticpro (&last_show_tip_args);
7ca0048f8615 (x_create_tip_frame): Preserve the value of
Gerd Moellmann <gerd@gnu.org>
parents: 35042
diff changeset
5958
67761
5b8799d65159 * xfns.c (Fx_uses_old_gtk_dialog): New function.
Jan Djärv <jan.h.d@swipnet.se>
parents: 67654
diff changeset
5959 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
5960 #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
5961 defsubr (&Sx_file_dialog);
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5962 #endif
95795
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5963
96494
80ac8ab05d8d (syms_of_xfns): Only define x-select-font when both HAVE_FREETYPE and USE_GTK.
Jason Rumney <jasonr@gnu.org>
parents: 96290
diff changeset
5964 #if defined (USE_GTK) && defined (HAVE_FREETYPE)
95850
5301c67af098 (Fx_select_font): Rename from x-font-dialog.
Chong Yidong <cyd@stupidchicken.com>
parents: 95795
diff changeset
5965 defsubr (&Sx_select_font);
103840
a9bb4a9d0ebd xfns.c (Fx_select_font): Remember last font selected in
Jan Djärv <jan.h.d@swipnet.se>
parents: 103706
diff changeset
5966 x_last_font_name = NULL;
95795
e01da5f86514 (Fx_font_dialog): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 95221
diff changeset
5967 #endif
24994
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5968 }
d549b7ac676d (x_real_positions): Don't subtract window borders
Gerd Moellmann <gerd@gnu.org>
parents: 24905
diff changeset
5969
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5970 #endif /* HAVE_X_WINDOWS */
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 52387
diff changeset
5971
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 52387
diff changeset
5972 /* arch-tag: 55040d02-5485-4d58-8b22-95a7a05f3288
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 52387
diff changeset
5973 (do not change this comment) */