annotate src/xfns.c @ 21561:e6e2f267eb56

(RE_TRANSLATE_P): New macro.
author Andreas Schwab <schwab@suse.de>
date Wed, 15 Apr 1998 10:32:29 +0000
parents 0927f341e390
children 6aaa0268fe91
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.
18612
88efccff8970 Fix bugs with inappropriate mixing of Lisp_Object with int.
Richard M. Stallman <rms@gnu.org>
parents: 18594
diff changeset
2 Copyright (C) 1989, 92, 93, 94, 95, 96, 1997 Free Software Foundation.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 This file is part of GNU Emacs.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 700
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 any later version.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 GNU General Public License for more details.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 along with GNU Emacs; see the file COPYING. If not, write to
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13867
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13867
diff changeset
19 Boston, MA 02111-1307, USA. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 /* Completely rewritten by Richard Stallman. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 /* Rewritten for X11 by Joseph Arceneaux */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24
7899
facf6b0e97ff Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 7860
diff changeset
25 #include <signal.h>
facf6b0e97ff Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 7860
diff changeset
26 #include <config.h>
facf6b0e97ff Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 7860
diff changeset
27
8091
f40cbe50c74f (XLIB_ILLEGAL_ACCESS): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 8090
diff changeset
28 /* This makes the fields of a Display accessible, in Xlib header files. */
f40cbe50c74f (XLIB_ILLEGAL_ACCESS): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 8090
diff changeset
29 #define XLIB_ILLEGAL_ACCESS
f40cbe50c74f (XLIB_ILLEGAL_ACCESS): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 8090
diff changeset
30
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31 #include "lisp.h"
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32 #include "xterm.h"
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
33 #include "frame.h"
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 #include "window.h"
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35 #include "buffer.h"
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 #include "dispextern.h"
515
0005d4c90c97 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
37 #include "keyboard.h"
2439
b6c62e4abf59 Put interrupt input blocking in a separate file from xterm.h.
Jim Blandy <jimb@redhat.com>
parents: 2355
diff changeset
38 #include "blockinput.h"
13751
b7894a0895c0 Use <paths.h>, not "paths.h".
Karl Heuer <kwzh@gnu.org>
parents: 13734
diff changeset
39 #include <paths.h>
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
40 #include "charset.h"
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
41 #include "fontset.h"
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 #ifdef HAVE_X_WINDOWS
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 extern void abort ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45
13781
fc1cf507c51b [X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents: 13751
diff changeset
46 /* On some systems, the character-composition stuff is broken in X11R5. */
fc1cf507c51b [X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents: 13751
diff changeset
47 #if defined (HAVE_X11R5) && ! defined (HAVE_X11R6)
fc1cf507c51b [X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents: 13751
diff changeset
48 #ifdef X11R5_INHIBIT_I18N
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
49 #define X_I18N_INHIBITED
13781
fc1cf507c51b [X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents: 13751
diff changeset
50 #endif
fc1cf507c51b [X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents: 13751
diff changeset
51 #endif
fc1cf507c51b [X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents: 13751
diff changeset
52
2355
cec8c9490d8a * xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents: 2341
diff changeset
53 #ifndef VMS
3821
8f353c2491d0 * xfns.c: Always #include "bitmaps/gray.xbm"; the bitmaps seem to
Jim Blandy <jimb@redhat.com>
parents: 3692
diff changeset
54 #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
55 #include "bitmaps/gray.xbm"
2657b04dd324 [EMACS_BIT_MAPS]: Include gray.xbm from ./bitmaps.
Richard M. Stallman <rms@gnu.org>
parents: 3507
diff changeset
56 #else
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
57 #include <X11/bitmaps/gray>
3512
2657b04dd324 [EMACS_BIT_MAPS]: Include gray.xbm from ./bitmaps.
Richard M. Stallman <rms@gnu.org>
parents: 3507
diff changeset
58 #endif
2355
cec8c9490d8a * xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents: 2341
diff changeset
59 #else
cec8c9490d8a * xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents: 2341
diff changeset
60 #include "[.bitmaps]gray.xbm"
cec8c9490d8a * xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents: 2341
diff changeset
61 #endif
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
62
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
63 #ifdef USE_X_TOOLKIT
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
64 #include <X11/Shell.h>
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
65
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
66 #ifndef USE_MOTIF
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
67 #include <X11/Xaw/Paned.h>
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
68 #include <X11/Xaw/Label.h>
12616
ca170048a679 [USE_MOTIF]: Don't include X11/Xaw/Paned.h, X11/Xaw/Label.h.
Richard M. Stallman <rms@gnu.org>
parents: 12546
diff changeset
69 #endif /* USE_MOTIF */
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
70
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
71 #ifdef USG
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
72 #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
73 #include <X11/Xos.h>
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
74 #define USG
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
75 #else
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
76 #include <X11/Xos.h>
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
77 #endif
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
78
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
79 #include "widget.h"
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
80
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
81 #include "../lwlib/lwlib.h"
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
82
13508
b64345cf1ee9 (HACK_EDITRES): Don't define if NO_EDITRES is defined.
Richard M. Stallman <rms@gnu.org>
parents: 13227
diff changeset
83 /* Do the EDITRES protocol if running X11R5
b64345cf1ee9 (HACK_EDITRES): Don't define if NO_EDITRES is defined.
Richard M. Stallman <rms@gnu.org>
parents: 13227
diff changeset
84 Exception: HP-UX (at least version A.09.05) has X11R5 without EditRes */
b64345cf1ee9 (HACK_EDITRES): Don't define if NO_EDITRES is defined.
Richard M. Stallman <rms@gnu.org>
parents: 13227
diff changeset
85 #if (XtSpecificationRelease >= 5) && !defined(NO_EDITRES)
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
86 #define HACK_EDITRES
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
87 extern void _XEditResCheckMessages ();
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
88 #endif /* R5 + Athena */
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
89
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
90 /* Unique id counter for widgets created by the Lucid Widget
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
91 Library. */
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
92 extern LWLIB_ID widget_id_tick;
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
93
15720
f1549b7501af (Fx_create_frame): Do xlwmenu hack only if USE_LUCID.
Karl Heuer <kwzh@gnu.org>
parents: 15706
diff changeset
94 #ifdef USE_LUCID
9742
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
95 /* This is part of a kludge--see lwlib/xlwmenu.c. */
15706
bf891f379d9f (xlwmenu_default_font): Declare, but don't define.
Karl Heuer <kwzh@gnu.org>
parents: 15704
diff changeset
96 extern XFontStruct *xlwmenu_default_font;
15720
f1549b7501af (Fx_create_frame): Do xlwmenu hack only if USE_LUCID.
Karl Heuer <kwzh@gnu.org>
parents: 15706
diff changeset
97 #endif
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
98
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
99 extern void free_frame_menubar ();
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
100 #endif /* USE_X_TOOLKIT */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
101
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102 #define min(a,b) ((a) < (b) ? (a) : (b))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
103 #define max(a,b) ((a) > (b) ? (a) : (b))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
105 #ifdef HAVE_X11R4
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
106 #define MAXREQUEST(dpy) (XMaxRequestSize (dpy))
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
107 #else
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
108 #define MAXREQUEST(dpy) ((dpy)->max_request_size)
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
109 #endif
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
110
16966
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
111 /* The name we're using in resource queries. Most often "emacs". */
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
112 Lisp_Object Vx_resource_name;
3170
647229114f47 * xfns.c: Make resource manager work correctly even when
Jim Blandy <jimb@redhat.com>
parents: 3141
diff changeset
113
16966
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
114 /* The application class we're using in resource queries.
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
115 Normally "Emacs". */
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
116 Lisp_Object Vx_resource_class;
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
117
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118 /* 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
119 over text or in the modeline. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape;
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
121 /* The shape when over mouse-sensitive text. */
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
122 Lisp_Object Vx_sensitive_text_pointer_shape;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
123
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
124 /* Color of chars displayed in cursor box. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125 Lisp_Object Vx_cursor_fore_pixel;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
127 /* Nonzero if using X. */
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
128 static int x_in_use;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
129
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
130 /* Non nil if no window manager is in use. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 Lisp_Object Vx_no_window_manager;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
133 /* Search path for bitmap files. */
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
134 Lisp_Object Vx_bitmap_file_path;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
135
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
136 /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'. */
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
137 Lisp_Object Vx_pixel_size_width_font_regexp;
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
138
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
139 /* Evaluate this expression to rebuild the section of syms_of_xfns
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
140 that initializes and staticpros the symbols declared below. Note
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
141 that Emacs 18 has a bug that keeps C-x C-e from being able to
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
142 evaluate this expression.
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
143
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
144 (progn
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
145 ;; Accumulate a list of the symbols we want to initialize from the
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
146 ;; declarations at the top of the file.
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
147 (goto-char (point-min))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
148 (search-forward "/\*&&& symbols declared here &&&*\/\n")
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
149 (let (symbol-list)
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
150 (while (looking-at "Lisp_Object \\(Q[a-z_]+\\)")
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
151 (setq symbol-list
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
152 (cons (buffer-substring (match-beginning 1) (match-end 1))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
153 symbol-list))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
154 (forward-line 1))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
155 (setq symbol-list (nreverse symbol-list))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
156 ;; Delete the section of syms_of_... where we initialize the symbols.
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
157 (search-forward "\n /\*&&& init symbols here &&&*\/\n")
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
158 (let ((start (point)))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
159 (while (looking-at "^ Q")
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
160 (forward-line 2))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
161 (kill-region start (point)))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
162 ;; Write a new symbol initialization section.
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
163 (while symbol-list
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
164 (insert (format " %s = intern (\"" (car symbol-list)))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
165 (let ((start (point)))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
166 (insert (substring (car symbol-list) 1))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
167 (subst-char-in-region start (point) ?_ ?-))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
168 (insert (format "\");\n staticpro (&%s);\n" (car symbol-list)))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
169 (setq symbol-list (cdr symbol-list)))))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
170
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
171 */
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
172
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
173 /*&&& symbols declared here &&&*/
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
174 Lisp_Object Qauto_raise;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
175 Lisp_Object Qauto_lower;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
176 Lisp_Object Qbackground_color;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
177 Lisp_Object Qbar;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
178 Lisp_Object Qborder_color;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
179 Lisp_Object Qborder_width;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
180 Lisp_Object Qbox;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
181 Lisp_Object Qcursor_color;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
182 Lisp_Object Qcursor_type;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
183 Lisp_Object Qforeground_color;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
184 Lisp_Object Qgeometry;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
185 Lisp_Object Qicon_left;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
186 Lisp_Object Qicon_top;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
187 Lisp_Object Qicon_type;
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
188 Lisp_Object Qicon_name;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
189 Lisp_Object Qinternal_border_width;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
190 Lisp_Object Qleft;
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
191 Lisp_Object Qright;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
192 Lisp_Object Qmouse_color;
1874
19cf50641d6c * frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
193 Lisp_Object Qnone;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
194 Lisp_Object Qparent_id;
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
195 Lisp_Object Qscroll_bar_width;
2328
82e4fed9cdd6 * xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents: 2295
diff changeset
196 Lisp_Object Qsuppress_icon;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
197 Lisp_Object Qtop;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
198 Lisp_Object Qundefined_color;
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
199 Lisp_Object Qvertical_scroll_bars;
2294
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
200 Lisp_Object Qvisibility;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
201 Lisp_Object Qwindow_id;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
202 Lisp_Object Qx_frame_parameter;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
203 Lisp_Object Qx_resource_name;
7251
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
204 Lisp_Object Quser_position;
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
205 Lisp_Object Quser_size;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
206 Lisp_Object Qdisplay;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
207
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
208 /* The below are defined in frame.c. */
1874
19cf50641d6c * frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
209 extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth;
14381
4d038c841cf4 (Qtitle): Declared.
Richard M. Stallman <rms@gnu.org>
parents: 14186
diff changeset
210 extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate, Qtitle;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
211
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
212 extern Lisp_Object Vwindow_system_version;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
213
18631
62bcc6aff013 (x_set_font): Funcall Qface_set_after_frame_default.
Richard M. Stallman <rms@gnu.org>
parents: 18612
diff changeset
214 Lisp_Object Qface_set_after_frame_default;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
215
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
216 /* Error if we are not connected to X. */
5948
ef777779bd80 (check_x): Make it global.
Karl Heuer <kwzh@gnu.org>
parents: 5900
diff changeset
217 void
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
218 check_x ()
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
219 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
220 if (! x_in_use)
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
221 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
222 }
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
223
13867
19a05b5a597d (check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents: 13781
diff changeset
224 /* 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
225 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
226
2b4e4a76468b (using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7683
diff changeset
227 int
13867
19a05b5a597d (check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents: 13781
diff changeset
228 have_menus_p ()
7791
2b4e4a76468b (using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7683
diff changeset
229 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
230 return x_in_use;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
231 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
232
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
233 /* 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
234 and checking validity for X. */
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
235
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
236 FRAME_PTR
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
237 check_x_frame (frame)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
238 Lisp_Object frame;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
239 {
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
240 FRAME_PTR f;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
241
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
242 if (NILP (frame))
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
243 f = selected_frame;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
244 else
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
245 {
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
246 CHECK_LIVE_FRAME (frame, 0);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
247 f = XFRAME (frame);
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 (! 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
250 error ("Non-X frame used");
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
251 return f;
7791
2b4e4a76468b (using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7683
diff changeset
252 }
2b4e4a76468b (using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7683
diff changeset
253
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
254 /* Let the user specify an X display with a frame.
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
255 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
256 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
257
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
258 static struct x_display_info *
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
259 check_x_display_info (frame)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
260 Lisp_Object frame;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
261 {
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
262 if (NILP (frame))
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
263 {
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
264 if (FRAME_X_P (selected_frame))
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
265 return FRAME_X_DISPLAY_INFO (selected_frame);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
266 else if (x_display_list != 0)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
267 return x_display_list;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
268 else
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
269 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
270 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
271 else if (STRINGP (frame))
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
272 return x_display_info_for_name (frame);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
273 else
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
274 {
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
275 FRAME_PTR f;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
276
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
277 CHECK_LIVE_FRAME (frame, 0);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
278 f = XFRAME (frame);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
279 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
280 error ("Non-X frame used");
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
281 return FRAME_X_DISPLAY_INFO (f);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
282 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
283 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
284
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
285 /* Return the Emacs frame-object corresponding to an X window.
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
286 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
287
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
288 /* 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
289
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
290 struct frame *
11197
1bdc265aab86 (x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11060
diff changeset
291 x_window_to_frame (dpyinfo, wdesc)
1bdc265aab86 (x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11060
diff changeset
292 struct x_display_info *dpyinfo;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
293 int wdesc;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
294 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
295 Lisp_Object tail, frame;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
296 struct frame *f;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
297
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
298 for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
299 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
300 frame = XCONS (tail)->car;
9948
982820033564 (x_window_to_frame, x_any_window_to_frame, x_top_window_to_frame): Use the new
Karl Heuer <kwzh@gnu.org>
parents: 9813
diff changeset
301 if (!GC_FRAMEP (frame))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
302 continue;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
303 f = XFRAME (frame);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
304 if (f->output_data.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
11197
1bdc265aab86 (x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11060
diff changeset
305 continue;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
306 #ifdef USE_X_TOOLKIT
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
307 if ((f->output_data.x->edit_widget
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
308 && XtWindow (f->output_data.x->edit_widget) == wdesc)
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
309 || f->output_data.x->icon_desc == wdesc)
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
310 return f;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
311 #else /* not USE_X_TOOLKIT */
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
312 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
313 || f->output_data.x->icon_desc == wdesc)
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
314 return f;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
315 #endif /* not USE_X_TOOLKIT */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
316 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
317 return 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
318 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
319
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
320 #ifdef USE_X_TOOLKIT
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
321 /* 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
322 windows. */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
323
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
324 struct frame *
11197
1bdc265aab86 (x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11060
diff changeset
325 x_any_window_to_frame (dpyinfo, wdesc)
1bdc265aab86 (x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11060
diff changeset
326 struct x_display_info *dpyinfo;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
327 int wdesc;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
328 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
329 Lisp_Object tail, frame;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
330 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
331 struct x_output *x;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
332
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
333 for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr)
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
334 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
335 frame = XCONS (tail)->car;
9948
982820033564 (x_window_to_frame, x_any_window_to_frame, x_top_window_to_frame): Use the new
Karl Heuer <kwzh@gnu.org>
parents: 9813
diff changeset
336 if (!GC_FRAMEP (frame))
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
337 continue;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
338 f = XFRAME (frame);
12672
63201a2c1247 Do renamings:
Karl Heuer <kwzh@gnu.org>
parents: 12667
diff changeset
339 if (f->output_data.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
11197
1bdc265aab86 (x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11060
diff changeset
340 continue;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
341 x = f->output_data.x;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
342 /* This frame matches if the window is any of its widgets. */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
343 if (wdesc == XtWindow (x->widget)
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
344 || wdesc == XtWindow (x->column_widget)
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
345 || wdesc == XtWindow (x->edit_widget))
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
346 return f;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
347 /* Match if the window is this frame's menubar. */
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
348 if (lw_window_is_in_menubar (wdesc, x->menubar_widget))
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
349 return f;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
350 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
351 return 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
352 }
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
353
11611
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
354 /* Likewise, but exclude the menu bar widget. */
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
355
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
356 struct frame *
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
357 x_non_menubar_window_to_frame (dpyinfo, wdesc)
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
358 struct x_display_info *dpyinfo;
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
359 int wdesc;
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
360 {
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
361 Lisp_Object tail, frame;
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
362 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
363 struct x_output *x;
11611
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
364
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
365 for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr)
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
366 {
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
367 frame = XCONS (tail)->car;
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
368 if (!GC_FRAMEP (frame))
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
369 continue;
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
370 f = XFRAME (frame);
12672
63201a2c1247 Do renamings:
Karl Heuer <kwzh@gnu.org>
parents: 12667
diff changeset
371 if (f->output_data.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
11611
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
372 continue;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
373 x = f->output_data.x;
11611
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
374 /* This frame matches if the window is any of its widgets. */
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
375 if (wdesc == XtWindow (x->widget)
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
376 || wdesc == XtWindow (x->column_widget)
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
377 || wdesc == XtWindow (x->edit_widget))
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
378 return f;
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
379 }
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
380 return 0;
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
381 }
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
382
12656
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
383 /* 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
384
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
385 struct frame *
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
386 x_menubar_window_to_frame (dpyinfo, wdesc)
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
387 struct x_display_info *dpyinfo;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
388 int wdesc;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
389 {
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
390 Lisp_Object tail, frame;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
391 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
392 struct x_output *x;
12656
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
393
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
394 for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr)
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
395 {
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
396 frame = XCONS (tail)->car;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
397 if (!GC_FRAMEP (frame))
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
398 continue;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
399 f = XFRAME (frame);
12672
63201a2c1247 Do renamings:
Karl Heuer <kwzh@gnu.org>
parents: 12667
diff changeset
400 if (f->output_data.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
12656
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
401 continue;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
402 x = f->output_data.x;
12656
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
403 /* Match if the window is this frame's menubar. */
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
404 if (lw_window_is_in_menubar (wdesc, x->menubar_widget))
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
405 return f;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
406 }
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
407 return 0;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
408 }
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
409
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
410 /* 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
411 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
412
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
413 struct frame *
11197
1bdc265aab86 (x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11060
diff changeset
414 x_top_window_to_frame (dpyinfo, wdesc)
1bdc265aab86 (x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11060
diff changeset
415 struct x_display_info *dpyinfo;
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
416 int wdesc;
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
417 {
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
418 Lisp_Object tail, frame;
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
419 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
420 struct x_output *x;
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
421
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
422 for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr)
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
423 {
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
424 frame = XCONS (tail)->car;
9948
982820033564 (x_window_to_frame, x_any_window_to_frame, x_top_window_to_frame): Use the new
Karl Heuer <kwzh@gnu.org>
parents: 9813
diff changeset
425 if (!GC_FRAMEP (frame))
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
426 continue;
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
427 f = XFRAME (frame);
12672
63201a2c1247 Do renamings:
Karl Heuer <kwzh@gnu.org>
parents: 12667
diff changeset
428 if (f->output_data.nothing == 1 || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
11197
1bdc265aab86 (x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11060
diff changeset
429 continue;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
430 x = f->output_data.x;
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
431 /* This frame matches if the window is its topmost widget. */
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
432 if (wdesc == XtWindow (x->widget))
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
433 return f;
12019
63ee64941021 (x_top_window_to_frame): Don't match menu-bar widget.
Karl Heuer <kwzh@gnu.org>
parents: 12011
diff changeset
434 #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
435 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
436 and it causes trouble for MapNotify events. */
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
437 /* Match if the window is this frame's menubar. */
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
438 if (x->menubar_widget
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
439 && wdesc == XtWindow (x->menubar_widget))
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
440 return f;
12019
63ee64941021 (x_top_window_to_frame): Don't match menu-bar widget.
Karl Heuer <kwzh@gnu.org>
parents: 12011
diff changeset
441 #endif
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
442 }
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
443 return 0;
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
444 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
445 #endif /* USE_X_TOOLKIT */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
446
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
447
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
448
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
449 /* Code to deal with bitmaps. Bitmaps are referenced by their bitmap
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
450 id, which is just an int that this section returns. Bitmaps are
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
451 reference counted so they can be shared among frames.
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
452
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
453 Bitmap indices are guaranteed to be > 0, so a negative number can
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
454 be used to indicate no bitmap.
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
455
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
456 If you use x_create_bitmap_from_data, then you must keep track of
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
457 the bitmaps yourself. That is, creating a bitmap from the same
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
458 data more than once will not be caught. */
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
459
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
460
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
461 /* Functions to access the contents of a bitmap, given an id. */
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
462
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
463 int
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
464 x_bitmap_height (f, id)
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
465 FRAME_PTR f;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
466 int id;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
467 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
468 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].height;
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
469 }
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
470
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
471 int
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
472 x_bitmap_width (f, id)
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
473 FRAME_PTR f;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
474 int id;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
475 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
476 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].width;
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
477 }
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
478
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
479 int
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
480 x_bitmap_pixmap (f, id)
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
481 FRAME_PTR f;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
482 int id;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
483 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
484 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap;
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
485 }
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
486
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
487
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
488 /* Allocate a new bitmap record. Returns index of new record. */
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
489
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
490 static int
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
491 x_allocate_bitmap_record (f)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
492 FRAME_PTR f;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
493 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
494 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
495 int i;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
496
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
497 if (dpyinfo->bitmaps == NULL)
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
498 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
499 dpyinfo->bitmaps_size = 10;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
500 dpyinfo->bitmaps
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
501 = (struct x_bitmap_record *) xmalloc (dpyinfo->bitmaps_size * sizeof (struct x_bitmap_record));
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
502 dpyinfo->bitmaps_last = 1;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
503 return 1;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
504 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
505
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
506 if (dpyinfo->bitmaps_last < dpyinfo->bitmaps_size)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
507 return ++dpyinfo->bitmaps_last;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
508
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
509 for (i = 0; i < dpyinfo->bitmaps_size; ++i)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
510 if (dpyinfo->bitmaps[i].refcount == 0)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
511 return i + 1;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
512
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
513 dpyinfo->bitmaps_size *= 2;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
514 dpyinfo->bitmaps
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
515 = (struct x_bitmap_record *) xrealloc (dpyinfo->bitmaps,
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
516 dpyinfo->bitmaps_size * sizeof (struct x_bitmap_record));
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
517 return ++dpyinfo->bitmaps_last;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
518 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
519
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
520 /* Add one reference to the reference count of the bitmap with id ID. */
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
521
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
522 void
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
523 x_reference_bitmap (f, id)
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
524 FRAME_PTR f;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
525 int id;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
526 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
527 ++FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].refcount;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
528 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
529
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
530 /* Create a bitmap for frame F from a HEIGHT x WIDTH array of bits at BITS. */
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
531
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
532 int
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
533 x_create_bitmap_from_data (f, bits, width, height)
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
534 struct frame *f;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
535 char *bits;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
536 unsigned int width, height;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
537 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
538 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
539 Pixmap bitmap;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
540 int id;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
541
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
542 bitmap = XCreateBitmapFromData (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
543 bits, width, height);
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
544
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
545 if (! bitmap)
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
546 return -1;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
547
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
548 id = x_allocate_bitmap_record (f);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
549 dpyinfo->bitmaps[id - 1].pixmap = bitmap;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
550 dpyinfo->bitmaps[id - 1].file = NULL;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
551 dpyinfo->bitmaps[id - 1].refcount = 1;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
552 dpyinfo->bitmaps[id - 1].depth = 1;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
553 dpyinfo->bitmaps[id - 1].height = height;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
554 dpyinfo->bitmaps[id - 1].width = width;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
555
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
556 return id;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
557 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
558
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
559 /* Create bitmap from file FILE for frame F. */
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
560
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
561 int
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
562 x_create_bitmap_from_file (f, file)
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
563 struct frame *f;
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
564 Lisp_Object file;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
565 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
566 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
567 unsigned int width, height;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
568 Pixmap bitmap;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
569 int xhot, yhot, result, id;
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
570 Lisp_Object found;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
571 int fd;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
572 char *filename;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
573
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
574 /* Look for an existing bitmap with the same name. */
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
575 for (id = 0; id < dpyinfo->bitmaps_last; ++id)
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
576 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
577 if (dpyinfo->bitmaps[id].refcount
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
578 && dpyinfo->bitmaps[id].file
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
579 && !strcmp (dpyinfo->bitmaps[id].file, (char *) XSTRING (file)->data))
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
580 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
581 ++dpyinfo->bitmaps[id].refcount;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
582 return id + 1;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
583 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
584 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
585
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
586 /* Search bitmap-file-path for the file, if appropriate. */
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
587 fd = openp (Vx_bitmap_file_path, file, "", &found, 0);
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
588 if (fd < 0)
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
589 return -1;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
590 close (fd);
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
591
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
592 filename = (char *) XSTRING (found)->data;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
593
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
594 result = XReadBitmapFile (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
595 filename, &width, &height, &bitmap, &xhot, &yhot);
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
596 if (result != BitmapSuccess)
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
597 return -1;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
598
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
599 id = x_allocate_bitmap_record (f);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
600 dpyinfo->bitmaps[id - 1].pixmap = bitmap;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
601 dpyinfo->bitmaps[id - 1].refcount = 1;
20629
69d52f3bdb46 (x_create_bitmap_from_file): Use size_byte on strings.
Richard M. Stallman <rms@gnu.org>
parents: 19825
diff changeset
602 dpyinfo->bitmaps[id - 1].file
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
603 = (char *) xmalloc (STRING_BYTES (XSTRING (file)) + 1);
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
604 dpyinfo->bitmaps[id - 1].depth = 1;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
605 dpyinfo->bitmaps[id - 1].height = height;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
606 dpyinfo->bitmaps[id - 1].width = width;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
607 strcpy (dpyinfo->bitmaps[id - 1].file, XSTRING (file)->data);
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
608
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
609 return id;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
610 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
611
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
612 /* Remove reference to bitmap with id number ID. */
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
613
21536
468585662fa8 (x_destroy_bitmap): Declare as void, not int.
Karl Heuer <kwzh@gnu.org>
parents: 21267
diff changeset
614 void
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
615 x_destroy_bitmap (f, id)
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
616 FRAME_PTR f;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
617 int id;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
618 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
619 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
620
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
621 if (id > 0)
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
622 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
623 --dpyinfo->bitmaps[id - 1].refcount;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
624 if (dpyinfo->bitmaps[id - 1].refcount == 0)
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
625 {
12051
f193ce9efe24 (x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents: 12046
diff changeset
626 BLOCK_INPUT;
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
627 XFreePixmap (FRAME_X_DISPLAY (f), dpyinfo->bitmaps[id - 1].pixmap);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
628 if (dpyinfo->bitmaps[id - 1].file)
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
629 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
630 free (dpyinfo->bitmaps[id - 1].file);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
631 dpyinfo->bitmaps[id - 1].file = NULL;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
632 }
12051
f193ce9efe24 (x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents: 12046
diff changeset
633 UNBLOCK_INPUT;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
634 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
635 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
636 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
637
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
638 /* Free all the bitmaps for the display specified by DPYINFO. */
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
639
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
640 static void
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
641 x_destroy_all_bitmaps (dpyinfo)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
642 struct x_display_info *dpyinfo;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
643 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
644 int i;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
645 for (i = 0; i < dpyinfo->bitmaps_last; i++)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
646 if (dpyinfo->bitmaps[i].refcount > 0)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
647 {
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
648 XFreePixmap (dpyinfo->display, dpyinfo->bitmaps[i].pixmap);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
649 if (dpyinfo->bitmaps[i].file)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
650 free (dpyinfo->bitmaps[i].file);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
651 }
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
652 dpyinfo->bitmaps_last = 0;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
653 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
654
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
655 /* Connect the frame-parameter names for X frames
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
656 to the ways of passing the parameter values to the window system.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
657
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
658 The name of a parameter, as a Lisp symbol,
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
659 has an `x-frame-parameter' property which is an integer in Lisp
14439
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
660 that is an index in this table. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
661
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
662 struct x_frame_parm_table
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 char *name;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
665 void (*setter)( /* struct frame *frame, Lisp_Object val, oldval */ );
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
666 };
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
667
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
668 void x_set_foreground_color ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
669 void x_set_background_color ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
670 void x_set_mouse_color ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
671 void x_set_cursor_color ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
672 void x_set_border_color ();
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
673 void x_set_cursor_type ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
674 void x_set_icon_type ();
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
675 void x_set_icon_name ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
676 void x_set_font ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
677 void x_set_border_width ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
678 void x_set_internal_border_width ();
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
679 void x_explicitly_set_name ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
680 void x_set_autoraise ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
681 void x_set_autolower ();
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
682 void x_set_vertical_scroll_bars ();
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
683 void x_set_visibility ();
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
684 void x_set_menu_bar_lines ();
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
685 void x_set_scroll_bar_width ();
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
686 void x_set_title ();
9580
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
687 void x_set_unsplittable ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
688
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
689 static struct x_frame_parm_table x_frame_parms[] =
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
690 {
1874
19cf50641d6c * frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
691 "auto-raise", x_set_autoraise,
19cf50641d6c * frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
692 "auto-lower", x_set_autolower,
14439
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
693 "background-color", x_set_background_color,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
694 "border-color", x_set_border_color,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
695 "border-width", x_set_border_width,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
696 "cursor-color", x_set_cursor_color,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
697 "cursor-type", x_set_cursor_type,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
698 "font", x_set_font,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
699 "foreground-color", x_set_foreground_color,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
700 "icon-name", x_set_icon_name,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
701 "icon-type", x_set_icon_type,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
702 "internal-border-width", x_set_internal_border_width,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
703 "menu-bar-lines", x_set_menu_bar_lines,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
704 "mouse-color", x_set_mouse_color,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
705 "name", x_explicitly_set_name,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
706 "scroll-bar-width", x_set_scroll_bar_width,
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
707 "title", x_set_title,
14439
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
708 "unsplittable", x_set_unsplittable,
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
709 "vertical-scroll-bars", x_set_vertical_scroll_bars,
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
710 "visibility", x_set_visibility,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
711 };
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
712
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
713 /* Attach the `x-frame-parameter' properties to
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
714 the Lisp symbol names of parameters relevant to X. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
715
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
716 init_x_parm_symbols ()
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
717 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
718 int i;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
719
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
720 for (i = 0; i < sizeof (x_frame_parms) / sizeof (x_frame_parms[0]); i++)
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
721 Fput (intern (x_frame_parms[i].name), Qx_frame_parameter,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
722 make_number (i));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
723 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
724
19095
2f58824bf3f6 (x_set_frame_parameters): Heading comment fixed.
Kenichi Handa <handa@m17n.org>
parents: 19026
diff changeset
725 /* Change the parameters of frame F as specified by ALIST.
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
726 If a parameter is not specially recognized, do nothing;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
727 otherwise call the `x_set_...' function for that parameter. */
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
728
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
729 void
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
730 x_set_frame_parameters (f, alist)
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
731 FRAME_PTR f;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
732 Lisp_Object alist;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
733 {
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
734 Lisp_Object tail;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
735
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
736 /* If both of these parameters are present, it's more efficient to
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
737 set them both at once. So we wait until we've looked at the
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
738 entire list before we set them. */
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
739 int width, height;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
740
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
741 /* Same here. */
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
742 Lisp_Object left, top;
3203
1055aa1b7547 * xfns.c (x_set_frame_parameters): Use the first
Jim Blandy <jimb@redhat.com>
parents: 3173
diff changeset
743
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
744 /* Same with these. */
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
745 Lisp_Object icon_left, icon_top;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
746
3447
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
747 /* Record in these vectors all the parms specified. */
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
748 Lisp_Object *parms;
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
749 Lisp_Object *values;
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
750 int i;
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
751 int left_no_change = 0, top_no_change = 0;
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
752 int icon_left_no_change = 0, icon_top_no_change = 0;
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
753
3447
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
754 i = 0;
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
755 for (tail = alist; CONSP (tail); tail = Fcdr (tail))
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
756 i++;
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
757
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
758 parms = (Lisp_Object *) alloca (i * sizeof (Lisp_Object));
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
759 values = (Lisp_Object *) alloca (i * sizeof (Lisp_Object));
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
760
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
761 /* Extract parm names and values into those vectors. */
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
762
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
763 i = 0;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
764 for (tail = alist; CONSP (tail); tail = Fcdr (tail))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
765 {
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
766 Lisp_Object elt, prop, val;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
767
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
768 elt = Fcar (tail);
3447
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
769 parms[i] = Fcar (elt);
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
770 values[i] = Fcdr (elt);
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
771 i++;
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
772 }
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
773
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
774 top = left = Qunbound;
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
775 icon_left = icon_top = Qunbound;
3447
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
776
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
777 /* Provide default values for HEIGHT and WIDTH. */
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
778 if (FRAME_NEW_WIDTH (f))
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
779 width = FRAME_NEW_WIDTH (f);
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
780 else
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
781 width = FRAME_WIDTH (f);
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
782
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
783 if (FRAME_NEW_HEIGHT (f))
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
784 height = FRAME_NEW_HEIGHT (f);
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
785 else
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
786 height = FRAME_HEIGHT (f);
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
787
3447
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
788 /* Now process them in reverse of specified order. */
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
789 for (i--; i >= 0; i--)
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
790 {
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
791 Lisp_Object prop, val;
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
792
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
793 prop = parms[i];
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
794 val = values[i];
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
795
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
796 if (EQ (prop, Qwidth) && NUMBERP (val))
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
797 width = XFASTINT (val);
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
798 else if (EQ (prop, Qheight) && NUMBERP (val))
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
799 height = XFASTINT (val);
3447
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
800 else if (EQ (prop, Qtop))
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
801 top = val;
3447
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
802 else if (EQ (prop, Qleft))
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
803 left = val;
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
804 else if (EQ (prop, Qicon_top))
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
805 icon_top = val;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
806 else if (EQ (prop, Qicon_left))
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
807 icon_left = val;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
808 else
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
809 {
6519
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
810 register Lisp_Object param_index, old_value;
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
811
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
812 param_index = Fget (prop, Qx_frame_parameter);
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
813 old_value = get_frame_param (f, prop);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
814 store_frame_param (f, prop, val);
9956
cc76b76a1ed1 (CHECK_NATNUM): Use NATNUMP instead of its expansion.
Karl Heuer <kwzh@gnu.org>
parents: 9948
diff changeset
815 if (NATNUMP (param_index)
cc76b76a1ed1 (CHECK_NATNUM): Use NATNUMP instead of its expansion.
Karl Heuer <kwzh@gnu.org>
parents: 9948
diff changeset
816 && (XFASTINT (param_index)
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
817 < sizeof (x_frame_parms)/sizeof (x_frame_parms[0])))
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
818 (*x_frame_parms[XINT (param_index)].setter)(f, val, old_value);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
819 }
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
820 }
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
821
4617
807ba8bcc309 (x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents: 4606
diff changeset
822 /* Don't die if just one of these was set. */
807ba8bcc309 (x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents: 4606
diff changeset
823 if (EQ (left, Qunbound))
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
824 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
825 left_no_change = 1;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
826 if (f->output_data.x->left_pos < 0)
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
827 left = Fcons (Qplus, Fcons (make_number (f->output_data.x->left_pos), Qnil));
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
828 else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
829 XSETINT (left, f->output_data.x->left_pos);
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
830 }
4617
807ba8bcc309 (x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents: 4606
diff changeset
831 if (EQ (top, Qunbound))
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
832 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
833 top_no_change = 1;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
834 if (f->output_data.x->top_pos < 0)
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
835 top = Fcons (Qplus, Fcons (make_number (f->output_data.x->top_pos), Qnil));
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
836 else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
837 XSETINT (top, f->output_data.x->top_pos);
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
838 }
4617
807ba8bcc309 (x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents: 4606
diff changeset
839
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
840 /* If one of the icon positions was not set, preserve or default it. */
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
841 if (EQ (icon_left, Qunbound) || ! INTEGERP (icon_left))
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
842 {
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
843 icon_left_no_change = 1;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
844 icon_left = Fcdr (Fassq (Qicon_left, f->param_alist));
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
845 if (NILP (icon_left))
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
846 XSETINT (icon_left, 0);
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
847 }
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
848 if (EQ (icon_top, Qunbound) || ! INTEGERP (icon_top))
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
849 {
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
850 icon_top_no_change = 1;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
851 icon_top = Fcdr (Fassq (Qicon_top, f->param_alist));
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
852 if (NILP (icon_top))
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
853 XSETINT (icon_top, 0);
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
854 }
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
855
11932
f3fb1e5dfde1 (x_set_frame_parameters) Fix typo.
Karl Heuer <kwzh@gnu.org>
parents: 11917
diff changeset
856 /* Don't set these parameters unless they've been explicitly
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
857 specified. The window might be mapped or resized while we're in
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
858 this function, and we don't want to override that unless the lisp
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
859 code has asked for it.
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
860
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
861 Don't set these parameters unless they actually differ from the
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
862 window's current parameters; the window may not actually exist
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
863 yet. */
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
864 {
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
865 Lisp_Object frame;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
866
5107
2a019dd8ed51 (x_set_frame_parameters): Call check_frame_size
Richard M. Stallman <rms@gnu.org>
parents: 4771
diff changeset
867 check_frame_size (f, &height, &width);
2a019dd8ed51 (x_set_frame_parameters): Call check_frame_size
Richard M. Stallman <rms@gnu.org>
parents: 4771
diff changeset
868
9285
75f1c0d90b3d (x_set_frame_parameters, x_set_visibility, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9240
diff changeset
869 XSETFRAME (frame, f);
4617
807ba8bcc309 (x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents: 4606
diff changeset
870
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
871 if (width != FRAME_WIDTH (f)
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
872 || height != FRAME_HEIGHT (f)
14965
685888f786d3 (x_set_frame_parameters): Do call Fset_frame_size
Richard M. Stallman <rms@gnu.org>
parents: 14831
diff changeset
873 || FRAME_NEW_HEIGHT (f) || FRAME_NEW_WIDTH (f))
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
874 Fset_frame_size (frame, make_number (width), make_number (height));
8090
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
875
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
876 if ((!NILP (left) || !NILP (top))
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
877 && ! (left_no_change && top_no_change)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
878 && ! (NUMBERP (left) && XINT (left) == f->output_data.x->left_pos
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
879 && NUMBERP (top) && XINT (top) == f->output_data.x->top_pos))
8090
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
880 {
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
881 int leftpos = 0;
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
882 int toppos = 0;
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
883
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
884 /* Record the signs. */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
885 f->output_data.x->size_hint_flags &= ~ (XNegative | YNegative);
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
886 if (EQ (left, Qminus))
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
887 f->output_data.x->size_hint_flags |= XNegative;
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
888 else if (INTEGERP (left))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
889 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
890 leftpos = XINT (left);
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
891 if (leftpos < 0)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
892 f->output_data.x->size_hint_flags |= XNegative;
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
893 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
894 else if (CONSP (left) && EQ (XCONS (left)->car, Qminus)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
895 && CONSP (XCONS (left)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
896 && INTEGERP (XCONS (XCONS (left)->cdr)->car))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
897 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
898 leftpos = - XINT (XCONS (XCONS (left)->cdr)->car);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
899 f->output_data.x->size_hint_flags |= XNegative;
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
900 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
901 else if (CONSP (left) && EQ (XCONS (left)->car, Qplus)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
902 && CONSP (XCONS (left)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
903 && INTEGERP (XCONS (XCONS (left)->cdr)->car))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
904 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
905 leftpos = XINT (XCONS (XCONS (left)->cdr)->car);
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
906 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
907
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
908 if (EQ (top, Qminus))
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
909 f->output_data.x->size_hint_flags |= YNegative;
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
910 else if (INTEGERP (top))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
911 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
912 toppos = XINT (top);
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
913 if (toppos < 0)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
914 f->output_data.x->size_hint_flags |= YNegative;
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
915 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
916 else if (CONSP (top) && EQ (XCONS (top)->car, Qminus)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
917 && CONSP (XCONS (top)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
918 && INTEGERP (XCONS (XCONS (top)->cdr)->car))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
919 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
920 toppos = - XINT (XCONS (XCONS (top)->cdr)->car);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
921 f->output_data.x->size_hint_flags |= YNegative;
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
922 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
923 else if (CONSP (top) && EQ (XCONS (top)->car, Qplus)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
924 && CONSP (XCONS (top)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
925 && INTEGERP (XCONS (XCONS (top)->cdr)->car))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
926 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
927 toppos = XINT (XCONS (XCONS (top)->cdr)->car);
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
928 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
929
8090
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
930
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
931 /* Store the numeric value of the position. */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
932 f->output_data.x->top_pos = toppos;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
933 f->output_data.x->left_pos = leftpos;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
934
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
935 f->output_data.x->win_gravity = NorthWestGravity;
8090
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
936
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
937 /* Actually set that position, and convert to absolute. */
11989
0deb4505c0f0 (x_set_frame_parameters): Pass -1 to x_set_offset.
Karl Heuer <kwzh@gnu.org>
parents: 11986
diff changeset
938 x_set_offset (f, leftpos, toppos, -1);
8090
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
939 }
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
940
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
941 if ((!NILP (icon_left) || !NILP (icon_top))
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
942 && ! (icon_left_no_change && icon_top_no_change))
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
943 x_wm_set_icon_position (f, XINT (icon_left), XINT (icon_top));
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
944 }
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
945 }
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
946
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
947 /* 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
948 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
949 not Emacs's own window. */
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
950
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
951 void
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
952 x_real_positions (f, xptr, yptr)
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
953 FRAME_PTR f;
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
954 int *xptr, *yptr;
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
955 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
956 int win_x, win_y;
7408
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
957 Window child;
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
958
7946
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
959 /* This is pretty gross, but seems to be the easiest way out of
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
960 the problem that arises when restarting window-managers. */
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
961
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
962 #ifdef USE_X_TOOLKIT
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
963 Window outer = XtWindow (f->output_data.x->widget);
7946
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
964 #else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
965 Window outer = f->output_data.x->window_desc;
7946
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
966 #endif
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
967 Window tmp_root_window;
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
968 Window *tmp_children;
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
969 int tmp_nchildren;
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
970
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
971 while (1)
7408
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
972 {
17609
8c878d76d6a4 (x_real_positions, x_set_mouse_color, Fx_list_fonts):
Richard M. Stallman <rms@gnu.org>
parents: 17579
diff changeset
973 int count = x_catch_errors (FRAME_X_DISPLAY (f));
17954
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
974 Window outer_window;
12111
832023e90d4d (x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents: 12094
diff changeset
975
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
976 XQueryTree (FRAME_X_DISPLAY (f), outer, &tmp_root_window,
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
977 &f->output_data.x->parent_desc,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
978 &tmp_children, &tmp_nchildren);
14563
6aa8b322b4d7 (x_real_positions): Cast arg of XFree.
Karl Heuer <kwzh@gnu.org>
parents: 14530
diff changeset
979 XFree ((char *) tmp_children);
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
980
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
981 win_x = win_y = 0;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
982
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
983 /* Find the position of the outside upper-left corner of
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
984 the inner window, with respect to the outer window. */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
985 if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window)
17954
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
986 outer_window = f->output_data.x->parent_desc;
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
987 else
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
988 outer_window = outer;
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
989
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
990 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
991
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
992 /* From-window, to-window. */
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
993 outer_window,
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
994 FRAME_X_DISPLAY_INFO (f)->root_window,
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
995
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
996 /* From-position, to-position. */
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
997 0, 0, &win_x, &win_y,
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
998
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
999 /* Child of win. */
7c919d7f8217 (x_real_positions): Directly compare the frame's window
Richard M. Stallman <rms@gnu.org>
parents: 17836
diff changeset
1000 &child);
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
1001
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
1002 /* It is possible for the window returned by the XQueryNotify
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
1003 to become invalid by the time we call XTranslateCoordinates.
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
1004 That can happen when you restart some window managers.
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
1005 If so, we get an error in XTranslateCoordinates.
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
1006 Detect that and try the whole thing over. */
9703
85ac0e4030d4 (x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents: 9690
diff changeset
1007 if (! x_had_errors_p (FRAME_X_DISPLAY (f)))
15495
94467271b641 (x_real_positions): Don't call x_uncatch_errors twice.
Richard M. Stallman <rms@gnu.org>
parents: 15081
diff changeset
1008 {
17609
8c878d76d6a4 (x_real_positions, x_set_mouse_color, Fx_list_fonts):
Richard M. Stallman <rms@gnu.org>
parents: 17579
diff changeset
1009 x_uncatch_errors (FRAME_X_DISPLAY (f), count);
15495
94467271b641 (x_real_positions): Don't call x_uncatch_errors twice.
Richard M. Stallman <rms@gnu.org>
parents: 15081
diff changeset
1010 break;
94467271b641 (x_real_positions): Don't call x_uncatch_errors twice.
Richard M. Stallman <rms@gnu.org>
parents: 15081
diff changeset
1011 }
12111
832023e90d4d (x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents: 12094
diff changeset
1012
17609
8c878d76d6a4 (x_real_positions, x_set_mouse_color, Fx_list_fonts):
Richard M. Stallman <rms@gnu.org>
parents: 17579
diff changeset
1013 x_uncatch_errors (FRAME_X_DISPLAY (f), count);
7408
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
1014 }
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
1015
18036
d6297be18ba8 (x_real_positions): Subtract border width from results.
Richard M. Stallman <rms@gnu.org>
parents: 17954
diff changeset
1016 *xptr = win_x - f->output_data.x->border_width;
d6297be18ba8 (x_real_positions): Subtract border width from results.
Richard M. Stallman <rms@gnu.org>
parents: 17954
diff changeset
1017 *yptr = win_y - f->output_data.x->border_width;
7408
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
1018 }
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
1019
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1020 /* Insert a description of internally-recorded parameters of frame X
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1021 into the parameter alist *ALISTPTR that is to be given to the user.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1022 Only parameters that are specific to the X window system
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1023 and whose values are not correctly recorded in the frame's
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1024 param_alist need to be considered here. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1025
21536
468585662fa8 (x_destroy_bitmap): Declare as void, not int.
Karl Heuer <kwzh@gnu.org>
parents: 21267
diff changeset
1026 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1027 x_report_frame_params (f, alistptr)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1028 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1029 Lisp_Object *alistptr;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1030 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1031 char buf[16];
11986
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1032 Lisp_Object tem;
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1033
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1034 /* Represent negative positions (off the top or left screen edge)
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1035 in a way that Fmodify_frame_parameters will understand correctly. */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1036 XSETINT (tem, f->output_data.x->left_pos);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1037 if (f->output_data.x->left_pos >= 0)
11986
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1038 store_in_alist (alistptr, Qleft, tem);
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1039 else
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1040 store_in_alist (alistptr, Qleft, Fcons (Qplus, Fcons (tem, Qnil)));
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1041
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1042 XSETINT (tem, f->output_data.x->top_pos);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1043 if (f->output_data.x->top_pos >= 0)
11986
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1044 store_in_alist (alistptr, Qtop, tem);
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1045 else
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1046 store_in_alist (alistptr, Qtop, Fcons (Qplus, Fcons (tem, Qnil)));
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1047
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
1048 store_in_alist (alistptr, Qborder_width,
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1049 make_number (f->output_data.x->border_width));
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
1050 store_in_alist (alistptr, Qinternal_border_width,
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1051 make_number (f->output_data.x->internal_border_width));
9182
516fdeee89d6 (x_report_frame_params): Fix format/arg mismatch.
Karl Heuer <kwzh@gnu.org>
parents: 9166
diff changeset
1052 sprintf (buf, "%ld", (long) FRAME_X_WINDOW (f));
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
1053 store_in_alist (alistptr, Qwindow_id,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1054 build_string (buf));
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
1055 store_in_alist (alistptr, Qicon_name, f->icon_name);
6522
eecaa7b19b6c (x_report_frame_params): Sample visibility.
Karl Heuer <kwzh@gnu.org>
parents: 6519
diff changeset
1056 FRAME_SAMPLE_VISIBILITY (f);
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1057 store_in_alist (alistptr, Qvisibility,
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1058 (FRAME_VISIBLE_P (f) ? Qt
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1059 : FRAME_ICONIFIED_P (f) ? Qicon : Qnil));
11483
089f81a81ba6 (x_report_frame_params): Report value of `display' parm.
Richard M. Stallman <rms@gnu.org>
parents: 11417
diff changeset
1060 store_in_alist (alistptr, Qdisplay,
089f81a81ba6 (x_report_frame_params): Report value of `display' parm.
Richard M. Stallman <rms@gnu.org>
parents: 11417
diff changeset
1061 XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->car);
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
1062
18612
88efccff8970 Fix bugs with inappropriate mixing of Lisp_Object with int.
Richard M. Stallman <rms@gnu.org>
parents: 18594
diff changeset
1063 if (f->output_data.x->parent_desc == FRAME_X_DISPLAY_INFO (f)->root_window)
88efccff8970 Fix bugs with inappropriate mixing of Lisp_Object with int.
Richard M. Stallman <rms@gnu.org>
parents: 18594
diff changeset
1064 tem = Qnil;
88efccff8970 Fix bugs with inappropriate mixing of Lisp_Object with int.
Richard M. Stallman <rms@gnu.org>
parents: 18594
diff changeset
1065 else
88efccff8970 Fix bugs with inappropriate mixing of Lisp_Object with int.
Richard M. Stallman <rms@gnu.org>
parents: 18594
diff changeset
1066 XSETFASTINT (tem, f->output_data.x->parent_desc);
88efccff8970 Fix bugs with inappropriate mixing of Lisp_Object with int.
Richard M. Stallman <rms@gnu.org>
parents: 18594
diff changeset
1067 store_in_alist (alistptr, Qparent_id, tem);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1068 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1069
10920
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1070
8675
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
1071 /* Decide if color named COLOR is valid for the display associated with
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
1072 the selected frame; if so, return the rgb values in COLOR_DEF.
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
1073 If ALLOC is nonzero, allocate a new colormap cell. */
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
1074
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1075 int
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1076 defined_color (f, color, color_def, alloc)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1077 FRAME_PTR f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1078 char *color;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1079 XColor *color_def;
8675
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
1080 int alloc;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1081 {
10920
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1082 register int status;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1083 Colormap screen_colormap;
10920
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1084 Display *display = FRAME_X_DISPLAY (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1085
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1086 BLOCK_INPUT;
10920
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1087 screen_colormap = DefaultColormap (display, XDefaultScreen (display));
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1088
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1089 status = XParseColor (display, screen_colormap, color, color_def);
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1090 if (status && alloc)
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1091 {
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1092 status = XAllocColor (display, screen_colormap, color_def);
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1093 if (!status)
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1094 {
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1095 /* If we got to this point, the colormap is full, so we're
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1096 going to try and get the next closest color.
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1097 The algorithm used is a least-squares matching, which is
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1098 what X uses for closest color matching with StaticColor visuals. */
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1099
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1100 XColor *cells;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1101 int no_cells;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1102 int nearest;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1103 long nearest_delta, trial_delta;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1104 int x;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1105
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1106 no_cells = XDisplayCells (display, XDefaultScreen (display));
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1107 cells = (XColor *) alloca (sizeof (XColor) * no_cells);
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1108
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1109 for (x = 0; x < no_cells; x++)
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1110 cells[x].pixel = x;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1111
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1112 XQueryColors (display, screen_colormap, cells, no_cells);
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1113 nearest = 0;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1114 /* I'm assuming CSE so I'm not going to condense this. */
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1115 nearest_delta = ((((color_def->red >> 8) - (cells[0].red >> 8))
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1116 * ((color_def->red >> 8) - (cells[0].red >> 8)))
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1117 +
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1118 (((color_def->green >> 8) - (cells[0].green >> 8))
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1119 * ((color_def->green >> 8) - (cells[0].green >> 8)))
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1120 +
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1121 (((color_def->blue >> 8) - (cells[0].blue >> 8))
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1122 * ((color_def->blue >> 8) - (cells[0].blue >> 8))));
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1123 for (x = 1; x < no_cells; x++)
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1124 {
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1125 trial_delta = ((((color_def->red >> 8) - (cells[x].red >> 8))
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1126 * ((color_def->red >> 8) - (cells[x].red >> 8)))
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1127 +
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1128 (((color_def->green >> 8) - (cells[x].green >> 8))
11353
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
1129 * ((color_def->green >> 8) - (cells[x].green >> 8)))
10920
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1130 +
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1131 (((color_def->blue >> 8) - (cells[x].blue >> 8))
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1132 * ((color_def->blue >> 8) - (cells[x].blue >> 8))));
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1133 if (trial_delta < nearest_delta)
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1134 {
14615
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1135 XColor temp;
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1136 temp.red = cells[x].red;
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1137 temp.green = cells[x].green;
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1138 temp.blue = cells[x].blue;
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1139 status = XAllocColor (display, screen_colormap, &temp);
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1140 if (status)
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1141 {
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1142 nearest = x;
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1143 nearest_delta = trial_delta;
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1144 }
10920
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1145 }
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1146 }
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1147 color_def->red = cells[nearest].red;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1148 color_def->green = cells[nearest].green;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1149 color_def->blue = cells[nearest].blue;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1150 status = XAllocColor (display, screen_colormap, color_def);
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1151 }
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1152 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1153 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1154
10920
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1155 if (status)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1156 return 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1157 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1158 return 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1159 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1160
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1161 /* Given a string ARG naming a color, compute a pixel value from it
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1162 suitable for screen F.
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1163 If F is not a color screen, return DEF (default) regardless of what
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1164 ARG says. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1165
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1166 int
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1167 x_decode_color (f, arg, def)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1168 FRAME_PTR f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1169 Lisp_Object arg;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1170 int def;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1171 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1172 XColor cdef;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1173
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1174 CHECK_STRING (arg, 0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1175
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1176 if (strcmp (XSTRING (arg)->data, "black") == 0)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1177 return BLACK_PIX_DEFAULT (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1178 else if (strcmp (XSTRING (arg)->data, "white") == 0)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1179 return WHITE_PIX_DEFAULT (f);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1180
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1181 if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1182 return def;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1183
11060
0a7048d331e6 (x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents: 11014
diff changeset
1184 /* defined_color is responsible for coping with failures
0a7048d331e6 (x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents: 11014
diff changeset
1185 by looking for a near-miss. */
0a7048d331e6 (x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents: 11014
diff changeset
1186 if (defined_color (f, XSTRING (arg)->data, &cdef, 1))
0a7048d331e6 (x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents: 11014
diff changeset
1187 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
1188
13083
16638ebb209f (Fx_create_frame): Set up buffer-predicate slot.
Richard M. Stallman <rms@gnu.org>
parents: 12832
diff changeset
1189 Fsignal (Qerror, Fcons (build_string ("undefined color"),
16638ebb209f (Fx_create_frame): Set up buffer-predicate slot.
Richard M. Stallman <rms@gnu.org>
parents: 12832
diff changeset
1190 Fcons (arg, Qnil)));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1191 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1192
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1193 /* Functions called only from `x_set_frame_param'
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1194 to set individual parameters.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1195
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
1196 If FRAME_X_WINDOW (f) is 0,
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1197 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
1198 In that case, just record the parameter's new value
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1199 in the standard place; do not attempt to change the window. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1200
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1201 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1202 x_set_foreground_color (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1203 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1204 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1205 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1206 f->output_data.x->foreground_pixel
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1207 = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
1208 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1209 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1210 BLOCK_INPUT;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1211 XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc,
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1212 f->output_data.x->foreground_pixel);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1213 XSetBackground (FRAME_X_DISPLAY (f), f->output_data.x->reverse_gc,
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1214 f->output_data.x->foreground_pixel);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1215 UNBLOCK_INPUT;
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1216 recompute_basic_faces (f);
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1217 if (FRAME_VISIBLE_P (f))
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1218 redraw_frame (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1219 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1220 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1221
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1222 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1223 x_set_background_color (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1224 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1225 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1226 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1227 Pixmap temp;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1228 int mask;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1229
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1230 f->output_data.x->background_pixel
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1231 = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f));
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1232
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
1233 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1234 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1235 BLOCK_INPUT;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1236 /* The main frame area. */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1237 XSetBackground (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc,
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1238 f->output_data.x->background_pixel);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1239 XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->reverse_gc,
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1240 f->output_data.x->background_pixel);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1241 XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->cursor_gc,
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1242 f->output_data.x->background_pixel);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1243 XSetWindowBackground (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1244 f->output_data.x->background_pixel);
7599
880fcef68f73 (x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents: 7525
diff changeset
1245 {
880fcef68f73 (x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents: 7525
diff changeset
1246 Lisp_Object bar;
880fcef68f73 (x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents: 7525
diff changeset
1247 for (bar = FRAME_SCROLL_BARS (f); !NILP (bar);
880fcef68f73 (x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents: 7525
diff changeset
1248 bar = XSCROLL_BAR (bar)->next)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1249 XSetWindowBackground (FRAME_X_DISPLAY (f),
7599
880fcef68f73 (x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents: 7525
diff changeset
1250 SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)),
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1251 f->output_data.x->background_pixel);
7599
880fcef68f73 (x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents: 7525
diff changeset
1252 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1253 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1254
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1255 recompute_basic_faces (f);
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1256
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1257 if (FRAME_VISIBLE_P (f))
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1258 redraw_frame (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1259 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1260 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1261
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1262 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1263 x_set_mouse_color (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1264 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1265 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1266 {
6759
e0938c42218c (syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6610
diff changeset
1267 Cursor cursor, nontext_cursor, mode_cursor, cross_cursor;
17609
8c878d76d6a4 (x_real_positions, x_set_mouse_color, Fx_list_fonts):
Richard M. Stallman <rms@gnu.org>
parents: 17579
diff changeset
1268 int count;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1269 int mask_color;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1270
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1271 if (!EQ (Qnil, arg))
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1272 f->output_data.x->mouse_pixel
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1273 = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1274 mask_color = f->output_data.x->background_pixel;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1275 /* No invisible pointers. */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1276 if (mask_color == f->output_data.x->mouse_pixel
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1277 && mask_color == f->output_data.x->background_pixel)
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1278 f->output_data.x->mouse_pixel = f->output_data.x->foreground_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1279
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1280 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
1281
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 3512
diff changeset
1282 /* It's not okay to crash if the user selects a screwy cursor. */
17609
8c878d76d6a4 (x_real_positions, x_set_mouse_color, Fx_list_fonts):
Richard M. Stallman <rms@gnu.org>
parents: 17579
diff changeset
1283 count = x_catch_errors (FRAME_X_DISPLAY (f));
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
1284
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1285 if (!EQ (Qnil, Vx_pointer_shape))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1286 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1287 CHECK_NUMBER (Vx_pointer_shape, 0);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1288 cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XINT (Vx_pointer_shape));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1289 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1290 else
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1291 cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_xterm);
9703
85ac0e4030d4 (x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents: 9690
diff changeset
1292 x_check_errors (FRAME_X_DISPLAY (f), "bad text pointer cursor: %s");
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1293
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1294 if (!EQ (Qnil, Vx_nontext_pointer_shape))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1295 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1296 CHECK_NUMBER (Vx_nontext_pointer_shape, 0);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1297 nontext_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1298 XINT (Vx_nontext_pointer_shape));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1299 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1300 else
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1301 nontext_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_left_ptr);
9703
85ac0e4030d4 (x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents: 9690
diff changeset
1302 x_check_errors (FRAME_X_DISPLAY (f), "bad nontext pointer cursor: %s");
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1303
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1304 if (!EQ (Qnil, Vx_mode_pointer_shape))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1305 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1306 CHECK_NUMBER (Vx_mode_pointer_shape, 0);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1307 mode_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f),
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1308 XINT (Vx_mode_pointer_shape));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1309 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1310 else
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1311 mode_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_xterm);
9703
85ac0e4030d4 (x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents: 9690
diff changeset
1312 x_check_errors (FRAME_X_DISPLAY (f), "bad modeline pointer cursor: %s");
6759
e0938c42218c (syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6610
diff changeset
1313
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
1314 if (!EQ (Qnil, Vx_sensitive_text_pointer_shape))
6759
e0938c42218c (syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6610
diff changeset
1315 {
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
1316 CHECK_NUMBER (Vx_sensitive_text_pointer_shape, 0);
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
1317 cross_cursor
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1318 = XCreateFontCursor (FRAME_X_DISPLAY (f),
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
1319 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
1320 }
e0938c42218c (syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6610
diff changeset
1321 else
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1322 cross_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_crosshair);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1323
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
1324 /* Check and report errors with the above calls. */
9703
85ac0e4030d4 (x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents: 9690
diff changeset
1325 x_check_errors (FRAME_X_DISPLAY (f), "can't set cursor shape: %s");
17609
8c878d76d6a4 (x_real_positions, x_set_mouse_color, Fx_list_fonts):
Richard M. Stallman <rms@gnu.org>
parents: 17579
diff changeset
1326 x_uncatch_errors (FRAME_X_DISPLAY (f), count);
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
1327
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1328 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1329 XColor fore_color, back_color;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1330
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1331 fore_color.pixel = f->output_data.x->mouse_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1332 back_color.pixel = mask_color;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1333 XQueryColor (FRAME_X_DISPLAY (f),
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1334 DefaultColormap (FRAME_X_DISPLAY (f),
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1335 DefaultScreen (FRAME_X_DISPLAY (f))),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1336 &fore_color);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1337 XQueryColor (FRAME_X_DISPLAY (f),
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1338 DefaultColormap (FRAME_X_DISPLAY (f),
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1339 DefaultScreen (FRAME_X_DISPLAY (f))),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1340 &back_color);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1341 XRecolorCursor (FRAME_X_DISPLAY (f), cursor,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1342 &fore_color, &back_color);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1343 XRecolorCursor (FRAME_X_DISPLAY (f), nontext_cursor,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1344 &fore_color, &back_color);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1345 XRecolorCursor (FRAME_X_DISPLAY (f), mode_cursor,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1346 &fore_color, &back_color);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1347 XRecolorCursor (FRAME_X_DISPLAY (f), cross_cursor,
6759
e0938c42218c (syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6610
diff changeset
1348 &fore_color, &back_color);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1349 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1350
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
1351 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1352 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1353 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1354 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1355
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1356 if (cursor != f->output_data.x->text_cursor && f->output_data.x->text_cursor != 0)
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1357 XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->text_cursor);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1358 f->output_data.x->text_cursor = cursor;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1359
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1360 if (nontext_cursor != f->output_data.x->nontext_cursor
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1361 && f->output_data.x->nontext_cursor != 0)
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1362 XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->nontext_cursor);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1363 f->output_data.x->nontext_cursor = nontext_cursor;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1364
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1365 if (mode_cursor != f->output_data.x->modeline_cursor
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1366 && f->output_data.x->modeline_cursor != 0)
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1367 XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->modeline_cursor);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1368 f->output_data.x->modeline_cursor = mode_cursor;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1369 if (cross_cursor != f->output_data.x->cross_cursor
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1370 && f->output_data.x->cross_cursor != 0)
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1371 XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->cross_cursor);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1372 f->output_data.x->cross_cursor = cross_cursor;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1373
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1374 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1375 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1376 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1377
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1378 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1379 x_set_cursor_color (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1380 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1381 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1382 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1383 unsigned long fore_pixel;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1384
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1385 if (!EQ (Vx_cursor_fore_pixel, Qnil))
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1386 fore_pixel = x_decode_color (f, Vx_cursor_fore_pixel,
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1387 WHITE_PIX_DEFAULT (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1388 else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1389 fore_pixel = f->output_data.x->background_pixel;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1390 f->output_data.x->cursor_pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
1391
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
1392 /* Make sure that the cursor color differs from the background color. */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1393 if (f->output_data.x->cursor_pixel == f->output_data.x->background_pixel)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1394 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1395 f->output_data.x->cursor_pixel = f->output_data.x->mouse_pixel;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1396 if (f->output_data.x->cursor_pixel == fore_pixel)
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1397 fore_pixel = f->output_data.x->background_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1398 }
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1399 f->output_data.x->cursor_foreground_pixel = fore_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1400
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
1401 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1402 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1403 BLOCK_INPUT;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1404 XSetBackground (FRAME_X_DISPLAY (f), f->output_data.x->cursor_gc,
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1405 f->output_data.x->cursor_pixel);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1406 XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->cursor_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1407 fore_pixel);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1408 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1409
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1410 if (FRAME_VISIBLE_P (f))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1411 {
15999
0e148af7d4ec (x_set_cursor_color): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents: 15942
diff changeset
1412 x_update_cursor (f, 0);
0e148af7d4ec (x_set_cursor_color): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents: 15942
diff changeset
1413 x_update_cursor (f, 1);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1414 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1415 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1416 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1417
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1418 /* Set the border-color of frame F to value described by ARG.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1419 ARG can be a string naming a color.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1420 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
1421 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
1422 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
1423
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1424 Note: this is done in two routines because of the way X10 works.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1425
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1426 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
1427 and so emacs' border colors may be overridden. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1428
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1429 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1430 x_set_border_color (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1431 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1432 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1433 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1434 unsigned char *str;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1435 int pix;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1436
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1437 CHECK_STRING (arg, 0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1438 str = XSTRING (arg)->data;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1439
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1440 pix = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1441
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1442 x_set_border_pixel (f, pix);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1443 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1444
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1445 /* Set the border-color of frame F to pixel value PIX.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1446 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
1447 F has an x-window. */
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1448
21536
468585662fa8 (x_destroy_bitmap): Declare as void, not int.
Karl Heuer <kwzh@gnu.org>
parents: 21267
diff changeset
1449 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1450 x_set_border_pixel (f, pix)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1451 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1452 int pix;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1453 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1454 f->output_data.x->border_pixel = pix;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1455
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1456 if (FRAME_X_WINDOW (f) != 0 && f->output_data.x->border_width > 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1457 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1458 Pixmap temp;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1459 int mask;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1460
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1461 BLOCK_INPUT;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1462 XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
11882
8b3575269610 (hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents: 11774
diff changeset
1463 (unsigned long)pix);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1464 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1465
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1466 if (FRAME_VISIBLE_P (f))
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1467 redraw_frame (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1468 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1469 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1470
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1471 void
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1472 x_set_cursor_type (f, arg, oldval)
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1473 FRAME_PTR f;
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1474 Lisp_Object arg, oldval;
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1475 {
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1476 if (EQ (arg, Qbar))
10742
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1477 {
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1478 FRAME_DESIRED_CURSOR (f) = bar_cursor;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1479 f->output_data.x->cursor_width = 2;
10742
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1480 }
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1481 else if (CONSP (arg) && EQ (XCONS (arg)->car, Qbar)
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1482 && INTEGERP (XCONS (arg)->cdr))
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1483 {
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1484 FRAME_DESIRED_CURSOR (f) = bar_cursor;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1485 f->output_data.x->cursor_width = XINT (XCONS (arg)->cdr);
10742
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1486 }
3134
efdaaa695ad4 (x_set_cursor_type): If arg not recognized, use box cursor.
Richard M. Stallman <rms@gnu.org>
parents: 3108
diff changeset
1487 else
10742
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1488 /* Treat anything unknown as "box cursor".
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1489 It was bad to signal an error; people have trouble fixing
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1490 .Xdefaults with Emacs, when it has something bad in it. */
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1491 FRAME_DESIRED_CURSOR (f) = filled_box_cursor;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1492
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1493 /* Make sure the cursor gets redrawn. This is overkill, but how
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1494 often do people change cursor types? */
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1495 update_mode_lines++;
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1496 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1497
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1498 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1499 x_set_icon_type (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1500 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1501 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1502 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1503 Lisp_Object tem;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1504 int result;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1505
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
1506 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
1507 {
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
1508 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
1509 return;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
1510 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
1511 else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1512 return;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1513
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1514 BLOCK_INPUT;
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 436
diff changeset
1515 if (NILP (arg))
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1516 result = x_text_icon (f,
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
1517 (char *) XSTRING ((!NILP (f->icon_name)
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
1518 ? f->icon_name
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1519 : f->name))->data);
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1520 else
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1521 result = x_bitmap_icon (f, arg);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1522
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1523 if (result)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1524 {
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
1525 UNBLOCK_INPUT;
9353
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1526 error ("No icon window available");
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1527 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1528
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1529 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1530 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1531 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1532
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1533 /* Return non-nil if frame F wants a bitmap icon. */
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1534
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1535 Lisp_Object
9353
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1536 x_icon_type (f)
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1537 FRAME_PTR f;
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1538 {
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1539 Lisp_Object tem;
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1540
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1541 tem = assq_no_quit (Qicon_type, f->param_alist);
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1542 if (CONSP (tem))
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1543 return XCONS (tem)->cdr;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1544 else
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1545 return Qnil;
9353
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1546 }
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1547
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1548 void
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1549 x_set_icon_name (f, arg, oldval)
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1550 struct frame *f;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1551 Lisp_Object arg, oldval;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1552 {
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1553 Lisp_Object tem;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1554 int result;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1555
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1556 if (STRINGP (arg))
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1557 {
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1558 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt))
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1559 return;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1560 }
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1561 else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil))
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1562 return;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1563
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
1564 f->icon_name = arg;
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1565
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1566 if (f->output_data.x->icon_bitmap != 0)
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1567 return;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1568
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1569 BLOCK_INPUT;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1570
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1571 result = x_text_icon (f,
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
1572 (char *) XSTRING ((!NILP (f->icon_name)
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
1573 ? f->icon_name
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1574 : !NILP (f->title)
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1575 ? f->title
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1576 : f->name))->data);
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1577
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1578 if (result)
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1579 {
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1580 UNBLOCK_INPUT;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1581 error ("No icon window available");
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1582 }
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1583
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1584 XFlush (FRAME_X_DISPLAY (f));
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1585 UNBLOCK_INPUT;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1586 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1587
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1588 extern Lisp_Object x_new_font ();
18612
88efccff8970 Fix bugs with inappropriate mixing of Lisp_Object with int.
Richard M. Stallman <rms@gnu.org>
parents: 18594
diff changeset
1589 extern Lisp_Object x_new_fontset ();
88efccff8970 Fix bugs with inappropriate mixing of Lisp_Object with int.
Richard M. Stallman <rms@gnu.org>
parents: 18594
diff changeset
1590 extern Lisp_Object Fquery_fontset ();
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1591
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1592 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1593 x_set_font (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1594 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1595 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1596 {
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1597 Lisp_Object result;
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
1598 Lisp_Object fontset_name;
18631
62bcc6aff013 (x_set_font): Funcall Qface_set_after_frame_default.
Richard M. Stallman <rms@gnu.org>
parents: 18612
diff changeset
1599 Lisp_Object frame;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1600
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1601 CHECK_STRING (arg, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1602
21555
0927f341e390 (x_set_font): Give 2nd arg nil to Fquery_fontset.
Kenichi Handa <handa@m17n.org>
parents: 21549
diff changeset
1603 fontset_name = Fquery_fontset (arg, Qnil);
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
1604
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1605 BLOCK_INPUT;
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
1606 result = (STRINGP (fontset_name)
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
1607 ? x_new_fontset (f, XSTRING (fontset_name)->data)
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
1608 : x_new_font (f, XSTRING (arg)->data));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1609 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1610
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1611 if (EQ (result, Qnil))
13867
19a05b5a597d (check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents: 13781
diff changeset
1612 error ("Font `%s' is not defined", XSTRING (arg)->data);
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1613 else if (EQ (result, Qt))
3015
fac66d9828d7 * xterm.c (x_new_font): Reject fonts with varying spacing. We
Jim Blandy <jimb@redhat.com>
parents: 2999
diff changeset
1614 error ("the characters of the given font have varying widths");
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1615 else if (STRINGP (result))
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1616 {
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1617 recompute_basic_faces (f);
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1618 store_frame_param (f, Qfont, result);
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1619 }
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1620 else
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1621 abort ();
18631
62bcc6aff013 (x_set_font): Funcall Qface_set_after_frame_default.
Richard M. Stallman <rms@gnu.org>
parents: 18612
diff changeset
1622
62bcc6aff013 (x_set_font): Funcall Qface_set_after_frame_default.
Richard M. Stallman <rms@gnu.org>
parents: 18612
diff changeset
1623 XSETFRAME (frame, f);
62bcc6aff013 (x_set_font): Funcall Qface_set_after_frame_default.
Richard M. Stallman <rms@gnu.org>
parents: 18612
diff changeset
1624 call1 (Qface_set_after_frame_default, frame);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1625 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1626
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1627 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1628 x_set_border_width (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1629 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1630 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1631 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1632 CHECK_NUMBER (arg, 0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1633
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1634 if (XINT (arg) == f->output_data.x->border_width)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1635 return;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1636
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
1637 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1638 error ("Cannot change the border width of a window");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1639
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1640 f->output_data.x->border_width = XINT (arg);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1641 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1642
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1643 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1644 x_set_internal_border_width (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1645 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1646 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1647 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1648 int mask;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1649 int old = f->output_data.x->internal_border_width;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1650
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1651 CHECK_NUMBER (arg, 0);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1652 f->output_data.x->internal_border_width = XINT (arg);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1653 if (f->output_data.x->internal_border_width < 0)
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1654 f->output_data.x->internal_border_width = 0;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1655
16396
4e4cc27b2a2a (x_set_internal_border_width): Only change
Richard M. Stallman <rms@gnu.org>
parents: 16357
diff changeset
1656 #ifdef USE_X_TOOLKIT
16351
ac552926fc7e (x_set_internal_border_width, Fx_create_frame):
Richard M. Stallman <rms@gnu.org>
parents: 16305
diff changeset
1657 if (f->output_data.x->edit_widget)
21536
468585662fa8 (x_destroy_bitmap): Declare as void, not int.
Karl Heuer <kwzh@gnu.org>
parents: 21267
diff changeset
1658 widget_store_internal_border (f->output_data.x->edit_widget);
16396
4e4cc27b2a2a (x_set_internal_border_width): Only change
Richard M. Stallman <rms@gnu.org>
parents: 16357
diff changeset
1659 #endif
16351
ac552926fc7e (x_set_internal_border_width, Fx_create_frame):
Richard M. Stallman <rms@gnu.org>
parents: 16305
diff changeset
1660
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1661 if (f->output_data.x->internal_border_width == old)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1662 return;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1663
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
1664 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1665 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1666 BLOCK_INPUT;
5899
4e8f26a0f2b7 *** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 5721
diff changeset
1667 x_set_window_size (f, 0, f->width, f->height);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1668 #if 0
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1669 x_set_resize_hint (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1670 #endif
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1671 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1672 UNBLOCK_INPUT;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1673 SET_FRAME_GARBAGED (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1674 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1675 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1676
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1677 void
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1678 x_set_visibility (f, value, oldval)
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1679 struct frame *f;
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1680 Lisp_Object value, oldval;
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1681 {
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1682 Lisp_Object frame;
9285
75f1c0d90b3d (x_set_frame_parameters, x_set_visibility, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9240
diff changeset
1683 XSETFRAME (frame, f);
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1684
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1685 if (NILP (value))
5899
4e8f26a0f2b7 *** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 5721
diff changeset
1686 Fmake_frame_invisible (frame, Qt);
2294
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
1687 else if (EQ (value, Qicon))
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
1688 Ficonify_frame (frame);
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
1689 else
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1690 Fmake_frame_visible (frame);
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1691 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1692
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1693 static void
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1694 x_set_menu_bar_lines_1 (window, n)
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1695 Lisp_Object window;
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1696 int n;
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1697 {
3477
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1698 struct window *w = XWINDOW (window);
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1699
9329
4e1048594e7f (x_set_menu_bar_lines_1): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents: 9327
diff changeset
1700 XSETFASTINT (w->top, XFASTINT (w->top) + n);
4e1048594e7f (x_set_menu_bar_lines_1): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents: 9327
diff changeset
1701 XSETFASTINT (w->height, XFASTINT (w->height) - n);
3477
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1702
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1703 /* Handle just the top child in a vertical split. */
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1704 if (!NILP (w->vchild))
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1705 x_set_menu_bar_lines_1 (w->vchild, n);
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1706
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1707 /* Adjust all children in a horizontal split. */
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1708 for (window = w->hchild; !NILP (window); window = w->next)
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1709 {
3477
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1710 w = XWINDOW (window);
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1711 x_set_menu_bar_lines_1 (window, n);
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1712 }
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1713 }
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1714
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1715 void
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1716 x_set_menu_bar_lines (f, value, oldval)
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1717 struct frame *f;
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1718 Lisp_Object value, oldval;
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1719 {
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1720 int nlines;
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1721 int olines = FRAME_MENU_BAR_LINES (f);
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1722
2880
9a78169e44df * xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents: 2842
diff changeset
1723 /* 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
1724 most of the commands try to apply themselves to the minibuffer
9a78169e44df * xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents: 2842
diff changeset
1725 frame itslef, and get an error because you can't switch buffers
9a78169e44df * xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents: 2842
diff changeset
1726 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
1727 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
1728 return;
9a78169e44df * xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents: 2842
diff changeset
1729
9103
948e8acb6990 (x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9022
diff changeset
1730 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
1731 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
1732 else
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1733 nlines = 0;
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1734
17556
c0f8f4264f7a (x_set_menu_bar_lines): Increment windows_or_buffers_changed.
Richard M. Stallman <rms@gnu.org>
parents: 17106
diff changeset
1735 /* 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
1736 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
1737
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1738 #ifdef USE_X_TOOLKIT
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1739 FRAME_MENU_BAR_LINES (f) = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1740 if (nlines)
12832
0d750e41c4f2 (x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents: 12773
diff changeset
1741 {
0d750e41c4f2 (x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents: 12773
diff changeset
1742 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
1743 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
1744 /* 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
1745 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
1746 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1747 else
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1748 {
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
1749 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
1750 free_frame_menubar (f);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1751 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
1752 if (FRAME_X_P (f))
714433bead7f (x_set_menu_bar_lines) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents: 13508
diff changeset
1753 f->output_data.x->menubar_widget = 0;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1754 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1755 #else /* not USE_X_TOOLKIT */
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1756 FRAME_MENU_BAR_LINES (f) = nlines;
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1757 x_set_menu_bar_lines_1 (f->root_window, nlines - olines);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1758 #endif /* not USE_X_TOOLKIT */
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1759 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1760
4650
d81041bb1e3d comment fix
David J. MacKenzie <djm@gnu.org>
parents: 4629
diff changeset
1761 /* 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
1762 x_id_name.
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1763
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1764 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
1765 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
1766 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
1767
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1768 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
1769 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
1770 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
1771
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1772 void
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1773 x_set_name (f, name, explicit)
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1774 struct frame *f;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1775 Lisp_Object name;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1776 int explicit;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1777 {
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1778 /* Make sure that requests from lisp code override requests from
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1779 Emacs redisplay code. */
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1780 if (explicit)
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1781 {
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1782 /* 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
1783 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
1784 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
1785 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
1786
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1787 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
1788 }
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1789 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
1790 return;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1791
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1792 /* 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
1793 if (NILP (name))
8090
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
1794 {
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
1795 /* 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
1796 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
1797 if (!strcmp (FRAME_X_DISPLAY_INFO (f)->x_id_name,
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
1798 XSTRING (f->name)->data))
8090
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
1799 return;
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
1800 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
1801 }
833
14748faa4f17 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 817
diff changeset
1802 else
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1803 CHECK_STRING (name, 0);
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1804
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1805 /* 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
1806 if (! NILP (Fstring_equal (name, f->name)))
727
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 708
diff changeset
1807 return;
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 708
diff changeset
1808
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1809 f->name = name;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1810
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1811 /* 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
1812 the name parameter. */
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1813 if (! NILP (f->title))
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1814 name = f->title;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1815
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
1816 if (FRAME_X_WINDOW (f))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1817 {
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 700
diff changeset
1818 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
1819 #ifdef HAVE_X11R4
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
1820 {
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1821 XTextProperty text, icon;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1822 Lisp_Object icon_name;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1823
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
1824 text.value = XSTRING (name)->data;
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
1825 text.encoding = XA_STRING;
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
1826 text.format = 8;
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
1827 text.nitems = STRING_BYTES (XSTRING (name));
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1828
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
1829 icon_name = (!NILP (f->icon_name) ? f->icon_name : name);
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1830
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1831 icon.value = XSTRING (icon_name)->data;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1832 icon.encoding = XA_STRING;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1833 icon.format = 8;
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
1834 icon.nitems = STRING_BYTES (XSTRING (icon_name));
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1835 #ifdef USE_X_TOOLKIT
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1836 XSetWMName (FRAME_X_DISPLAY (f),
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1837 XtWindow (f->output_data.x->widget), &text);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1838 XSetWMIconName (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget),
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1839 &icon);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1840 #else /* not USE_X_TOOLKIT */
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1841 XSetWMName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text);
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1842 XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1843 #endif /* not USE_X_TOOLKIT */
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
1844 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1845 #else /* not HAVE_X11R4 */
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1846 XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
1847 XSTRING (name)->data);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1848 XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
1849 XSTRING (name)->data);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1850 #endif /* not HAVE_X11R4 */
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 700
diff changeset
1851 UNBLOCK_INPUT;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1852 }
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1853 }
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1854
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1855 /* 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
1856 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
1857 redisplay code. */
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1858 void
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1859 x_explicitly_set_name (f, arg, oldval)
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1860 FRAME_PTR f;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1861 Lisp_Object arg, oldval;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1862 {
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1863 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
1864 }
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1865
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1866 /* 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
1867 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
1868 lisp code. */
1125
059624bf9bf0 Declare x_implicitly_set_name to be void.
Jim Blandy <jimb@redhat.com>
parents: 1096
diff changeset
1869 void
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1870 x_implicitly_set_name (f, arg, oldval)
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1871 FRAME_PTR f;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1872 Lisp_Object arg, oldval;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1873 {
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1874 x_set_name (f, arg, 0);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1875 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1876
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1877 /* Change the title of frame F to NAME.
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1878 If NAME is nil, use the frame name as the title.
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1879
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1880 If EXPLICIT is non-zero, that indicates that lisp code is setting the
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1881 name; if NAME is a string, set F's name to NAME and set
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1882 F->explicit_name; if NAME is Qnil, then clear F->explicit_name.
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1883
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1884 If EXPLICIT is zero, that indicates that Emacs redisplay code is
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1885 suggesting a new name, which lisp code should override; if
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1886 F->explicit_name is set, ignore the new name; otherwise, set it. */
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1887
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1888 void
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1889 x_set_title (f, name)
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1890 struct frame *f;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1891 Lisp_Object name;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1892 {
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1893 /* 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
1894 if (EQ (name, f->title))
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1895 return;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1896
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1897 update_mode_lines = 1;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1898
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1899 f->title = name;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1900
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1901 if (NILP (name))
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1902 name = f->name;
16732
f52c4fd47f03 (x_set_title): Check data type of NAME.
Richard M. Stallman <rms@gnu.org>
parents: 16682
diff changeset
1903 else
f52c4fd47f03 (x_set_title): Check data type of NAME.
Richard M. Stallman <rms@gnu.org>
parents: 16682
diff changeset
1904 CHECK_STRING (name, 0);
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1905
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1906 if (FRAME_X_WINDOW (f))
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1907 {
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1908 BLOCK_INPUT;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1909 #ifdef HAVE_X11R4
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1910 {
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1911 XTextProperty text, icon;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1912 Lisp_Object icon_name;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1913
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1914 text.value = XSTRING (name)->data;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1915 text.encoding = XA_STRING;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1916 text.format = 8;
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
1917 text.nitems = STRING_BYTES (XSTRING (name));
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1918
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1919 icon_name = (!NILP (f->icon_name) ? f->icon_name : name);
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1920
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1921 icon.value = XSTRING (icon_name)->data;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1922 icon.encoding = XA_STRING;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1923 icon.format = 8;
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
1924 icon.nitems = STRING_BYTES (XSTRING (icon_name));
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1925 #ifdef USE_X_TOOLKIT
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1926 XSetWMName (FRAME_X_DISPLAY (f),
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1927 XtWindow (f->output_data.x->widget), &text);
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1928 XSetWMIconName (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget),
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1929 &icon);
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1930 #else /* not USE_X_TOOLKIT */
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1931 XSetWMName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text);
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1932 XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon);
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1933 #endif /* not USE_X_TOOLKIT */
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1934 }
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1935 #else /* not HAVE_X11R4 */
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1936 XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1937 XSTRING (name)->data);
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1938 XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1939 XSTRING (name)->data);
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1940 #endif /* not HAVE_X11R4 */
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1941 UNBLOCK_INPUT;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1942 }
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1943 }
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1944
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1945 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1946 x_set_autoraise (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1947 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1948 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1949 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1950 f->auto_raise = !EQ (Qnil, arg);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1951 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1952
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1953 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1954 x_set_autolower (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1955 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1956 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1957 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1958 f->auto_lower = !EQ (Qnil, arg);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1959 }
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1960
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1961 void
9580
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1962 x_set_unsplittable (f, arg, oldval)
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1963 struct frame *f;
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1964 Lisp_Object arg, oldval;
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1965 {
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1966 f->no_split = !NILP (arg);
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1967 }
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1968
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1969 void
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
1970 x_set_vertical_scroll_bars (f, arg, oldval)
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1971 struct frame *f;
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1972 Lisp_Object arg, oldval;
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1973 {
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1974 if ((EQ (arg, Qleft) && FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1975 || (EQ (arg, Qright) && FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f))
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1976 || (NILP (arg) && FRAME_HAS_VERTICAL_SCROLL_BARS (f))
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1977 || (!NILP (arg) && ! FRAME_HAS_VERTICAL_SCROLL_BARS (f)))
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1978 {
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1979 FRAME_VERTICAL_SCROLL_BAR_TYPE (f)
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1980 = (NILP (arg)
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1981 ? vertical_scroll_bar_none
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1982 : EQ (Qright, arg)
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1983 ? vertical_scroll_bar_right
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1984 : vertical_scroll_bar_left);
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1985
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
1986 /* We set this parameter before creating the X window for the
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
1987 frame, so we can get the geometry right from the start.
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
1988 However, if the window hasn't been created yet, we shouldn't
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
1989 call x_set_window_size. */
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
1990 if (FRAME_X_WINDOW (f))
5899
4e8f26a0f2b7 *** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 5721
diff changeset
1991 x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1992 }
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1993 }
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
1994
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
1995 void
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
1996 x_set_scroll_bar_width (f, arg, oldval)
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
1997 struct frame *f;
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
1998 Lisp_Object arg, oldval;
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
1999 {
18594
5ca5ff1c74eb (x_set_scroll_bar_width): By default, use enough
Richard M. Stallman <rms@gnu.org>
parents: 18114
diff changeset
2000 int wid = FONT_WIDTH (f->output_data.x->font);
5ca5ff1c74eb (x_set_scroll_bar_width): By default, use enough
Richard M. Stallman <rms@gnu.org>
parents: 18114
diff changeset
2001
9166
44b44e900cf1 (x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents: 9103
diff changeset
2002 if (NILP (arg))
44b44e900cf1 (x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents: 9103
diff changeset
2003 {
18594
5ca5ff1c74eb (x_set_scroll_bar_width): By default, use enough
Richard M. Stallman <rms@gnu.org>
parents: 18114
diff changeset
2004 /* Make the actual width at least 14 pixels
5ca5ff1c74eb (x_set_scroll_bar_width): By default, use enough
Richard M. Stallman <rms@gnu.org>
parents: 18114
diff changeset
2005 and a multiple of a character width. */
5ca5ff1c74eb (x_set_scroll_bar_width): By default, use enough
Richard M. Stallman <rms@gnu.org>
parents: 18114
diff changeset
2006 FRAME_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
5ca5ff1c74eb (x_set_scroll_bar_width): By default, use enough
Richard M. Stallman <rms@gnu.org>
parents: 18114
diff changeset
2007 /* Use all of that space (aside from required margins)
5ca5ff1c74eb (x_set_scroll_bar_width): By default, use enough
Richard M. Stallman <rms@gnu.org>
parents: 18114
diff changeset
2008 for the scroll bar. */
9166
44b44e900cf1 (x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents: 9103
diff changeset
2009 FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = 0;
18594
5ca5ff1c74eb (x_set_scroll_bar_width): By default, use enough
Richard M. Stallman <rms@gnu.org>
parents: 18114
diff changeset
2010
15891
dbc8c9c9d819 (x_set_scroll_bar_width): Call x_set_window_size when arg is nil.
Richard M. Stallman <rms@gnu.org>
parents: 15881
diff changeset
2011 if (FRAME_X_WINDOW (f))
dbc8c9c9d819 (x_set_scroll_bar_width): Call x_set_window_size when arg is nil.
Richard M. Stallman <rms@gnu.org>
parents: 15881
diff changeset
2012 x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));
9166
44b44e900cf1 (x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents: 9103
diff changeset
2013 }
44b44e900cf1 (x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents: 9103
diff changeset
2014 else if (INTEGERP (arg) && XINT (arg) > 0
44b44e900cf1 (x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents: 9103
diff changeset
2015 && XFASTINT (arg) != FRAME_SCROLL_BAR_PIXEL_WIDTH (f))
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
2016 {
17629
fa92ac645cf0 (x_set_scroll_bar_width): If arg is too small, round it up.
Richard M. Stallman <rms@gnu.org>
parents: 17609
diff changeset
2017 if (XFASTINT (arg) <= 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM)
fa92ac645cf0 (x_set_scroll_bar_width): If arg is too small, round it up.
Richard M. Stallman <rms@gnu.org>
parents: 17609
diff changeset
2018 XSETINT (arg, 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM + 1);
16682
fe4b95eb15ae (x_set_scroll_bar_width): Reject a width that's too small.
Richard M. Stallman <rms@gnu.org>
parents: 16515
diff changeset
2019
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
2020 FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = XFASTINT (arg);
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
2021 FRAME_SCROLL_BAR_COLS (f) = (XFASTINT (arg) + wid-1) / wid;
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
2022 if (FRAME_X_WINDOW (f))
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
2023 x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
2024 }
16302
025b3dc7a6ba (Fx_create_frame): Default Qinternal_border_width to 1.
Richard M. Stallman <rms@gnu.org>
parents: 16254
diff changeset
2025
025b3dc7a6ba (Fx_create_frame): Default Qinternal_border_width to 1.
Richard M. Stallman <rms@gnu.org>
parents: 16254
diff changeset
2026 change_frame_size (f, 0, FRAME_WIDTH (f), 0, 0);
16357
738aba1684cf (x_set_scroll_bar_width): Move cursor to the
Richard M. Stallman <rms@gnu.org>
parents: 16351
diff changeset
2027 FRAME_CURSOR_X (f) = FRAME_LEFT_SCROLL_BAR_WIDTH (f);
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
2028 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2029
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2030 /* Subroutines of creating an X frame. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2031
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2032 /* Make sure that Vx_resource_name is set to a reasonable value.
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2033 Fix it up, or set it to `emacs' if it is too hopeless. */
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2034
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2035 static void
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2036 validate_x_resource_name ()
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2037 {
11353
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2038 int len;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2039 /* Number of valid characters in the resource name. */
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2040 int good_count = 0;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2041 /* Number of invalid characters in the resource name. */
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2042 int bad_count = 0;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2043 Lisp_Object new;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2044 int i;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2045
16966
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
2046 if (!STRINGP (Vx_resource_class))
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
2047 Vx_resource_class = build_string (EMACS_CLASS);
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
2048
7525
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2049 if (STRINGP (Vx_resource_name))
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2050 {
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2051 unsigned char *p = XSTRING (Vx_resource_name)->data;
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2052 int i;
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2053
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
2054 len = STRING_BYTES (XSTRING (Vx_resource_name));
11353
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2055
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2056 /* Only letters, digits, - and _ are valid in resource names.
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2057 Count the valid characters and count the invalid ones. */
7525
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2058 for (i = 0; i < len; i++)
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2059 {
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2060 int c = p[i];
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2061 if (! ((c >= 'a' && c <= 'z')
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2062 || (c >= 'A' && c <= 'Z')
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2063 || (c >= '0' && c <= '9')
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2064 || c == '-' || c == '_'))
11353
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2065 bad_count++;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2066 else
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2067 good_count++;
7525
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2068 }
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2069 }
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2070 else
11353
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2071 /* Not a string => completely invalid. */
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2072 bad_count = 5, good_count = 0;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2073
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2074 /* If name is valid already, return. */
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2075 if (bad_count == 0)
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2076 return;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2077
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2078 /* If name is entirely invalid, or nearly so, use `emacs'. */
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2079 if (good_count == 0
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2080 || (good_count == 1 && bad_count > 0))
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2081 {
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2082 Vx_resource_name = build_string ("emacs");
11353
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2083 return;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2084 }
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2085
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2086 /* Name is partly valid. Copy it and replace the invalid characters
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2087 with underscores. */
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2088
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2089 Vx_resource_name = new = Fcopy_sequence (Vx_resource_name);
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2090
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2091 for (i = 0; i < len; i++)
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2092 {
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2093 int c = XSTRING (new)->data[i];
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2094 if (! ((c >= 'a' && c <= 'z')
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2095 || (c >= 'A' && c <= 'Z')
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2096 || (c >= '0' && c <= '9')
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2097 || c == '-' || c == '_'))
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2098 XSTRING (new)->data[i] = '_';
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2099 }
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2100 }
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2101
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2102
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2103 extern char *x_get_string_resource ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2104
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2105 DEFUN ("x-get-resource", Fx_get_resource, Sx_get_resource, 2, 4, 0,
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2106 "Return the value of ATTRIBUTE, of class CLASS, from the X defaults database.\n\
8961
940ca63c26c8 (Fx_get_resource): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8942
diff changeset
2107 This uses `INSTANCE.ATTRIBUTE' as the key and `Emacs.CLASS' as the\n\
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2108 class, where INSTANCE is the name under which Emacs was invoked, or\n\
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2109 the name specified by the `-name' or `-rn' command-line arguments.\n\
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2110 \n\
1733
2d41a3d7b9a6 (Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents: 1719
diff changeset
2111 The optional arguments COMPONENT and SUBCLASS add to the key and the\n\
2d41a3d7b9a6 (Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents: 1719
diff changeset
2112 class, respectively. You must specify both of them or neither.\n\
8961
940ca63c26c8 (Fx_get_resource): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8942
diff changeset
2113 If you specify them, the key is `INSTANCE.COMPONENT.ATTRIBUTE'\n\
940ca63c26c8 (Fx_get_resource): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8942
diff changeset
2114 and the class is `Emacs.CLASS.SUBCLASS'.")
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2115 (attribute, class, component, subclass)
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2116 Lisp_Object attribute, class, component, subclass;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2117 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2118 register char *value;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2119 char *name_key;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2120 char *class_key;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2121
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
2122 check_x ();
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
2123
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2124 CHECK_STRING (attribute, 0);
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2125 CHECK_STRING (class, 0);
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2126
1733
2d41a3d7b9a6 (Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents: 1719
diff changeset
2127 if (!NILP (component))
2d41a3d7b9a6 (Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents: 1719
diff changeset
2128 CHECK_STRING (component, 1);
2d41a3d7b9a6 (Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents: 1719
diff changeset
2129 if (!NILP (subclass))
2d41a3d7b9a6 (Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents: 1719
diff changeset
2130 CHECK_STRING (subclass, 2);
2d41a3d7b9a6 (Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents: 1719
diff changeset
2131 if (NILP (component) != NILP (subclass))
2d41a3d7b9a6 (Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents: 1719
diff changeset
2132 error ("x-get-resource: must specify both COMPONENT and SUBCLASS or neither");
2d41a3d7b9a6 (Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents: 1719
diff changeset
2133
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2134 validate_x_resource_name ();
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2135
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2136 /* Allocate space for the components, the dots which separate them,
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2137 and the final '\0'. Make them big enough for the worst case. */
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
2138 name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name))
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2139 + (STRINGP (component)
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
2140 ? STRING_BYTES (XSTRING (component)) : 0)
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
2141 + STRING_BYTES (XSTRING (attribute))
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2142 + 3);
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2143
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
2144 class_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_class))
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
2145 + STRING_BYTES (XSTRING (class))
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2146 + (STRINGP (subclass)
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
2147 ? STRING_BYTES (XSTRING (subclass)) : 0)
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2148 + 3);
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2149
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2150 /* Start with emacs.FRAMENAME for the name (the specific one)
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2151 and with `Emacs' for the class key (the general one). */
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2152 strcpy (name_key, XSTRING (Vx_resource_name)->data);
16966
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
2153 strcpy (class_key, XSTRING (Vx_resource_class)->data);
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2154
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2155 strcat (class_key, ".");
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2156 strcat (class_key, XSTRING (class)->data);
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2157
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2158 if (!NILP (component))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2159 {
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2160 strcat (class_key, ".");
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2161 strcat (class_key, XSTRING (subclass)->data);
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2162
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2163 strcat (name_key, ".");
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2164 strcat (name_key, XSTRING (component)->data);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2165 }
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2166
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2167 strcat (name_key, ".");
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2168 strcat (name_key, XSTRING (attribute)->data);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2169
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2170 value = x_get_string_resource (check_x_display_info (Qnil)->xrdb,
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2171 name_key, class_key);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2172
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2173 if (value != (char *) 0)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2174 return build_string (value);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2175 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2176 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2177 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2178
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2179 /* Get an X resource, like Fx_get_resource, but for display DPYINFO. */
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2180
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2181 static Lisp_Object
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2182 display_x_get_resource (dpyinfo, attribute, class, component, subclass)
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2183 struct x_display_info *dpyinfo;
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2184 Lisp_Object attribute, class, component, subclass;
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2185 {
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2186 register char *value;
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2187 char *name_key;
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2188 char *class_key;
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2189
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2190 check_x ();
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2191
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2192 CHECK_STRING (attribute, 0);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2193 CHECK_STRING (class, 0);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2194
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2195 if (!NILP (component))
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2196 CHECK_STRING (component, 1);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2197 if (!NILP (subclass))
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2198 CHECK_STRING (subclass, 2);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2199 if (NILP (component) != NILP (subclass))
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2200 error ("x-get-resource: must specify both COMPONENT and SUBCLASS or neither");
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2201
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2202 validate_x_resource_name ();
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2203
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2204 /* Allocate space for the components, the dots which separate them,
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2205 and the final '\0'. Make them big enough for the worst case. */
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
2206 name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name))
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2207 + (STRINGP (component)
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
2208 ? STRING_BYTES (XSTRING (component)) : 0)
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
2209 + STRING_BYTES (XSTRING (attribute))
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2210 + 3);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2211
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
2212 class_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_class))
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
2213 + STRING_BYTES (XSTRING (class))
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2214 + (STRINGP (subclass)
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
2215 ? STRING_BYTES (XSTRING (subclass)) : 0)
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2216 + 3);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2217
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2218 /* Start with emacs.FRAMENAME for the name (the specific one)
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2219 and with `Emacs' for the class key (the general one). */
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2220 strcpy (name_key, XSTRING (Vx_resource_name)->data);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2221 strcpy (class_key, XSTRING (Vx_resource_class)->data);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2222
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2223 strcat (class_key, ".");
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2224 strcat (class_key, XSTRING (class)->data);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2225
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2226 if (!NILP (component))
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2227 {
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2228 strcat (class_key, ".");
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2229 strcat (class_key, XSTRING (subclass)->data);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2230
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2231 strcat (name_key, ".");
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2232 strcat (name_key, XSTRING (component)->data);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2233 }
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2234
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2235 strcat (name_key, ".");
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2236 strcat (name_key, XSTRING (attribute)->data);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2237
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2238 value = x_get_string_resource (dpyinfo->xrdb, name_key, class_key);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2239
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2240 if (value != (char *) 0)
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2241 return build_string (value);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2242 else
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2243 return Qnil;
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2244 }
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2245
3173
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2246 /* Used when C code wants a resource value. */
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2247
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2248 char *
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2249 x_get_resource_string (attribute, class)
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2250 char *attribute, *class;
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2251 {
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2252 register char *value;
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2253 char *name_key;
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2254 char *class_key;
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2255
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2256 /* Allocate space for the components, the dots which separate them,
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2257 and the final '\0'. */
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
2258 name_key = (char *) alloca (STRING_BYTES (XSTRING (Vinvocation_name))
3173
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2259 + strlen (attribute) + 2);
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2260 class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2261 + strlen (class) + 2);
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2262
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2263 sprintf (name_key, "%s.%s",
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2264 XSTRING (Vinvocation_name)->data,
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2265 attribute);
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2266 sprintf (class_key, "%s.%s", EMACS_CLASS, class);
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2267
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2268 return x_get_string_resource (FRAME_X_DISPLAY_INFO (selected_frame)->xrdb,
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2269 name_key, class_key);
3173
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2270 }
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2271
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2272 /* Types we might convert a resource string into. */
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2273 enum resource_types
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2274 {
4571
25bee4fe64aa (enum resource_types): Delete final comma.
Richard M. Stallman <rms@gnu.org>
parents: 4367
diff changeset
2275 number, boolean, string, symbol
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2276 };
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2277
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2278 /* Return the value of parameter PARAM.
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2279
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2280 First search ALIST, then Vdefault_frame_alist, then the X defaults
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2281 database, using ATTRIBUTE as the attribute name and CLASS as its class.
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2282
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2283 Convert the resource to the type specified by desired_type.
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2284
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2285 If no default is specified, return Qunbound. If you call
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2286 x_get_arg, make sure you deal with Qunbound in a reasonable way,
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
2287 and don't let it get stored in any Lisp-visible variables! */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2288
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2289 static Lisp_Object
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2290 x_get_arg (dpyinfo, alist, param, attribute, class, type)
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2291 struct x_display_info *dpyinfo;
641
78a0b78aa6de *** empty log message ***
Joseph Arceneaux <jla@gnu.org>
parents: 621
diff changeset
2292 Lisp_Object alist, param;
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2293 char *attribute;
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2294 char *class;
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2295 enum resource_types type;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2296 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2297 register Lisp_Object tem;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2298
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2299 tem = Fassq (param, alist);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2300 if (EQ (tem, Qnil))
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2301 tem = Fassq (param, Vdefault_frame_alist);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2302 if (EQ (tem, Qnil))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2303 {
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2304
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2305 if (attribute)
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2306 {
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2307 tem = display_x_get_resource (dpyinfo,
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2308 build_string (attribute),
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2309 build_string (class),
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2310 Qnil, Qnil);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2311
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2312 if (NILP (tem))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2313 return Qunbound;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2314
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2315 switch (type)
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2316 {
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2317 case number:
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2318 return make_number (atoi (XSTRING (tem)->data));
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2319
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2320 case boolean:
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2321 tem = Fdowncase (tem);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2322 if (!strcmp (XSTRING (tem)->data, "on")
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2323 || !strcmp (XSTRING (tem)->data, "true"))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2324 return Qt;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2325 else
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2326 return Qnil;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2327
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2328 case string:
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2329 return tem;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2330
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
2331 case symbol:
2294
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
2332 /* As a special case, we map the values `true' and `on'
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
2333 to Qt, and `false' and `off' to Qnil. */
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
2334 {
6519
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
2335 Lisp_Object lower;
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
2336 lower = Fdowncase (tem);
6523
d9d9ab5951dd (x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents: 6522
diff changeset
2337 if (!strcmp (XSTRING (lower)->data, "on")
d9d9ab5951dd (x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents: 6522
diff changeset
2338 || !strcmp (XSTRING (lower)->data, "true"))
2294
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
2339 return Qt;
6523
d9d9ab5951dd (x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents: 6522
diff changeset
2340 else if (!strcmp (XSTRING (lower)->data, "off")
d9d9ab5951dd (x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents: 6522
diff changeset
2341 || !strcmp (XSTRING (lower)->data, "false"))
2294
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
2342 return Qnil;
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
2343 else
2686
a84b9a78ab08 (x_get_arg): Call Fintern, not intern.
Richard M. Stallman <rms@gnu.org>
parents: 2439
diff changeset
2344 return Fintern (tem, Qnil);
2294
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
2345 }
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
2346
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2347 default:
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2348 abort ();
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2349 }
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2350 }
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2351 else
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2352 return Qunbound;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2353 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2354 return Fcdr (tem);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2355 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2356
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2357 /* Like x_get_arg, but also record the value in f->param_alist. */
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2358
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2359 static Lisp_Object
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2360 x_get_and_record_arg (f, alist, param, attribute, class, type)
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2361 struct frame *f;
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2362 Lisp_Object alist, param;
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2363 char *attribute;
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2364 char *class;
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2365 enum resource_types type;
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2366 {
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2367 Lisp_Object value;
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2368
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2369 value = x_get_arg (FRAME_X_DISPLAY_INFO (f), alist, param,
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2370 attribute, class, type);
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2371 if (! NILP (value))
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2372 store_frame_param (f, param, value);
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2373
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2374 return value;
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2375 }
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2376
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2377 /* Record in frame F the specified or default value according to ALIST
19095
2f58824bf3f6 (x_set_frame_parameters): Heading comment fixed.
Kenichi Handa <handa@m17n.org>
parents: 19026
diff changeset
2378 of the parameter named PROP (a Lisp symbol).
2f58824bf3f6 (x_set_frame_parameters): Heading comment fixed.
Kenichi Handa <handa@m17n.org>
parents: 19026
diff changeset
2379 If no value is specified for PROP, look for an X default for XPROP
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2380 on the frame named NAME.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2381 If that is not found either, use the value DEFLT. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2382
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2383 static Lisp_Object
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2384 x_default_parameter (f, alist, prop, deflt, xprop, xclass, type)
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2385 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2386 Lisp_Object alist;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2387 Lisp_Object prop;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2388 Lisp_Object deflt;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2389 char *xprop;
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2390 char *xclass;
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2391 enum resource_types type;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2392 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2393 Lisp_Object tem;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2394
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2395 tem = x_get_arg (FRAME_X_DISPLAY_INFO (f), alist, prop, xprop, xclass, type);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2396 if (EQ (tem, Qunbound))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2397 tem = deflt;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2398 x_set_frame_parameters (f, Fcons (Fcons (prop, tem), Qnil));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2399 return tem;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2400 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2401
2328
82e4fed9cdd6 * xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents: 2295
diff changeset
2402 DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2403 "Parse an X-style geometry string STRING.\n\
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2404 Returns an alist of the form ((top . TOP), (left . LEFT) ... ).\n\
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2405 The properties returned may include `top', `left', `height', and `width'.\n\
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2406 The value of `left' or `top' may be an integer,\n\
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2407 or a list (+ N) meaning N pixels relative to top/left corner,\n\
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2408 or a list (- N) meaning -N pixels relative to bottom/right corner.")
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2409 (string)
1528
924c8a609582 * xfns.c (x_decode_color, Fx_color_display_p): x_screen_planes is
Jim Blandy <jimb@redhat.com>
parents: 1438
diff changeset
2410 Lisp_Object string;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2411 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2412 int geometry, x, y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2413 unsigned int width, height;
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2414 Lisp_Object result;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2415
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2416 CHECK_STRING (string, 0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2417
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2418 geometry = XParseGeometry ((char *) XSTRING (string)->data,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2419 &x, &y, &width, &height);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2420
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2421 #if 0
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2422 if (!!(geometry & XValue) != !!(geometry & YValue))
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2423 error ("Must specify both x and y position, or neither");
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2424 #endif
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2425
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2426 result = Qnil;
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2427 if (geometry & XValue)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2428 {
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2429 Lisp_Object element;
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2430
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2431 if (x >= 0 && (geometry & XNegative))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2432 element = Fcons (Qleft, Fcons (Qminus, Fcons (make_number (-x), Qnil)));
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2433 else if (x < 0 && ! (geometry & XNegative))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2434 element = Fcons (Qleft, Fcons (Qplus, Fcons (make_number (x), Qnil)));
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2435 else
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2436 element = Fcons (Qleft, make_number (x));
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2437 result = Fcons (element, result);
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2438 }
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2439
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2440 if (geometry & YValue)
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2441 {
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2442 Lisp_Object element;
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2443
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2444 if (y >= 0 && (geometry & YNegative))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2445 element = Fcons (Qtop, Fcons (Qminus, Fcons (make_number (-y), Qnil)));
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2446 else if (y < 0 && ! (geometry & YNegative))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2447 element = Fcons (Qtop, Fcons (Qplus, Fcons (make_number (y), Qnil)));
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2448 else
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2449 element = Fcons (Qtop, make_number (y));
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2450 result = Fcons (element, result);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2451 }
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2452
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2453 if (geometry & WidthValue)
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2454 result = Fcons (Fcons (Qwidth, make_number (width)), result);
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2455 if (geometry & HeightValue)
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2456 result = Fcons (Fcons (Qheight, make_number (height)), result);
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2457
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2458 return result;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2459 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2460
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2461 /* Calculate the desired size and position of this window,
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2462 and return the flags saying which aspects were specified.
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2463
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2464 This function does not make the coordinates positive. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2465
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2466 #define DEFAULT_ROWS 40
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2467 #define DEFAULT_COLS 80
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2468
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2469 static int
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2470 x_figure_window_size (f, parms)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2471 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2472 Lisp_Object parms;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2473 {
7251
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
2474 register Lisp_Object tem0, tem1, tem2;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2475 int height, width, left, top;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2476 register int geometry;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2477 long window_prompting = 0;
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2478 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2479
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2480 /* Default values if we fall through.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2481 Actually, if that happens we should get
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2482 window manager prompting. */
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
2483 SET_FRAME_WIDTH (f, DEFAULT_COLS);
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2484 f->height = DEFAULT_ROWS;
3108
461470daafaa (x_figure_window_size): Make the default frame coords (0,0).
Richard M. Stallman <rms@gnu.org>
parents: 3080
diff changeset
2485 /* Window managers expect that if program-specified
461470daafaa (x_figure_window_size): Make the default frame coords (0,0).
Richard M. Stallman <rms@gnu.org>
parents: 3080
diff changeset
2486 positions are not (0,0), they're intentional, not defaults. */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2487 f->output_data.x->top_pos = 0;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2488 f->output_data.x->left_pos = 0;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2489
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2490 tem0 = x_get_arg (dpyinfo, parms, Qheight, 0, 0, number);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2491 tem1 = x_get_arg (dpyinfo, parms, Qwidth, 0, 0, number);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2492 tem2 = x_get_arg (dpyinfo, parms, Quser_size, 0, 0, number);
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2493 if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2494 {
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2495 if (!EQ (tem0, Qunbound))
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2496 {
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2497 CHECK_NUMBER (tem0, 0);
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2498 f->height = XINT (tem0);
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2499 }
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2500 if (!EQ (tem1, Qunbound))
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2501 {
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2502 CHECK_NUMBER (tem1, 0);
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
2503 SET_FRAME_WIDTH (f, XINT (tem1));
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2504 }
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2505 if (!NILP (tem2) && !EQ (tem2, Qunbound))
7251
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
2506 window_prompting |= USSize;
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
2507 else
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
2508 window_prompting |= PSize;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2509 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2510
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2511 f->output_data.x->vertical_scroll_bar_extra
9240
60497ceed71a (x_figure_window_size): Use new formula for scroll bar width.
Karl Heuer <kwzh@gnu.org>
parents: 9231
diff changeset
2512 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
60497ceed71a (x_figure_window_size): Use new formula for scroll bar width.
Karl Heuer <kwzh@gnu.org>
parents: 9231
diff changeset
2513 ? 0
60497ceed71a (x_figure_window_size): Use new formula for scroll bar width.
Karl Heuer <kwzh@gnu.org>
parents: 9231
diff changeset
2514 : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
2515 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2516 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.x->font)));
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2517 f->output_data.x->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2518 f->output_data.x->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2519
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2520 tem0 = x_get_arg (dpyinfo, parms, Qtop, 0, 0, number);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2521 tem1 = x_get_arg (dpyinfo, parms, Qleft, 0, 0, number);
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
2522 tem2 = x_get_arg (dpyinfo, parms, Quser_position, 0, 0, number);
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2523 if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2524 {
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2525 if (EQ (tem0, Qminus))
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2526 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2527 f->output_data.x->top_pos = 0;
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2528 window_prompting |= YNegative;
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2529 }
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2530 else if (CONSP (tem0) && EQ (XCONS (tem0)->car, Qminus)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2531 && CONSP (XCONS (tem0)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2532 && INTEGERP (XCONS (XCONS (tem0)->cdr)->car))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2533 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2534 f->output_data.x->top_pos = - XINT (XCONS (XCONS (tem0)->cdr)->car);
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2535 window_prompting |= YNegative;
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2536 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2537 else if (CONSP (tem0) && EQ (XCONS (tem0)->car, Qplus)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2538 && CONSP (XCONS (tem0)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2539 && INTEGERP (XCONS (XCONS (tem0)->cdr)->car))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2540 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2541 f->output_data.x->top_pos = XINT (XCONS (XCONS (tem0)->cdr)->car);
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2542 }
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2543 else if (EQ (tem0, Qunbound))
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2544 f->output_data.x->top_pos = 0;
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2545 else
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2546 {
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2547 CHECK_NUMBER (tem0, 0);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2548 f->output_data.x->top_pos = XINT (tem0);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2549 if (f->output_data.x->top_pos < 0)
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2550 window_prompting |= YNegative;
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2551 }
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2552
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2553 if (EQ (tem1, Qminus))
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2554 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2555 f->output_data.x->left_pos = 0;
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2556 window_prompting |= XNegative;
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2557 }
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2558 else if (CONSP (tem1) && EQ (XCONS (tem1)->car, Qminus)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2559 && CONSP (XCONS (tem1)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2560 && INTEGERP (XCONS (XCONS (tem1)->cdr)->car))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2561 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2562 f->output_data.x->left_pos = - XINT (XCONS (XCONS (tem1)->cdr)->car);
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2563 window_prompting |= XNegative;
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2564 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2565 else if (CONSP (tem1) && EQ (XCONS (tem1)->car, Qplus)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2566 && CONSP (XCONS (tem1)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2567 && INTEGERP (XCONS (XCONS (tem1)->cdr)->car))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2568 {
12667
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->left_pos = XINT (XCONS (XCONS (tem1)->cdr)->car);
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2570 }
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2571 else if (EQ (tem1, Qunbound))
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2572 f->output_data.x->left_pos = 0;
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2573 else
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2574 {
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2575 CHECK_NUMBER (tem1, 0);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2576 f->output_data.x->left_pos = XINT (tem1);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2577 if (f->output_data.x->left_pos < 0)
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2578 window_prompting |= XNegative;
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2579 }
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2580
10264
92dcc001aa20 (x_figure_window_size): Treat missing user-position parm as nil.
Richard M. Stallman <rms@gnu.org>
parents: 10222
diff changeset
2581 if (!NILP (tem2) && ! EQ (tem2, Qunbound))
7251
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
2582 window_prompting |= USPosition;
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
2583 else
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
2584 window_prompting |= PPosition;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2585 }
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2586
3293
03e4cad68481 (Fx_close_current_connection): Clear x_current_display.
Richard M. Stallman <rms@gnu.org>
parents: 3203
diff changeset
2587 return window_prompting;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2588 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2589
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2590 #if !defined (HAVE_X11R4) && !defined (HAVE_XSETWMPROTOCOLS)
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2591
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2592 Status
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2593 XSetWMProtocols (dpy, w, protocols, count)
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2594 Display *dpy;
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2595 Window w;
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2596 Atom *protocols;
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2597 int count;
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2598 {
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2599 Atom prop;
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2600 prop = XInternAtom (dpy, "WM_PROTOCOLS", False);
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2601 if (prop == None) return False;
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2602 XChangeProperty (dpy, w, prop, XA_ATOM, 32, PropModeReplace,
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2603 (unsigned char *) protocols, count);
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2604 return True;
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2605 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2606 #endif /* not HAVE_X11R4 && not HAVE_XSETWMPROTOCOLS */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2607
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2608 #ifdef USE_X_TOOLKIT
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2609
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
2610 /* 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
2611 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
2612 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
2613 for example, but Xt doesn't). */
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2614
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2615 static void
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2616 hack_wm_protocols (f, widget)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2617 FRAME_PTR f;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2618 Widget widget;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2619 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2620 Display *dpy = XtDisplay (widget);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2621 Window w = XtWindow (widget);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2622 int need_delete = 1;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2623 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
2624 int need_save = 1;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2625
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2626 BLOCK_INPUT;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2627 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2628 Atom type, *atoms = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2629 int format = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2630 unsigned long nitems = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2631 unsigned long bytes_after;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2632
11882
8b3575269610 (hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents: 11774
diff changeset
2633 if ((XGetWindowProperty (dpy, w,
8b3575269610 (hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents: 11774
diff changeset
2634 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
2635 (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
2636 &type, &format, &nitems, &bytes_after,
8b3575269610 (hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents: 11774
diff changeset
2637 (unsigned char **) &atoms)
8b3575269610 (hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents: 11774
diff changeset
2638 == Success)
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2639 && format == 32 && type == XA_ATOM)
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2640 while (nitems > 0)
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2641 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2642 nitems--;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2643 if (atoms[nitems] == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_delete_window)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2644 need_delete = 0;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2645 else if (atoms[nitems] == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_take_focus)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2646 need_focus = 0;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2647 else if (atoms[nitems] == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_save_yourself)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2648 need_save = 0;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2649 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2650 if (atoms) XFree ((char *) atoms);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2651 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2652 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2653 Atom props [10];
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2654 int count = 0;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2655 if (need_delete)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2656 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
2657 if (need_focus)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2658 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
2659 if (need_save)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2660 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
2661 if (count)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2662 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
2663 XA_ATOM, 32, PropModeAppend,
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2664 (unsigned char *) props, count);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2665 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2666 UNBLOCK_INPUT;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2667 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2668 #endif
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2669
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2670 #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
2671
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 widget for frame F. */
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2673
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2674 static void
6604
bb11213734d6 (x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6523
diff changeset
2675 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
2676 struct frame *f;
bb11213734d6 (x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6523
diff changeset
2677 long window_prompting;
bb11213734d6 (x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6523
diff changeset
2678 int minibuffer_only;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2679 {
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2680 XClassHint class_hints;
6059
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2681 XSetWindowAttributes attributes;
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2682 unsigned long attribute_mask;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2683
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2684 Widget shell_widget;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2685 Widget pane_widget;
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2686 Widget frame_widget;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2687 Arg al [25];
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2688 int ac;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2689
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2690 BLOCK_INPUT;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2691
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2692 /* 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
2693 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
2694 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
2695
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2696 Elsewhere we specify the window name for the window manager. */
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2697
11496
db02849ee365 (x_window): Use (or reuse) frame's namebuf instead of a
Karl Heuer <kwzh@gnu.org>
parents: 11483
diff changeset
2698 {
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2699 char *str = (char *) XSTRING (Vx_resource_name)->data;
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2700 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
2701 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
2702 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2703
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2704 ac = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2705 XtSetArg (al[ac], XtNallowShellResize, 1); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2706 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
2707 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2708 XtSetArg (al[ac], XtNborderWidth, f->output_data.x->border_width); ac++;
11496
db02849ee365 (x_window): Use (or reuse) frame's namebuf instead of a
Karl Heuer <kwzh@gnu.org>
parents: 11483
diff changeset
2709 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
2710 applicationShellWidgetClass,
9742
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
2711 FRAME_X_DISPLAY (f), al, ac);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2712
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2713 f->output_data.x->widget = shell_widget;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2714 /* maybe_set_screen_title_format (shell_widget); */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2715
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2716 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
2717 (widget_value *) NULL,
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2718 shell_widget, False,
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2719 (lw_callback) NULL,
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2720 (lw_callback) NULL,
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2721 (lw_callback) NULL);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2722
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2723 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
2724
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2725 /* 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
2726 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
2727
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2728 ac = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2729 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2730 XtSetArg (al[ac], XtNshowGrip, 0); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2731 XtSetArg (al[ac], XtNallowResize, 1); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2732 XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2733 XtSetArg (al[ac], XtNemacsFrame, f); ac++;
11496
db02849ee365 (x_window): Use (or reuse) frame's namebuf instead of a
Karl Heuer <kwzh@gnu.org>
parents: 11483
diff changeset
2734 frame_widget = XtCreateWidget (f->namebuf,
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2735 emacsFrameClass,
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2736 pane_widget, al, ac);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2737
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2738 f->output_data.x->edit_widget = frame_widget;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2739
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2740 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
2741
bb11213734d6 (x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6523
diff changeset
2742 /* 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
2743 {
bb11213734d6 (x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6523
diff changeset
2744 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
2745 char *tem, shell_position[32];
bb11213734d6 (x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6523
diff changeset
2746 Arg al[2];
bb11213734d6 (x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6523
diff changeset
2747 int ac = 0;
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2748 int extra_borders = 0;
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2749 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
2750 = (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
2751 ? (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
2752 + 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
2753 : 0);
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2754 extern char *lwlib_toolkit_type;
6604
bb11213734d6 (x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6523
diff changeset
2755
15942
ff30ec8aab54 (x_window): Don't add ibw to menubar_size.
Richard M. Stallman <rms@gnu.org>
parents: 15891
diff changeset
2756 #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
2757 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
2758 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
2759 {
9808
4c43c9dbe130 (x_window): Make ibw 0 by default.
Richard M. Stallman <rms@gnu.org>
parents: 9742
diff changeset
2760 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
2761 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
2762 menubar_size += ibw;
7f15f77cb644 (x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents: 7946
diff changeset
2763 }
15942
ff30ec8aab54 (x_window): Don't add ibw to menubar_size.
Richard M. Stallman <rms@gnu.org>
parents: 15891
diff changeset
2764 #endif
7969
7f15f77cb644 (x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents: 7946
diff changeset
2765
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2766 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
2767
16305
00e57c8adaba (x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents: 16302
diff changeset
2768 #ifndef USE_LUCID
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2769 /* 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
2770 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
2771 Both conclusions reached experimentally. -- rms. */
16305
00e57c8adaba (x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents: 16302
diff changeset
2772 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
2773 &extra_borders, NULL);
00e57c8adaba (x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents: 16302
diff changeset
2774 extra_borders *= 2;
00e57c8adaba (x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents: 16302
diff changeset
2775 #endif
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2776
11707
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2777 /* 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
2778 and specify it.
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2779 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
2780 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
2781 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
2782 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2783 int left = f->output_data.x->left_pos;
11707
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2784 int xneg = window_prompting & XNegative;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2785 int top = f->output_data.x->top_pos;
11707
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2786 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
2787 if (xneg)
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2788 left = -left;
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2789 if (yneg)
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2790 top = -top;
11893
1f70ffad3d6d [USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents: 11882
diff changeset
2791
1f70ffad3d6d [USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents: 11882
diff changeset
2792 if (window_prompting & USPosition)
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2793 sprintf (shell_position, "=%dx%d%c%d%c%d",
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2794 PIXEL_WIDTH (f) + extra_borders,
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2795 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
2796 (xneg ? '-' : '+'), left,
1f70ffad3d6d [USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents: 11882
diff changeset
2797 (yneg ? '-' : '+'), top);
1f70ffad3d6d [USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents: 11882
diff changeset
2798 else
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2799 sprintf (shell_position, "=%dx%d",
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2800 PIXEL_WIDTH (f) + extra_borders,
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2801 PIXEL_HEIGHT (f) + menubar_size + extra_borders);
11707
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2802 }
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2803
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
2804 len = strlen (shell_position) + 1;
17579
8dd146dbe737 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17556
diff changeset
2805 /* We don't free this because we don't know whether
8dd146dbe737 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17556
diff changeset
2806 it is safe to free it while the frame exists.
8dd146dbe737 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17556
diff changeset
2807 It isn't worth the trouble of arranging to free it
8dd146dbe737 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17556
diff changeset
2808 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
2809 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
2810 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
2811 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
2812 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
2813 }
bb11213734d6 (x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6523
diff changeset
2814
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2815 XtManageChild (pane_widget);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2816 XtRealizeWidget (shell_widget);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2817
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2818 FRAME_X_WINDOW (f) = XtWindow (frame_widget);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2819
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2820 validate_x_resource_name ();
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2821
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2822 class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data;
16966
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
2823 class_hints.res_class = (char *) XSTRING (Vx_resource_class)->data;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2824 XSetClassHint (FRAME_X_DISPLAY (f), XtWindow (shell_widget), &class_hints);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2825
13227
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2826 #ifdef HAVE_X_I18N
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2827 #ifndef X_I18N_INHIBITED
13227
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2828 {
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2829 XIM xim;
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2830 XIC xic = NULL;
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2831
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2832 xim = XOpenIM (FRAME_X_DISPLAY (f), NULL, NULL, NULL);
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2833
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2834 if (xim)
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2835 {
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2836 xic = XCreateIC (xim,
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2837 XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2838 XNClientWindow, FRAME_X_WINDOW(f),
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2839 XNFocusWindow, FRAME_X_WINDOW(f),
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2840 NULL);
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2841
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2842 if (xic == 0)
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2843 {
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2844 XCloseIM (xim);
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2845 xim = NULL;
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2846 }
13227
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2847 }
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2848 FRAME_XIM (f) = xim;
13227
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2849 FRAME_XIC (f) = xic;
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2850 }
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2851 #else /* X_I18N_INHIBITED */
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2852 FRAME_XIM (f) = 0;
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2853 FRAME_XIC (f) = 0;
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2854 #endif /* X_I18N_INHIBITED */
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2855 #endif /* HAVE_X_I18N */
13227
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2856
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2857 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
2858 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
2859 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
2860 &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
2861
9703
85ac0e4030d4 (x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents: 9690
diff changeset
2862 hack_wm_protocols (f, shell_widget);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2863
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2864 #ifdef HACK_EDITRES
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2865 XtAddEventHandler (shell_widget, 0, True, _XEditResCheckMessages, 0);
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2866 #endif
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2867
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2868 /* Do a stupid property change to force the server to generate a
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2869 propertyNotify event so that the event_stream server timestamp will
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2870 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
2871 */
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2872 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
2873 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
2874 XA_ATOM, 32, PropModeAppend,
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2875 (unsigned char*) NULL, 0);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2876
6059
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2877 /* Make all the standard events reach the Emacs frame. */
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2878 attributes.event_mask = STANDARD_EVENT_SET;
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2879 attribute_mask = CWEventMask;
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2880 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
2881 attribute_mask, &attributes);
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2882
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2883 XtMapWidget (frame_widget);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2884
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2885 /* 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
2886 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
2887 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
2888 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
2889 {
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2890 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
2891 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
2892
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2893 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
2894 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
2895 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
2896 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
2897 }
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2898
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2899 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2900 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
2901
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2902 UNBLOCK_INPUT;
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2903
11962
f9b853c18bb5 (x_window): Call initialize_frame_menubar
Karl Heuer <kwzh@gnu.org>
parents: 11932
diff changeset
2904 if (!minibuffer_only && FRAME_EXTERNAL_MENU_BAR (f))
f9b853c18bb5 (x_window): Call initialize_frame_menubar
Karl Heuer <kwzh@gnu.org>
parents: 11932
diff changeset
2905 initialize_frame_menubar (f);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2906 lw_set_main_areas (pane_widget, f->output_data.x->menubar_widget, frame_widget);
11962
f9b853c18bb5 (x_window): Call initialize_frame_menubar
Karl Heuer <kwzh@gnu.org>
parents: 11932
diff changeset
2907
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2908 if (FRAME_X_WINDOW (f) == 0)
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2909 error ("Unable to create window");
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2910 }
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2911
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2912 #else /* not USE_X_TOOLKIT */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2913
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2914 /* 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
2915
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2916 x_window (f)
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2917 struct frame *f;
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2918
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2919 {
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2920 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
2921 XSetWindowAttributes attributes;
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2922 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
2923
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2924 attributes.background_pixel = f->output_data.x->background_pixel;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2925 attributes.border_pixel = f->output_data.x->border_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2926 attributes.bit_gravity = StaticGravity;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2927 attributes.backing_store = NotUseful;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2928 attributes.save_under = True;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2929 attributes.event_mask = STANDARD_EVENT_SET;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2930 attribute_mask = (CWBackPixel | CWBorderPixel | CWBitGravity
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2931 #if 0
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2932 | CWBackingStore | CWSaveUnder
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2933 #endif
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2934 | CWEventMask);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2935
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2936 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
2937 FRAME_X_WINDOW (f)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2938 = 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
2939 f->output_data.x->parent_desc,
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2940 f->output_data.x->left_pos,
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2941 f->output_data.x->top_pos,
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2942 PIXEL_WIDTH (f), PIXEL_HEIGHT (f),
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2943 f->output_data.x->border_width,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2944 CopyFromParent, /* depth */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2945 InputOutput, /* class */
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2946 FRAME_X_DISPLAY_INFO (f)->visual,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2947 attribute_mask, &attributes);
13227
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2948 #ifdef HAVE_X_I18N
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2949 #ifndef X_I18N_INHIBITED
13227
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2950 {
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2951 XIM xim;
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2952 XIC xic = NULL;
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2953
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2954 xim = XOpenIM (FRAME_X_DISPLAY(f), NULL, NULL, NULL);
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2955
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2956 if (xim)
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2957 {
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2958 xic = XCreateIC (xim,
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2959 XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2960 XNClientWindow, FRAME_X_WINDOW(f),
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2961 XNFocusWindow, FRAME_X_WINDOW(f),
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2962 NULL);
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2963
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2964 if (!xic)
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2965 {
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2966 XCloseIM (xim);
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2967 xim = NULL;
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2968 }
13227
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2969 }
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2970
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2971 FRAME_XIM (f) = xim;
13227
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2972 FRAME_XIC (f) = xic;
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2973 }
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2974 #else /* X_I18N_INHIBITED */
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2975 FRAME_XIM (f) = 0;
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2976 FRAME_XIC (f) = 0;
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2977 #endif /* X_I18N_INHIBITED */
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2978 #endif /* HAVE_X_I18N */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2979
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2980 validate_x_resource_name ();
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2981
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2982 class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data;
16966
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
2983 class_hints.res_class = (char *) XSTRING (Vx_resource_class)->data;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2984 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
2985
11897
cbd3724a9696 (x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents: 11894
diff changeset
2986 /* 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
2987 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
2988 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
2989
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
2990 /* 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
2991 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
2992 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
2993 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
2994
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2995 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
2996 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
2997 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
2998 &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
2999 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
3000
26a1d7b2670b (x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents: 7802
diff changeset
3001 /* 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
3002 {
26a1d7b2670b (x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents: 7802
diff changeset
3003 Atom protocols[2];
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3004 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
3005 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
3006 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
3007 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3008
817
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
3009 /* 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
3010 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
3011 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
3012 the X server hasn't been told. */
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
3013 {
6519
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
3014 Lisp_Object name;
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3015 int explicit = f->explicit_name;
817
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
3016
6519
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
3017 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
3018 name = f->name;
817
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
3019 f->name = Qnil;
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3020 x_set_name (f, name, explicit);
817
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
3021 }
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
3022
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3023 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3024 f->output_data.x->text_cursor);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3025
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3026 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3027
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
3028 if (FRAME_X_WINDOW (f) == 0)
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3029 error ("Unable to create window");
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3030 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3031
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
3032 #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
3033
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3034 /* Handle the icon stuff for this window. Perhaps later we might
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3035 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
3036 well. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3037
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3038 static void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3039 x_icon (f, parms)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3040 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3041 Lisp_Object parms;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3042 {
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3043 Lisp_Object icon_x, icon_y;
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
3044 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3045
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3046 /* 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
3047 icons in an icon window. */
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
3048 icon_x = x_get_and_record_arg (f, parms, Qicon_left, 0, 0, number);
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
3049 icon_y = x_get_and_record_arg (f, parms, Qicon_top, 0, 0, number);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3050 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3051 {
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3052 CHECK_NUMBER (icon_x, 0);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3053 CHECK_NUMBER (icon_y, 0);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3054 }
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3055 else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3056 error ("Both left and top icon corners of icon must be specified");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3057
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3058 BLOCK_INPUT;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3059
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
3060 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
3061 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
3062
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3063 /* 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
3064 x_wm_set_window_state
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
3065 (f, (EQ (x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, symbol), Qicon)
2294
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
3066 ? IconicState
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
3067 : NormalState));
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3068
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
3069 x_text_icon (f, (char *) XSTRING ((!NILP (f->icon_name)
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
3070 ? 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
3071 : f->name))->data);
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
3072
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3073 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3074 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3075
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3076 /* Make the GC's needed for this window, setting the
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3077 background, border and mouse colors; also create the
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3078 mouse cursor and the gray border tile. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3079
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
3080 static char cursor_bits[] =
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
3081 {
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
3082 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
3083 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
3084 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
3085 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
3086 };
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
3087
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3088 static void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3089 x_make_gc (f)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3090 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3091 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3092 XGCValues gc_values;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3093 GC temp_gc;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3094 XImage tileimage;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3095
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
3096 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
3097
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3098 /* Create the GC's of this frame.
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3099 Note that many default values are used. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3100
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3101 /* Normal video */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3102 gc_values.font = f->output_data.x->font->fid;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3103 gc_values.foreground = f->output_data.x->foreground_pixel;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3104 gc_values.background = f->output_data.x->background_pixel;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3105 gc_values.line_width = 0; /* Means 1 using fast algorithm. */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3106 f->output_data.x->normal_gc = XCreateGC (FRAME_X_DISPLAY (f),
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
3107 FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3108 GCLineWidth | GCFont
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3109 | GCForeground | GCBackground,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3110 &gc_values);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3111
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3112 /* Reverse video style. */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3113 gc_values.foreground = f->output_data.x->background_pixel;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3114 gc_values.background = f->output_data.x->foreground_pixel;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3115 f->output_data.x->reverse_gc = XCreateGC (FRAME_X_DISPLAY (f),
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
3116 FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3117 GCFont | GCForeground | GCBackground
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3118 | GCLineWidth,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3119 &gc_values);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3120
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3121 /* Cursor has cursor-color background, background-color foreground. */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3122 gc_values.foreground = f->output_data.x->background_pixel;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3123 gc_values.background = f->output_data.x->cursor_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3124 gc_values.fill_style = FillOpaqueStippled;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3125 gc_values.stipple
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3126 = XCreateBitmapFromData (FRAME_X_DISPLAY (f),
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3127 FRAME_X_DISPLAY_INFO (f)->root_window,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3128 cursor_bits, 16, 16);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3129 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
3130 = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3131 (GCFont | GCForeground | GCBackground
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3132 | GCFillStyle | GCStipple | GCLineWidth),
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3133 &gc_values);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3134
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3135 /* 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
3136 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
3137 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
3138 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
3139 = (XCreatePixmapFromBitmapData
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3140 (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
3141 gray_bits, gray_width, gray_height,
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3142 f->output_data.x->foreground_pixel,
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3143 f->output_data.x->background_pixel,
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3144 DefaultDepth (FRAME_X_DISPLAY (f),
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3145 XScreenNumberOfScreen (FRAME_X_SCREEN (f)))));
2341
1982e2983822 * xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents: 2328
diff changeset
3146
1982e2983822 * xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents: 2328
diff changeset
3147 UNBLOCK_INPUT;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3148 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3149
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3150 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3151 1, 1, 0,
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3152 "Make a new X window, which is called a \"frame\" in Emacs terms.\n\
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3153 Returns an Emacs frame object.\n\
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3154 ALIST is an alist of frame parameters.\n\
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3155 If the parameters specify that the frame should not have a minibuffer,\n\
697
6dd85fc4fb2c *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 689
diff changeset
3156 and do not specify a specific minibuffer window to use,\n\
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3157 then `default-minibuffer-frame' must be a frame whose minibuffer can\n\
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3158 be shared by the new frame.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3159 \n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3160 This function is an internal primitive--use `make-frame' instead.")
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3161 (parms)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3162 Lisp_Object parms;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3163 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3164 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
3165 Lisp_Object frame, tem;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3166 Lisp_Object name;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3167 int minibuffer_only = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3168 long window_prompting = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3169 int width, height;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3170 int count = specpdl_ptr - specpdl;
15566
3d03a3fb8757 (Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents: 15495
diff changeset
3171 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
3172 Lisp_Object display;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3173 struct x_display_info *dpyinfo;
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3174 Lisp_Object parent;
11774
0b5cb5170084 (Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents: 11772
diff changeset
3175 struct kboard *kb;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3176
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
3177 check_x ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3178
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3179 /* 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
3180 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
3181 Vx_resource_name = Vinvocation_name;
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3182
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
3183 display = x_get_arg (dpyinfo, parms, Qdisplay, 0, 0, string);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3184 if (EQ (display, Qunbound))
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3185 display = Qnil;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3186 dpyinfo = check_x_display_info (display);
11774
0b5cb5170084 (Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents: 11772
diff changeset
3187 #ifdef MULTI_KBOARD
0b5cb5170084 (Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents: 11772
diff changeset
3188 kb = dpyinfo->kboard;
0b5cb5170084 (Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents: 11772
diff changeset
3189 #else
0b5cb5170084 (Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents: 11772
diff changeset
3190 kb = &the_only_kboard;
0b5cb5170084 (Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents: 11772
diff changeset
3191 #endif
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3192
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
3193 name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", string);
9103
948e8acb6990 (x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9022
diff changeset
3194 if (!STRINGP (name)
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3195 && ! EQ (name, Qunbound)
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3196 && ! NILP (name))
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3197 error ("Invalid frame name--not a string or nil");
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
3198
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3199 if (STRINGP (name))
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3200 Vx_resource_name = name;
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3201
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3202 /* See if parent window is specified. */
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
3203 parent = x_get_arg (dpyinfo, parms, Qparent_id, NULL, NULL, number);
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3204 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
3205 parent = Qnil;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3206 if (! NILP (parent))
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3207 CHECK_NUMBER (parent, 0);
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3208
15566
3d03a3fb8757 (Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents: 15495
diff changeset
3209 /* 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
3210 /* 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
3211 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
3212 frame = Qnil;
3d03a3fb8757 (Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents: 15495
diff changeset
3213 GCPRO4 (parms, parent, name, frame);
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
3214 tem = x_get_arg (dpyinfo, parms, Qminibuffer, "minibuffer", "Minibuffer", symbol);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3215 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
3216 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
3217 else if (EQ (tem, Qonly))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3218 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3219 f = make_minibuffer_frame ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3220 minibuffer_only = 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3221 }
9103
948e8acb6990 (x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9022
diff changeset
3222 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
3223 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
3224 else
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3225 f = make_frame (1);
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3226
15566
3d03a3fb8757 (Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents: 15495
diff changeset
3227 XSETFRAME (frame, f);
3d03a3fb8757 (Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents: 15495
diff changeset
3228
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
3229 /* 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
3230 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
3231
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3232 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
3233 f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output));
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3234 bzero (f->output_data.x, sizeof (struct x_output));
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3235 f->output_data.x->icon_bitmap = -1;
19026
db6728252ce2 (Fx_create_frame): Initialize fontset in output_data.
Richard M. Stallman <rms@gnu.org>
parents: 18947
diff changeset
3236 f->output_data.x->fontset = -1;
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3237
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
3238 f->icon_name
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
3239 = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title", string);
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
3240 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
3241 f->icon_name = Qnil;
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
3242
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3243 FRAME_X_DISPLAY_INFO (f) = dpyinfo;
11014
634a98104921 (Fx_create_frame): set the frame's kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10920
diff changeset
3244 #ifdef MULTI_KBOARD
11774
0b5cb5170084 (Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents: 11772
diff changeset
3245 FRAME_KBOARD (f) = kb;
11014
634a98104921 (Fx_create_frame): set the frame's kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10920
diff changeset
3246 #endif
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3247
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3248 /* 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
3249
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3250 if (!NILP (parent))
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3251 {
18612
88efccff8970 Fix bugs with inappropriate mixing of Lisp_Object with int.
Richard M. Stallman <rms@gnu.org>
parents: 18594
diff changeset
3252 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
3253 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
3254 }
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3255 else
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3256 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3257 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
3258 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
3259 }
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3260
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3261 /* Note that the frame has no physical cursor right now. */
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3262 f->phys_cursor_x = -1;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3263
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3264 /* 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
3265 be set. */
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3266 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
3267 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3268 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
3269 f->explicit_name = 0;
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3270 }
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3271 else
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3272 {
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3273 f->name = name;
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3274 f->explicit_name = 1;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3275 /* 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
3276 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
3277 }
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3278
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
3279 /* Create fontsets from `global_fontset_alist' before handling fonts. */
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
3280 for (tem = Vglobal_fontset_alist; CONSP (tem); tem = XCONS (tem)->cdr)
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
3281 fs_register_fontset (f, XCONS (tem)->car);
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
3282
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3283 /* Extract the window parameters from the supplied values
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3284 that are needed to determine window geometry. */
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
3285 {
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
3286 Lisp_Object font;
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
3287
18947
386d68191907 (Fx_create_frame): Don't fail to initialize `font'.
Richard M. Stallman <rms@gnu.org>
parents: 18893
diff changeset
3288 font = x_get_arg (dpyinfo, parms, Qfont, "font", "Font", string);
386d68191907 (Fx_create_frame): Don't fail to initialize `font'.
Richard M. Stallman <rms@gnu.org>
parents: 18893
diff changeset
3289
4150
e2e92cd737bf * xfns.c (Fx_create_frame): Block input around call to
Jim Blandy <jimb@redhat.com>
parents: 4146
diff changeset
3290 BLOCK_INPUT;
4259
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3291 /* First, try whatever font the caller has specified. */
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3292 if (STRINGP (font))
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
3293 {
21555
0927f341e390 (x_set_font): Give 2nd arg nil to Fquery_fontset.
Kenichi Handa <handa@m17n.org>
parents: 21549
diff changeset
3294 tem = Fquery_fontset (font, Qnil);
17722
27df69e20b98 (Fx_create_frame): Delete code for handling the X
Kenichi Handa <handa@m17n.org>
parents: 17629
diff changeset
3295 if (STRINGP (tem))
27df69e20b98 (Fx_create_frame): Delete code for handling the X
Kenichi Handa <handa@m17n.org>
parents: 17629
diff changeset
3296 font = x_new_fontset (f, XSTRING (tem)->data);
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
3297 else
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
3298 font = x_new_font (f, XSTRING (font)->data);
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
3299 }
4259
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3300 /* Try out a font which we hope has bold and italic variations. */
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3301 if (!STRINGP (font))
8270
1a0af0f4fb1d (Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents: 8192
diff changeset
3302 font = x_new_font (f, "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1");
4259
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3303 if (! STRINGP (font))
8270
1a0af0f4fb1d (Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents: 8192
diff changeset
3304 font = x_new_font (f, "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1");
4259
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3305 if (! STRINGP (font))
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3306 /* This was formerly the first thing tried, but it finds too many fonts
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3307 and takes too long. */
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3308 font = x_new_font (f, "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1");
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3309 /* If those didn't work, look for something which will at least work. */
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3310 if (! STRINGP (font))
8270
1a0af0f4fb1d (Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents: 8192
diff changeset
3311 font = x_new_font (f, "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1");
4150
e2e92cd737bf * xfns.c (Fx_create_frame): Block input around call to
Jim Blandy <jimb@redhat.com>
parents: 4146
diff changeset
3312 UNBLOCK_INPUT;
e2e92cd737bf * xfns.c (Fx_create_frame): Block input around call to
Jim Blandy <jimb@redhat.com>
parents: 4146
diff changeset
3313 if (! STRINGP (font))
4259
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3314 font = build_string ("fixed");
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3315
17722
27df69e20b98 (Fx_create_frame): Delete code for handling the X
Kenichi Handa <handa@m17n.org>
parents: 17629
diff changeset
3316 x_default_parameter (f, parms, Qfont, font,
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
3317 "font", "Font", string);
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
3318 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3319
15720
f1549b7501af (Fx_create_frame): Do xlwmenu hack only if USE_LUCID.
Karl Heuer <kwzh@gnu.org>
parents: 15706
diff changeset
3320 #ifdef USE_LUCID
9742
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
3321 /* Prevent lwlib/xlwmenu.c from crashing because of a bug
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
3322 whereby it fails to get any font. */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3323 xlwmenu_default_font = f->output_data.x->font;
9808
4c43c9dbe130 (x_window): Make ibw 0 by default.
Richard M. Stallman <rms@gnu.org>
parents: 9742
diff changeset
3324 #endif
9742
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
3325
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3326 x_default_parameter (f, parms, Qborder_width, make_number (2),
21267
5396874c652c (Fx_create_frame): Use "borderWidth", not "borderwidth",
Andreas Schwab <schwab@suse.de>
parents: 21244
diff changeset
3327 "borderWidth", "BorderWidth", number);
3923
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3328 /* This defaults to 2 in order to match xterm. We recognize either
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3329 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
3330 it). */
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3331 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
3332 {
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3333 Lisp_Object value;
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3334
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
3335 value = x_get_arg (dpyinfo, parms, Qinternal_border_width,
16351
ac552926fc7e (x_set_internal_border_width, Fx_create_frame):
Richard M. Stallman <rms@gnu.org>
parents: 16305
diff changeset
3336 "internalBorder", "internalBorder", number);
3923
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3337 if (! EQ (value, Qunbound))
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3338 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
3339 parms);
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3340 }
16302
025b3dc7a6ba (Fx_create_frame): Default Qinternal_border_width to 1.
Richard M. Stallman <rms@gnu.org>
parents: 16254
diff changeset
3341 x_default_parameter (f, parms, Qinternal_border_width, make_number (1),
16351
ac552926fc7e (x_set_internal_border_width, Fx_create_frame):
Richard M. Stallman <rms@gnu.org>
parents: 16305
diff changeset
3342 "internalBorderWidth", "internalBorderWidth", number);
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
3343 x_default_parameter (f, parms, Qvertical_scroll_bars, Qleft,
18893
de4c911119b4 (Fx_create_frame): Default vertical-scroll-bars as symbol, not boolean.
Richard M. Stallman <rms@gnu.org>
parents: 18631
diff changeset
3344 "verticalScrollBars", "ScrollBars", symbol);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3345
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3346 /* 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
3347 x_default_parameter (f, parms, Qforeground_color, build_string ("black"),
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3348 "foreground", "Foreground", string);
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3349 x_default_parameter (f, parms, Qbackground_color, build_string ("white"),
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3350 "background", "Background", string);
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3351 x_default_parameter (f, parms, Qmouse_color, build_string ("black"),
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3352 "pointerColor", "Foreground", string);
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3353 x_default_parameter (f, parms, Qcursor_color, build_string ("black"),
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3354 "cursorColor", "Foreground", string);
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3355 x_default_parameter (f, parms, Qborder_color, build_string ("black"),
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3356 "borderColor", "BorderColor", string);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3357
8758
fac1c4722677 (Fx_create_frame): Make 1 the default for menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 8675
diff changeset
3358 x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1),
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
3359 "menuBar", "MenuBar", number);
9166
44b44e900cf1 (x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents: 9103
diff changeset
3360 x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
3361 "scrollBarWidth", "ScrollBarWidth", number);
13083
16638ebb209f (Fx_create_frame): Set up buffer-predicate slot.
Richard M. Stallman <rms@gnu.org>
parents: 12832
diff changeset
3362 x_default_parameter (f, parms, Qbuffer_predicate, Qnil,
16638ebb209f (Fx_create_frame): Set up buffer-predicate slot.
Richard M. Stallman <rms@gnu.org>
parents: 12832
diff changeset
3363 "bufferPredicate", "BufferPredicate", symbol);
14381
4d038c841cf4 (Qtitle): Declared.
Richard M. Stallman <rms@gnu.org>
parents: 14186
diff changeset
3364 x_default_parameter (f, parms, Qtitle, Qnil,
14595
a63b3053a3a3 (Fx_create_frame): Title is a string, not a symbol.
Karl Heuer <kwzh@gnu.org>
parents: 14563
diff changeset
3365 "title", "Title", string);
6882
3096a6f7fffb (Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents: 6790
diff changeset
3366
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3367 f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3368 window_prompting = x_figure_window_size (f, parms);
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3369
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
3370 if (window_prompting & XNegative)
6935
675e4ec5f14f (Fx_create_frame): Delete excess args to x_wm_set_size_hint.
Richard M. Stallman <rms@gnu.org>
parents: 6882
diff changeset
3371 {
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
3372 if (window_prompting & YNegative)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3373 f->output_data.x->win_gravity = SouthEastGravity;
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
3374 else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3375 f->output_data.x->win_gravity = NorthEastGravity;
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
3376 }
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
3377 else
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
3378 {
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
3379 if (window_prompting & YNegative)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3380 f->output_data.x->win_gravity = SouthWestGravity;
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
3381 else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3382 f->output_data.x->win_gravity = NorthWestGravity;
6935
675e4ec5f14f (Fx_create_frame): Delete excess args to x_wm_set_size_hint.
Richard M. Stallman <rms@gnu.org>
parents: 6882
diff changeset
3383 }
675e4ec5f14f (Fx_create_frame): Delete excess args to x_wm_set_size_hint.
Richard M. Stallman <rms@gnu.org>
parents: 6882
diff changeset
3384
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3385 f->output_data.x->size_hint_flags = window_prompting;
7263
b7025b4bf659 (Fx_create_frame): Set the size_hint_flags field.
Richard M. Stallman <rms@gnu.org>
parents: 7261
diff changeset
3386
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
3387 #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
3388 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
3389 #else
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3390 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
3391 #endif
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3392 x_icon (f, parms);
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3393 x_make_gc (f);
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
3394 init_frame_faces (f);
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3395
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3396 /* 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
3397 icon-creation functions can say whose icon they're describing. */
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3398 x_default_parameter (f, parms, Qicon_type, Qnil,
3347
53c89f73e85a (Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents: 3339
diff changeset
3399 "bitmapIcon", "BitmapIcon", symbol);
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3400
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3401 x_default_parameter (f, parms, Qauto_raise, Qnil,
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3402 "autoRaise", "AutoRaiseLower", boolean);
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3403 x_default_parameter (f, parms, Qauto_lower, Qnil,
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3404 "autoLower", "AutoRaiseLower", boolean);
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
3405 x_default_parameter (f, parms, Qcursor_type, Qbox,
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
3406 "cursorType", "CursorType", symbol);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3407
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3408 /* Dimensions, especially f->height, must be done via change_frame_size.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3409 Change will not be effected unless different from the current
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3410 f->height. */
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3411 width = f->width;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3412 height = f->height;
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
3413 f->height = 0;
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
3414 SET_FRAME_WIDTH (f, 0);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3415 change_frame_size (f, height, width, 1, 0);
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
3416
11707
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
3417 /* Tell the server what size and position, etc, we want,
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
3418 and how badly we want them. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3419 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
3420 x_wm_set_size_hint (f, window_prompting, 0);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3421 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3422
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
3423 tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, boolean);
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3424 f->no_split = minibuffer_only || EQ (tem, Qt);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3425
8103
b0d56b9856c4 (Fx_create_frame): Add GC protection for local var `f'.
Paul Reilly <pmr@pajato.com>
parents: 8091
diff changeset
3426 UNGCPRO;
b0d56b9856c4 (Fx_create_frame): Add GC protection for local var `f'.
Paul Reilly <pmr@pajato.com>
parents: 8091
diff changeset
3427
5429
87c67c389867 (Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents: 5229
diff changeset
3428 /* It is now ok to make the frame official
87c67c389867 (Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents: 5229
diff changeset
3429 even if we get an error below.
87c67c389867 (Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents: 5229
diff changeset
3430 And the frame needs to be on Vframe_list
87c67c389867 (Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents: 5229
diff changeset
3431 or making it visible won't work. */
87c67c389867 (Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents: 5229
diff changeset
3432 Vframe_list = Fcons (frame, Vframe_list);
87c67c389867 (Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents: 5229
diff changeset
3433
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3434 /* Now that the frame is official, it counts as a reference to
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3435 its display. */
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3436 FRAME_X_DISPLAY_INFO (f)->reference_count++;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3437
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
3438 /* Make the window appear on the frame and enable display,
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3439 unless the caller says not to. However, with explicit parent,
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3440 Emacs cannot control visibility, so don't try. */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3441 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
3442 {
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3443 Lisp_Object visibility;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3444
17779
094e5efd262d (Fx_create_frame): Get X resources from the display
Richard M. Stallman <rms@gnu.org>
parents: 17722
diff changeset
3445 visibility = x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, symbol);
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3446 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
3447 visibility = Qt;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3448
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3449 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
3450 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
3451 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
3452 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
3453 else
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3454 /* 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
3455 ;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3456 }
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3457
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3458 return unbind_to (count, frame);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3459 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3460
11537
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3461 /* 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
3462 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
3463 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
3464
6485
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3465 Lisp_Object
11537
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3466 x_get_focus_frame (frame)
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3467 struct frame *frame;
6485
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3468 {
11537
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3469 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
3470 Lisp_Object xfocus;
11537
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3471 if (! dpyinfo->x_focus_frame)
6485
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3472 return Qnil;
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3473
11537
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3474 XSETFRAME (xfocus, dpyinfo->x_focus_frame);
6485
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3475 return xfocus;
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3476 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3477
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
3478 #if 1
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
3479 #include "x-list-font.c"
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
3480 #else
16041
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3481 DEFUN ("x-list-fonts", Fx_list_fonts, Sx_list_fonts, 1, 4, 0,
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3482 "Return a list of the names of available fonts matching PATTERN.\n\
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3483 If optional arguments FACE and FRAME are specified, return only fonts\n\
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3484 the same size as FACE on FRAME.\n\
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3485 \n\
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3486 PATTERN is a string, perhaps with wildcard characters;\n\
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3487 the * character matches any substring, and\n\
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3488 the ? character matches any single character.\n\
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3489 PATTERN is case-insensitive.\n\
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3490 FACE is a face name--a symbol.\n\
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3491 \n\
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3492 The return value is a list of strings, suitable as arguments to\n\
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3493 set-face-font.\n\
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3494 \n\
6783
3122395ded44 (Fx_list_fonts): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 6770
diff changeset
3495 Fonts Emacs can't use (i.e. proportional fonts) may or may not be excluded\n\
16041
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3496 even if they match PATTERN and FACE.\n\
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3497 \n\
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3498 The optional fourth argument MAXIMUM sets a limit on how many\n\
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3499 fonts to match. The first MAXIMUM fonts are reported.")
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3500 (pattern, face, frame, maximum)
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3501 Lisp_Object pattern, face, frame, maximum;
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3502 {
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3503 int num_fonts;
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3504 char **names;
9813
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3505 #ifndef BROKEN_XLISTFONTSWITHINFO
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3506 XFontStruct *info;
9813
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3507 #endif
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3508 XFontStruct *size_ref;
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3509 Lisp_Object list;
9014
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3510 FRAME_PTR f;
16041
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3511 Lisp_Object key;
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3512 int maxnames;
17609
8c878d76d6a4 (x_real_positions, x_set_mouse_color, Fx_list_fonts):
Richard M. Stallman <rms@gnu.org>
parents: 17579
diff changeset
3513 int count;
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3514
5948
ef777779bd80 (check_x): Make it global.
Karl Heuer <kwzh@gnu.org>
parents: 5900
diff changeset
3515 check_x ();
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3516 CHECK_STRING (pattern, 0);
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3517 if (!NILP (face))
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3518 CHECK_SYMBOL (face, 1);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3519
16041
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3520 if (NILP (maximum))
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3521 maxnames = 2000;
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3522 else
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3523 {
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3524 CHECK_NATNUM (maximum, 0);
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3525 maxnames = XINT (maximum);
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3526 }
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3527
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3528 f = check_x_frame (frame);
9014
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3529
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3530 /* Determine the width standard for comparison with the fonts we find. */
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3531
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3532 if (NILP (face))
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3533 size_ref = 0;
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3534 else
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3535 {
6882
3096a6f7fffb (Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents: 6790
diff changeset
3536 int face_id;
3096a6f7fffb (Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents: 6790
diff changeset
3537
3096a6f7fffb (Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents: 6790
diff changeset
3538 /* Don't die if we get called with a terminal frame. */
3096a6f7fffb (Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents: 6790
diff changeset
3539 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
3540 error ("Non-X frame used in `x-list-fonts'");
6882
3096a6f7fffb (Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents: 6790
diff changeset
3541
3096a6f7fffb (Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents: 6790
diff changeset
3542 face_id = face_name_id_number (f, face);
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3543
3881
9d92b383b584 Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents: 3821
diff changeset
3544 if (face_id < 0 || face_id >= FRAME_N_PARAM_FACES (f)
9d92b383b584 Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents: 3821
diff changeset
3545 || FRAME_PARAM_FACES (f) [face_id] == 0)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3546 size_ref = f->output_data.x->font;
3347
53c89f73e85a (Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents: 3339
diff changeset
3547 else
53c89f73e85a (Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents: 3339
diff changeset
3548 {
3881
9d92b383b584 Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents: 3821
diff changeset
3549 size_ref = FRAME_PARAM_FACES (f) [face_id]->font;
3347
53c89f73e85a (Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents: 3339
diff changeset
3550 if (size_ref == (XFontStruct *) (~0))
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3551 size_ref = f->output_data.x->font;
3347
53c89f73e85a (Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents: 3339
diff changeset
3552 }
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3553 }
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3554
9014
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3555 /* See if we cached the result for this particular query. */
16041
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3556 key = Fcons (pattern, maximum);
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3557 list = Fassoc (key,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3558 XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr);
9014
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3559
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3560 /* We have info in the cache for this PATTERN. */
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3561 if (!NILP (list))
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3562 {
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3563 Lisp_Object tem, newlist;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3564
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3565 /* We have info about this pattern. */
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3566 list = XCONS (list)->cdr;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3567
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3568 if (size_ref == 0)
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3569 return list;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3570
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3571 BLOCK_INPUT;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3572
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3573 /* Filter the cached info and return just the fonts that match FACE. */
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3574 newlist = Qnil;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3575 for (tem = list; CONSP (tem); tem = XCONS (tem)->cdr)
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3576 {
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3577 XFontStruct *thisinfo;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3578
17609
8c878d76d6a4 (x_real_positions, x_set_mouse_color, Fx_list_fonts):
Richard M. Stallman <rms@gnu.org>
parents: 17579
diff changeset
3579 count = x_catch_errors (FRAME_X_DISPLAY (f));
14979
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3580
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3581 thisinfo = XLoadQueryFont (FRAME_X_DISPLAY (f),
9014
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3582 XSTRING (XCONS (tem)->car)->data);
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3583
14979
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3584 x_check_errors (FRAME_X_DISPLAY (f), "XLoadQueryFont failure: %s");
17609
8c878d76d6a4 (x_real_positions, x_set_mouse_color, Fx_list_fonts):
Richard M. Stallman <rms@gnu.org>
parents: 17579
diff changeset
3585 x_uncatch_errors (FRAME_X_DISPLAY (f), count);
14979
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3586
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3587 if (thisinfo && same_size_fonts (thisinfo, size_ref))
9014
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3588 newlist = Fcons (XCONS (tem)->car, newlist);
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3589
12546
f4fb791df099 (Fx_list_fonts): Don't free thisinfo if it is 0.
Karl Heuer <kwzh@gnu.org>
parents: 12470
diff changeset
3590 if (thisinfo != 0)
f4fb791df099 (Fx_list_fonts): Don't free thisinfo if it is 0.
Karl Heuer <kwzh@gnu.org>
parents: 12470
diff changeset
3591 XFreeFont (FRAME_X_DISPLAY (f), thisinfo);
9014
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3592 }
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3593
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3594 UNBLOCK_INPUT;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3595
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3596 return newlist;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3597 }
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3598
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3599 BLOCK_INPUT;
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3600
17609
8c878d76d6a4 (x_real_positions, x_set_mouse_color, Fx_list_fonts):
Richard M. Stallman <rms@gnu.org>
parents: 17579
diff changeset
3601 count = x_catch_errors (FRAME_X_DISPLAY (f));
14979
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3602
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3603 /* Solaris 2.3 has a bug in XListFontsWithInfo. */
9813
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3604 #ifndef BROKEN_XLISTFONTSWITHINFO
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3605 if (size_ref)
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3606 names = XListFontsWithInfo (FRAME_X_DISPLAY (f),
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3607 XSTRING (pattern)->data,
16041
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3608 maxnames,
9813
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3609 &num_fonts, /* count_return */
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3610 &info); /* info_return */
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3611 else
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3612 #endif
9813
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3613 names = XListFonts (FRAME_X_DISPLAY (f),
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3614 XSTRING (pattern)->data,
16041
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3615 maxnames,
9813
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3616 &num_fonts); /* count_return */
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3617
14979
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3618 x_check_errors (FRAME_X_DISPLAY (f), "XListFonts failure: %s");
17609
8c878d76d6a4 (x_real_positions, x_set_mouse_color, Fx_list_fonts):
Richard M. Stallman <rms@gnu.org>
parents: 17579
diff changeset
3619 x_uncatch_errors (FRAME_X_DISPLAY (f), count);
14979
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3620
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3621 UNBLOCK_INPUT;
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3622
3640
df1a2751ca24 (Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3623 list = Qnil;
df1a2751ca24 (Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3624
df1a2751ca24 (Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3625 if (names)
df1a2751ca24 (Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3626 {
df1a2751ca24 (Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3627 int i;
9014
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3628 Lisp_Object full_list;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3629
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3630 /* Make a list of all the fonts we got back.
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3631 Store that in the font cache for the display. */
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3632 full_list = Qnil;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3633 for (i = 0; i < num_fonts; i++)
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3634 full_list = Fcons (build_string (names[i]), full_list);
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3635 XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr
16041
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3636 = Fcons (Fcons (key, full_list),
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3637 XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->cdr);
9014
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3638
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3639 /* Make a list of the fonts that have the right width. */
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3640 list = Qnil;
3640
df1a2751ca24 (Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3641 for (i = 0; i < num_fonts; i++)
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3642 {
9813
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3643 int keeper;
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3644
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3645 if (!size_ref)
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3646 keeper = 1;
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3647 else
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3648 {
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3649 #ifdef BROKEN_XLISTFONTSWITHINFO
9813
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3650 XFontStruct *thisinfo;
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3651
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3652 BLOCK_INPUT;
14979
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3653
17609
8c878d76d6a4 (x_real_positions, x_set_mouse_color, Fx_list_fonts):
Richard M. Stallman <rms@gnu.org>
parents: 17579
diff changeset
3654 count = x_catch_errors (FRAME_X_DISPLAY (f));
9813
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3655 thisinfo = XLoadQueryFont (FRAME_X_DISPLAY (f), names[i]);
14979
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3656 x_check_errors (FRAME_X_DISPLAY (f),
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3657 "XLoadQueryFont failure: %s");
17609
8c878d76d6a4 (x_real_positions, x_set_mouse_color, Fx_list_fonts):
Richard M. Stallman <rms@gnu.org>
parents: 17579
diff changeset
3658 x_uncatch_errors (FRAME_X_DISPLAY (f), count);
14979
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3659
9813
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3660 UNBLOCK_INPUT;
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3661
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3662 keeper = thisinfo && same_size_fonts (thisinfo, size_ref);
15071
2ae4beb73bf5 (Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents: 15022
diff changeset
3663 BLOCK_INPUT;
2ae4beb73bf5 (Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents: 15022
diff changeset
3664 if (thisinfo && ! keeper)
2ae4beb73bf5 (Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents: 15022
diff changeset
3665 XFreeFont (FRAME_X_DISPLAY (f), thisinfo);
2ae4beb73bf5 (Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents: 15022
diff changeset
3666 else if (thisinfo)
2ae4beb73bf5 (Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents: 15022
diff changeset
3667 XFreeFontInfo (NULL, thisinfo, 1);
2ae4beb73bf5 (Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents: 15022
diff changeset
3668 UNBLOCK_INPUT;
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3669 #else
9813
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3670 keeper = same_size_fonts (&info[i], size_ref);
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3671 #endif
9813
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3672 }
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3673 if (keeper)
9014
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3674 list = Fcons (build_string (names[i]), list);
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3675 }
9014
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3676 list = Fnreverse (list);
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3677
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3678 BLOCK_INPUT;
9813
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3679 #ifndef BROKEN_XLISTFONTSWITHINFO
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3680 if (size_ref)
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3681 XFreeFontInfo (names, info, num_fonts);
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3682 else
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3683 #endif
9813
e33e1c6864de (Fx_list_fonts): Don't bother to retrieve font info when there's no size_ref
Karl Heuer <kwzh@gnu.org>
parents: 9808
diff changeset
3684 XFreeFontNames (names);
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3685 UNBLOCK_INPUT;
3640
df1a2751ca24 (Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3686 }
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3687
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3688 return list;
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3689 }
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
3690 #endif
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3691
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3692
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3693 DEFUN ("x-color-defined-p", Fx_color_defined_p, Sx_color_defined_p, 1, 2, 0,
11417
a5b136d16356 (Fx_color_defined_p): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 11353
diff changeset
3694 "Return non-nil if color COLOR is supported on frame FRAME.\n\
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3695 If FRAME is omitted or nil, use the selected frame.")
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3696 (color, frame)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3697 Lisp_Object color, frame;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3698 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3699 XColor foo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3700 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
3701
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3702 CHECK_STRING (color, 1);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3703
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3704 if (defined_color (f, XSTRING (color)->data, &foo, 0))
8675
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3705 return Qt;
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3706 else
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3707 return Qnil;
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3708 }
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3709
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3710 DEFUN ("x-color-values", Fx_color_values, Sx_color_values, 1, 2, 0,
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3711 "Return a description of the color named COLOR on frame FRAME.\n\
8675
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3712 The value is a list of integer RGB values--(RED GREEN BLUE).\n\
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3713 These values appear to range from 0 to 65280 or 65535, depending\n\
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3714 on the system; white is (65280 65280 65280) or (65535 65535 65535).\n\
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3715 If FRAME is omitted or nil, use the selected frame.")
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3716 (color, frame)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3717 Lisp_Object color, frame;
8675
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3718 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3719 XColor foo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3720 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
3721
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3722 CHECK_STRING (color, 1);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3723
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3724 if (defined_color (f, XSTRING (color)->data, &foo, 0))
8655
4c69fcaaa037 (Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents: 8405
diff changeset
3725 {
4c69fcaaa037 (Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents: 8405
diff changeset
3726 Lisp_Object rgb[3];
4c69fcaaa037 (Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents: 8405
diff changeset
3727
4c69fcaaa037 (Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents: 8405
diff changeset
3728 rgb[0] = make_number (foo.red);
4c69fcaaa037 (Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents: 8405
diff changeset
3729 rgb[1] = make_number (foo.green);
4c69fcaaa037 (Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents: 8405
diff changeset
3730 rgb[2] = make_number (foo.blue);
4c69fcaaa037 (Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents: 8405
diff changeset
3731 return Flist (3, rgb);
4c69fcaaa037 (Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents: 8405
diff changeset
3732 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3733 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3734 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3735 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3736
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3737 DEFUN ("x-display-color-p", Fx_display_color_p, Sx_display_color_p, 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3738 "Return t if the X display supports color.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3739 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3740 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3741 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3742 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3743 Lisp_Object display;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3744 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3745 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3746
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3747 if (dpyinfo->n_planes <= 2)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3748 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3749
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3750 switch (dpyinfo->visual->class)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3751 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3752 case StaticColor:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3753 case PseudoColor:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3754 case TrueColor:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3755 case DirectColor:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3756 return Qt;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3757
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3758 default:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3759 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3760 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3761 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3762
8779
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
3763 DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p,
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3764 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3765 "Return t if the X display supports shades of gray.\n\
12347
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3766 Note that color displays do support shades of gray.\n\
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3767 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3768 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3769 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3770 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3771 Lisp_Object display;
8779
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
3772 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3773 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3774
12347
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3775 if (dpyinfo->n_planes <= 1)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3776 return Qnil;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3777
12347
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3778 switch (dpyinfo->visual->class)
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3779 {
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3780 case StaticColor:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3781 case PseudoColor:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3782 case TrueColor:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3783 case DirectColor:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3784 case StaticGray:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3785 case GrayScale:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3786 return Qt;
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3787
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3788 default:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3789 return Qnil;
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3790 }
8779
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
3791 }
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
3792
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3793 DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width,
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3794 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3795 "Returns the width in pixels of the X display DISPLAY.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3796 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3797 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3798 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3799 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3800 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3801 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3802 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3803
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3804 return make_number (dpyinfo->width);
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3805 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3806
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3807 DEFUN ("x-display-pixel-height", Fx_display_pixel_height,
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3808 Sx_display_pixel_height, 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3809 "Returns the height in pixels of the X display DISPLAY.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3810 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3811 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3812 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3813 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3814 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3815 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3816 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3817
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3818 return make_number (dpyinfo->height);
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3819 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3820
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3821 DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes,
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3822 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3823 "Returns the number of bitplanes of the X display DISPLAY.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3824 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3825 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3826 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3827 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3828 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3829 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3830 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3831
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3832 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
3833 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3834
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3835 DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells,
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3836 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3837 "Returns the number of color cells of the X display DISPLAY.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3838 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3839 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3840 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3841 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3842 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3843 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3844 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3845
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3846 return make_number (DisplayCells (dpyinfo->display,
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3847 XScreenNumberOfScreen (dpyinfo->screen)));
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3848 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3849
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3850 DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3851 Sx_server_max_request_size,
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3852 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3853 "Returns the maximum request size of the X server of display DISPLAY.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3854 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3855 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3856 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3857 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3858 Lisp_Object display;
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3859 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3860 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3861
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3862 return make_number (MAXREQUEST (dpyinfo->display));
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3863 }
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3864
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3865 DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3866 "Returns the vendor ID string of the X server of display DISPLAY.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3867 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3868 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3869 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3870 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3871 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3872 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3873 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3874 char *vendor = ServerVendor (dpyinfo->display);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3875
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3876 if (! vendor) vendor = "";
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3877 return build_string (vendor);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3878 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3879
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3880 DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3881 "Returns the version numbers of the X server of display DISPLAY.\n\
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3882 The value is a list of three integers: the major and minor\n\
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3883 version numbers of the X Protocol in use, and the vendor-specific release\n\
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3884 number. See also the function `x-server-vendor'.\n\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3885 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3886 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3887 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3888 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3889 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3890 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3891 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3892 Display *dpy = dpyinfo->display;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3893
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3894 return Fcons (make_number (ProtocolVersion (dpy)),
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3895 Fcons (make_number (ProtocolRevision (dpy)),
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3896 Fcons (make_number (VendorRelease (dpy)), Qnil)));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3897 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3898
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3899 DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3900 "Returns the number of screens on the X server of display DISPLAY.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3901 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3902 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3903 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3904 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3905 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3906 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3907 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3908
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3909 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
3910 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3911
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3912 DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3913 "Returns the height in millimeters of the X display DISPLAY.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3914 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3915 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3916 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3917 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3918 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3919 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3920 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3921
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3922 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
3923 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3924
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3925 DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3926 "Returns the width in millimeters of the X display DISPLAY.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3927 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3928 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3929 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3930 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3931 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3932 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3933 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3934
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3935 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
3936 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3937
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3938 DEFUN ("x-display-backing-store", Fx_display_backing_store,
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3939 Sx_display_backing_store, 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3940 "Returns an indication of whether X display DISPLAY does backing store.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3941 The value may be `always', `when-mapped', or `not-useful'.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3942 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3943 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3944 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3945 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3946 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3947 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3948 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3949
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3950 switch (DoesBackingStore (dpyinfo->screen))
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3951 {
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3952 case Always:
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3953 return intern ("always");
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3954
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3955 case WhenMapped:
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3956 return intern ("when-mapped");
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3957
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3958 case NotUseful:
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3959 return intern ("not-useful");
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3960
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3961 default:
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3962 error ("Strange value for BackingStore parameter of screen");
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3963 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3964 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3965
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3966 DEFUN ("x-display-visual-class", Fx_display_visual_class,
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3967 Sx_display_visual_class, 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3968 "Returns the visual class of the X display DISPLAY.\n\
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3969 The value is one of the symbols `static-gray', `gray-scale',\n\
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3970 `static-color', `pseudo-color', `true-color', or `direct-color'.\n\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3971 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3972 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3973 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3974 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3975 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3976 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3977 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3978
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3979 switch (dpyinfo->visual->class)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3980 {
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3981 case StaticGray: return (intern ("static-gray"));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3982 case GrayScale: return (intern ("gray-scale"));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3983 case StaticColor: return (intern ("static-color"));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3984 case PseudoColor: return (intern ("pseudo-color"));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3985 case TrueColor: return (intern ("true-color"));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3986 case DirectColor: return (intern ("direct-color"));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3987 default:
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3988 error ("Display has an unknown visual class");
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3989 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3990 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3991
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3992 DEFUN ("x-display-save-under", Fx_display_save_under,
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3993 Sx_display_save_under, 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3994 "Returns t if the X display DISPLAY supports the save-under feature.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3995 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3996 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3997 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3998 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3999 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
4000 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4001 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4002
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4003 if (DoesSaveUnders (dpyinfo->screen) == True)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
4004 return Qt;
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
4005 else
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
4006 return Qnil;
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
4007 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
4008
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4009 int
2067
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4010 x_pixel_width (f)
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4011 register struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4012 {
2067
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4013 return PIXEL_WIDTH (f);
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4014 }
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4015
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4016 int
2067
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4017 x_pixel_height (f)
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4018 register struct frame *f;
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4019 {
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4020 return PIXEL_HEIGHT (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4021 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4022
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4023 int
2067
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4024 x_char_width (f)
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4025 register struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4026 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4027 return FONT_WIDTH (f->output_data.x->font);
2067
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4028 }
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4029
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4030 int
2067
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4031 x_char_height (f)
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4032 register struct frame *f;
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
4033 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4034 return f->output_data.x->line_height;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4035 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4036
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4037 int
19825
cdfaf8ce5208 (x_screen_planes): Fix type of argument.
Richard M. Stallman <rms@gnu.org>
parents: 19095
diff changeset
4038 x_screen_planes (f)
cdfaf8ce5208 (x_screen_planes): Fix type of argument.
Richard M. Stallman <rms@gnu.org>
parents: 19095
diff changeset
4039 register struct frame *f;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4040 {
19825
cdfaf8ce5208 (x_screen_planes): Fix type of argument.
Richard M. Stallman <rms@gnu.org>
parents: 19095
diff changeset
4041 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
4042 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4043
689
45401d45581d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 687
diff changeset
4044 #if 0 /* These no longer seem like the right way to do things. */
45401d45581d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 687
diff changeset
4045
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4046 /* Draw a rectangle on the frame with left top corner including
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4047 the character specified by LEFT_CHAR and TOP_CHAR. The rectangle is
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4048 CHARS by LINES wide and long and is the color of the cursor. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4049
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4050 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4051 x_rectangle (f, gc, left_char, top_char, chars, lines)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4052 register struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4053 GC gc;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4054 register int top_char, left_char, chars, lines;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4055 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4056 int width;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4057 int height;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4058 int left = (left_char * FONT_WIDTH (f->output_data.x->font)
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4059 + f->output_data.x->internal_border_width);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4060 int top = (top_char * f->output_data.x->line_height
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4061 + f->output_data.x->internal_border_width);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4062
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4063 if (chars < 0)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4064 width = FONT_WIDTH (f->output_data.x->font) / 2;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4065 else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4066 width = FONT_WIDTH (f->output_data.x->font) * chars;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4067 if (lines < 0)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4068 height = f->output_data.x->line_height / 2;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4069 else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4070 height = f->output_data.x->line_height * lines;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4071
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4072 XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4073 gc, left, top, width, height);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4074 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4075
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4076 DEFUN ("x-draw-rectangle", Fx_draw_rectangle, Sx_draw_rectangle, 5, 5, 0,
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4077 "Draw a rectangle on FRAME between coordinates specified by\n\
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4078 numbers X0, Y0, X1, Y1 in the cursor pixel.")
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4079 (frame, X0, Y0, X1, Y1)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4080 register Lisp_Object frame, X0, X1, Y0, Y1;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4081 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4082 register int x0, y0, x1, y1, top, left, n_chars, n_lines;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4083
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4084 CHECK_LIVE_FRAME (frame, 0);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4085 CHECK_NUMBER (X0, 0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4086 CHECK_NUMBER (Y0, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4087 CHECK_NUMBER (X1, 2);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4088 CHECK_NUMBER (Y1, 3);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4089
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4090 x0 = XINT (X0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4091 x1 = XINT (X1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4092 y0 = XINT (Y0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4093 y1 = XINT (Y1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4094
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4095 if (y1 > y0)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4096 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4097 top = y0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4098 n_lines = y1 - y0 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4099 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4100 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4101 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4102 top = y1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4103 n_lines = y0 - y1 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4104 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4105
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4106 if (x1 > x0)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4107 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4108 left = x0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4109 n_chars = x1 - x0 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4110 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4111 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4112 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4113 left = x1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4114 n_chars = x0 - x1 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4115 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4116
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4117 BLOCK_INPUT;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4118 x_rectangle (XFRAME (frame), XFRAME (frame)->output_data.x->cursor_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4119 left, top, n_chars, n_lines);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4120 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4121
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4122 return Qt;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4123 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4124
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4125 DEFUN ("x-erase-rectangle", Fx_erase_rectangle, Sx_erase_rectangle, 5, 5, 0,
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4126 "Draw a rectangle drawn on FRAME between coordinates\n\
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4127 X0, Y0, X1, Y1 in the regular background-pixel.")
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4128 (frame, X0, Y0, X1, Y1)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4129 register Lisp_Object frame, X0, Y0, X1, Y1;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4130 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4131 register int x0, y0, x1, y1, top, left, n_chars, n_lines;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4132
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4133 CHECK_LIVE_FRAME (frame, 0);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4134 CHECK_NUMBER (X0, 0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4135 CHECK_NUMBER (Y0, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4136 CHECK_NUMBER (X1, 2);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4137 CHECK_NUMBER (Y1, 3);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4138
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4139 x0 = XINT (X0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4140 x1 = XINT (X1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4141 y0 = XINT (Y0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4142 y1 = XINT (Y1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4143
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4144 if (y1 > y0)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4145 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4146 top = y0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4147 n_lines = y1 - y0 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4148 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4149 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4150 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4151 top = y1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4152 n_lines = y0 - y1 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4153 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4154
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4155 if (x1 > x0)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4156 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4157 left = x0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4158 n_chars = x1 - x0 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4159 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4160 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4161 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4162 left = x1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4163 n_chars = x0 - x1 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4164 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4165
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4166 BLOCK_INPUT;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4167 x_rectangle (XFRAME (frame), XFRAME (frame)->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4168 left, top, n_chars, n_lines);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4169 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4170
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4171 return Qt;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4172 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4173
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4174 /* Draw lines around the text region beginning at the character position
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4175 TOP_X, TOP_Y and ending at BOTTOM_X and BOTTOM_Y. GC specifies the
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4176 pixel and line characteristics. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4177
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4178 #define line_len(line) (FRAME_CURRENT_GLYPHS (f)->used[(line)])
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4179
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4180 static void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4181 outline_region (f, gc, top_x, top_y, bottom_x, bottom_y)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4182 register struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4183 GC gc;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4184 int top_x, top_y, bottom_x, bottom_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4185 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4186 register int ibw = f->output_data.x->internal_border_width;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4187 register int font_w = FONT_WIDTH (f->output_data.x->font);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4188 register int font_h = f->output_data.x->line_height;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4189 int y = top_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4190 int x = line_len (y);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
4191 XPoint *pixel_points
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
4192 = (XPoint *) alloca (((bottom_y - top_y + 2) * 4) * sizeof (XPoint));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4193 register XPoint *this_point = pixel_points;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4194
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4195 /* Do the horizontal top line/lines */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4196 if (top_x == 0)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4197 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4198 this_point->x = ibw;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4199 this_point->y = ibw + (font_h * top_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4200 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4201 if (x == 0)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4202 this_point->x = ibw + (font_w / 2); /* Half-size for newline chars. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4203 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4204 this_point->x = ibw + (font_w * x);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4205 this_point->y = (this_point - 1)->y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4206 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4207 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4208 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4209 this_point->x = ibw;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4210 this_point->y = ibw + (font_h * (top_y + 1));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4211 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4212 this_point->x = ibw + (font_w * top_x);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4213 this_point->y = (this_point - 1)->y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4214 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4215 this_point->x = (this_point - 1)->x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4216 this_point->y = ibw + (font_h * top_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4217 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4218 this_point->x = ibw + (font_w * x);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4219 this_point->y = (this_point - 1)->y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4220 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4221
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4222 /* Now do the right side. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4223 while (y < bottom_y)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4224 { /* Right vertical edge */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4225 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4226 this_point->x = (this_point - 1)->x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4227 this_point->y = ibw + (font_h * (y + 1));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4228 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4229
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4230 y++; /* Horizontal connection to next line */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4231 x = line_len (y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4232 if (x == 0)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4233 this_point->x = ibw + (font_w / 2);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4234 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4235 this_point->x = ibw + (font_w * x);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4236
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4237 this_point->y = (this_point - 1)->y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4238 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4239
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4240 /* Now do the bottom and connect to the top left point. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4241 this_point->x = ibw + (font_w * (bottom_x + 1));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4242
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4243 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4244 this_point->x = (this_point - 1)->x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4245 this_point->y = ibw + (font_h * (bottom_y + 1));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4246 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4247 this_point->x = ibw;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4248 this_point->y = (this_point - 1)->y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4249 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4250 this_point->x = pixel_points->x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4251 this_point->y = pixel_points->y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4252
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4253 XDrawLines (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4254 gc, pixel_points,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4255 (this_point - pixel_points + 1), CoordModeOrigin);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4256 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4257
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4258 DEFUN ("x-contour-region", Fx_contour_region, Sx_contour_region, 1, 1, 0,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4259 "Highlight the region between point and the character under the mouse\n\
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4260 selected frame.")
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4261 (event)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4262 register Lisp_Object event;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4263 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4264 register int x0, y0, x1, y1;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4265 register struct frame *f = selected_frame;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4266 register int p1, p2;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4267
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4268 CHECK_CONS (event, 0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4269
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4270 BLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4271 x0 = XINT (Fcar (Fcar (event)));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4272 y0 = XINT (Fcar (Fcdr (Fcar (event))));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4273
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4274 /* If the mouse is past the end of the line, don't that area. */
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4275 /* ReWrite this... */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4276
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4277 x1 = f->cursor_x;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4278 y1 = f->cursor_y;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4279
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4280 if (y1 > y0) /* point below mouse */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4281 outline_region (f, f->output_data.x->cursor_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4282 x0, y0, x1, y1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4283 else if (y1 < y0) /* point above mouse */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4284 outline_region (f, f->output_data.x->cursor_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4285 x1, y1, x0, y0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4286 else /* same line: draw horizontal rectangle */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4287 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4288 if (x1 > x0)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4289 x_rectangle (f, f->output_data.x->cursor_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4290 x0, y0, (x1 - x0 + 1), 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4291 else if (x1 < x0)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4292 x_rectangle (f, f->output_data.x->cursor_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4293 x1, y1, (x0 - x1 + 1), 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4294 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4295
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4296 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4297 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4298
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4299 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4300 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4301
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4302 DEFUN ("x-uncontour-region", Fx_uncontour_region, Sx_uncontour_region, 1, 1, 0,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4303 "Erase any highlighting of the region between point and the character\n\
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4304 at X, Y on the selected frame.")
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4305 (event)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4306 register Lisp_Object event;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4307 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4308 register int x0, y0, x1, y1;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4309 register struct frame *f = selected_frame;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4310
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4311 BLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4312 x0 = XINT (Fcar (Fcar (event)));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4313 y0 = XINT (Fcar (Fcdr (Fcar (event))));
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4314 x1 = f->cursor_x;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4315 y1 = f->cursor_y;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4316
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4317 if (y1 > y0) /* point below mouse */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4318 outline_region (f, f->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4319 x0, y0, x1, y1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4320 else if (y1 < y0) /* point above mouse */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4321 outline_region (f, f->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4322 x1, y1, x0, y0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4323 else /* same line: draw horizontal rectangle */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4324 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4325 if (x1 > x0)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4326 x_rectangle (f, f->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4327 x0, y0, (x1 - x0 + 1), 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4328 else if (x1 < x0)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4329 x_rectangle (f, f->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4330 x1, y1, (x0 - x1 + 1), 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4331 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4332 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4333
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4334 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4335 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4336
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4337 #if 0
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4338 int contour_begin_x, contour_begin_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4339 int contour_end_x, contour_end_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4340 int contour_npoints;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4341
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4342 /* Clip the top part of the contour lines down (and including) line Y_POS.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4343 If X_POS is in the middle (rather than at the end) of the line, drop
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4344 down a line at that character. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4345
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4346 static void
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4347 clip_contour_top (y_pos, x_pos)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4348 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4349 register XPoint *begin = contour_lines[y_pos].top_left;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4350 register XPoint *end;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4351 register int npoints;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4352 register struct display_line *line = selected_frame->phys_lines[y_pos + 1];
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4353
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4354 if (x_pos >= line->len - 1) /* Draw one, straight horizontal line. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4355 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4356 end = contour_lines[y_pos].top_right;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4357 npoints = (end - begin + 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4358 XDrawLines (x_current_display, contour_window,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4359 contour_erase_gc, begin_erase, npoints, CoordModeOrigin);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4360
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4361 bcopy (end, begin + 1, contour_last_point - end + 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4362 contour_last_point -= (npoints - 2);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4363 XDrawLines (x_current_display, contour_window,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4364 contour_erase_gc, begin, 2, CoordModeOrigin);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4365 XFlush (x_current_display);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4366
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4367 /* Now, update contour_lines structure. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4368 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4369 /* ______. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4370 else /* |________*/
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4371 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4372 register XPoint *p = begin + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4373 end = contour_lines[y_pos].bottom_right;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4374 npoints = (end - begin + 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4375 XDrawLines (x_current_display, contour_window,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4376 contour_erase_gc, begin_erase, npoints, CoordModeOrigin);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4377
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4378 p->y = begin->y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4379 p->x = ibw + (font_w * (x_pos + 1));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4380 p++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4381 p->y = begin->y + font_h;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4382 p->x = (p - 1)->x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4383 bcopy (end, begin + 3, contour_last_point - end + 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4384 contour_last_point -= (npoints - 5);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4385 XDrawLines (x_current_display, contour_window,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4386 contour_erase_gc, begin, 4, CoordModeOrigin);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4387 XFlush (x_current_display);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4388
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4389 /* Now, update contour_lines structure. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4390 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4391 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4392
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 3512
diff changeset
4393 /* Erase the top horizontal lines of the contour, and then extend
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4394 the contour upwards. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4395
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4396 static void
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4397 extend_contour_top (line)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4398 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4399 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4400
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4401 static void
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4402 clip_contour_bottom (x_pos, y_pos)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4403 int x_pos, y_pos;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4404 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4405 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4406
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4407 static void
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4408 extend_contour_bottom (x_pos, y_pos)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4409 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4410 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4411
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4412 DEFUN ("x-select-region", Fx_select_region, Sx_select_region, 1, 1, "e",
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4413 "")
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4414 (event)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4415 Lisp_Object event;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4416 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4417 register struct frame *f = selected_frame;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4418 register int point_x = f->cursor_x;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4419 register int point_y = f->cursor_y;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4420 register int mouse_below_point;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4421 register Lisp_Object obj;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4422 register int x_contour_x, x_contour_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4423
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4424 x_contour_x = x_mouse_x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4425 x_contour_y = x_mouse_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4426 if (x_contour_y > point_y || (x_contour_y == point_y
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4427 && x_contour_x > point_x))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4428 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4429 mouse_below_point = 1;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4430 outline_region (f, f->output_data.x->cursor_gc, point_x, point_y,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4431 x_contour_x, x_contour_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4432 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4433 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4434 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4435 mouse_below_point = 0;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4436 outline_region (f, f->output_data.x->cursor_gc, x_contour_x, x_contour_y,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4437 point_x, point_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4438 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4439
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4440 while (1)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4441 {
1096
d79192bacdce (Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents: 1050
diff changeset
4442 obj = read_char (-1, 0, 0, Qnil, 0);
9103
948e8acb6990 (x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9022
diff changeset
4443 if (!CONSP (obj))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4444 break;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4445
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4446 if (mouse_below_point)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4447 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4448 if (x_mouse_y <= point_y) /* Flipped. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4449 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4450 mouse_below_point = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4451
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4452 outline_region (f, f->output_data.x->reverse_gc, point_x, point_y,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4453 x_contour_x, x_contour_y);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4454 outline_region (f, f->output_data.x->cursor_gc, x_mouse_x, x_mouse_y,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4455 point_x, point_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4456 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4457 else if (x_mouse_y < x_contour_y) /* Bottom clipped. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4458 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4459 clip_contour_bottom (x_mouse_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4460 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4461 else if (x_mouse_y > x_contour_y) /* Bottom extended. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4462 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4463 extend_bottom_contour (x_mouse_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4464 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4465
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4466 x_contour_x = x_mouse_x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4467 x_contour_y = x_mouse_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4468 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4469 else /* mouse above or same line as point */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4470 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4471 if (x_mouse_y >= point_y) /* Flipped. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4472 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4473 mouse_below_point = 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4474
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4475 outline_region (f, f->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4476 x_contour_x, x_contour_y, point_x, point_y);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4477 outline_region (f, f->output_data.x->cursor_gc, point_x, point_y,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4478 x_mouse_x, x_mouse_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4479 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4480 else if (x_mouse_y > x_contour_y) /* Top clipped. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4481 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4482 clip_contour_top (x_mouse_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4483 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4484 else if (x_mouse_y < x_contour_y) /* Top extended. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4485 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4486 extend_contour_top (x_mouse_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4487 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4488 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4489 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4490
1601
a371ec79bc31 * xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents: 1528
diff changeset
4491 unread_command_event = obj;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4492 if (mouse_below_point)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4493 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4494 contour_begin_x = point_x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4495 contour_begin_y = point_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4496 contour_end_x = x_contour_x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4497 contour_end_y = x_contour_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4498 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4499 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4500 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4501 contour_begin_x = x_contour_x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4502 contour_begin_y = x_contour_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4503 contour_end_x = point_x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4504 contour_end_y = point_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4505 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4506 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4507 #endif
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4508
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4509 DEFUN ("x-horizontal-line", Fx_horizontal_line, Sx_horizontal_line, 1, 1, "e",
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4510 "")
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4511 (event)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4512 Lisp_Object event;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4513 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4514 register Lisp_Object obj;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4515 struct frame *f = selected_frame;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4516 register struct window *w = XWINDOW (selected_window);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4517 register GC line_gc = f->output_data.x->cursor_gc;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4518 register GC erase_gc = f->output_data.x->reverse_gc;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4519 #if 0
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4520 char dash_list[] = {6, 4, 6, 4};
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4521 int dashes = 4;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4522 XGCValues gc_values;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4523 #endif
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4524 register int previous_y;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4525 register int line = (x_mouse_y + 1) * f->output_data.x->line_height
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4526 + f->output_data.x->internal_border_width;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4527 register int left = f->output_data.x->internal_border_width
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
4528 + (WINDOW_LEFT_MARGIN (w)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4529 * FONT_WIDTH (f->output_data.x->font));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4530 register int right = left + (w->width
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4531 * FONT_WIDTH (f->output_data.x->font))
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4532 - f->output_data.x->internal_border_width;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4533
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4534 #if 0
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4535 BLOCK_INPUT;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4536 gc_values.foreground = f->output_data.x->cursor_pixel;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4537 gc_values.background = f->output_data.x->background_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4538 gc_values.line_width = 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4539 gc_values.line_style = LineOnOffDash;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4540 gc_values.cap_style = CapRound;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4541 gc_values.join_style = JoinRound;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4542
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4543 line_gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4544 GCLineStyle | GCJoinStyle | GCCapStyle
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4545 | GCLineWidth | GCForeground | GCBackground,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4546 &gc_values);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4547 XSetDashes (FRAME_X_DISPLAY (f), line_gc, 0, dash_list, dashes);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4548 gc_values.foreground = f->output_data.x->background_pixel;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4549 gc_values.background = f->output_data.x->foreground_pixel;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4550 erase_gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4551 GCLineStyle | GCJoinStyle | GCCapStyle
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4552 | GCLineWidth | GCForeground | GCBackground,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4553 &gc_values);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4554 XSetDashes (FRAME_X_DISPLAY (f), erase_gc, 0, dash_list, dashes);
12051
f193ce9efe24 (x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents: 12046
diff changeset
4555 UNBLOCK_INPUT;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4556 #endif
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4557
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4558 while (1)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4559 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4560 BLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4561 if (x_mouse_y >= XINT (w->top)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4562 && x_mouse_y < XINT (w->top) + XINT (w->height) - 1)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4563 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4564 previous_y = x_mouse_y;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4565 line = (x_mouse_y + 1) * f->output_data.x->line_height
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4566 + f->output_data.x->internal_border_width;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4567 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4568 line_gc, left, line, right, line);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4569 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4570 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4571 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4572
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4573 do
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4574 {
1096
d79192bacdce (Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents: 1050
diff changeset
4575 obj = read_char (-1, 0, 0, Qnil, 0);
9103
948e8acb6990 (x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9022
diff changeset
4576 if (!CONSP (obj)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4577 || (! EQ (Fcar (Fcdr (Fcdr (obj))),
9103
948e8acb6990 (x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9022
diff changeset
4578 Qvertical_scroll_bar))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4579 || x_mouse_grabbed)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4580 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4581 BLOCK_INPUT;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4582 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4583 erase_gc, left, line, right, line);
1601
a371ec79bc31 * xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents: 1528
diff changeset
4584 unread_command_event = obj;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4585 #if 0
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4586 XFreeGC (FRAME_X_DISPLAY (f), line_gc);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4587 XFreeGC (FRAME_X_DISPLAY (f), erase_gc);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4588 #endif
12051
f193ce9efe24 (x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents: 12046
diff changeset
4589 UNBLOCK_INPUT;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4590 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4591 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4592 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4593 while (x_mouse_y == previous_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4594
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4595 BLOCK_INPUT;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4596 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4597 erase_gc, left, line, right, line);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4598 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4599 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4600 }
687
e2b747dd6a6e *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 642
diff changeset
4601 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4602
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4603 #if 0
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4604 /* These keep track of the rectangle following the pointer. */
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4605 int mouse_track_top, mouse_track_left, mouse_track_width;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4606
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4607 /* Offset in buffer of character under the pointer, or 0. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4608 int mouse_buffer_offset;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4609
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4610 DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 0, 0, 0,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4611 "Track the pointer.")
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4612 ()
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4613 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4614 static Cursor current_pointer_shape;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4615 FRAME_PTR f = x_mouse_frame;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4616
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4617 BLOCK_INPUT;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4618 if (EQ (Vmouse_frame_part, Qtext_part)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4619 && (current_pointer_shape != f->output_data.x->nontext_cursor))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4620 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4621 unsigned char c;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4622 struct buffer *buf;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4623
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4624 current_pointer_shape = f->output_data.x->nontext_cursor;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4625 XDefineCursor (FRAME_X_DISPLAY (f),
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
4626 FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4627 current_pointer_shape);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4628
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4629 buf = XBUFFER (XWINDOW (Vmouse_window)->buffer);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4630 c = *(BUF_CHAR_ADDRESS (buf, mouse_buffer_offset));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4631 }
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4632 else if (EQ (Vmouse_frame_part, Qmodeline_part)
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4633 && (current_pointer_shape != f->output_data.x->modeline_cursor))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4634 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4635 current_pointer_shape = f->output_data.x->modeline_cursor;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4636 XDefineCursor (FRAME_X_DISPLAY (f),
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
4637 FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4638 current_pointer_shape);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4639 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4640
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4641 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4642 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4643 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4644 #endif
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4645
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4646 #if 0
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4647 DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 1, 1, "e",
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4648 "Draw rectangle around character under mouse pointer, if there is one.")
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4649 (event)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4650 Lisp_Object event;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4651 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4652 struct window *w = XWINDOW (Vmouse_window);
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4653 struct frame *f = XFRAME (WINDOW_FRAME (w));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4654 struct buffer *b = XBUFFER (w->buffer);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4655 Lisp_Object obj;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4656
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4657 if (! EQ (Vmouse_window, selected_window))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4658 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4659
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4660 if (EQ (event, Qnil))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4661 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4662 int x, y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4663
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4664 x_read_mouse_position (selected_frame, &x, &y);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4665 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4666
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4667 BLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4668 mouse_track_width = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4669 mouse_track_left = mouse_track_top = -1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4670
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4671 do
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4672 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4673 if ((x_mouse_x != mouse_track_left
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4674 && (x_mouse_x < mouse_track_left
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4675 || x_mouse_x > (mouse_track_left + mouse_track_width)))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4676 || x_mouse_y != mouse_track_top)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4677 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4678 int hp = 0; /* Horizontal position */
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4679 int len = FRAME_CURRENT_GLYPHS (f)->used[x_mouse_y];
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4680 int p = FRAME_CURRENT_GLYPHS (f)->bufp[x_mouse_y];
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4681 int tab_width = XINT (b->tab_width);
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 436
diff changeset
4682 int ctl_arrow_p = !NILP (b->ctl_arrow);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4683 unsigned char c;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4684 int mode_line_vpos = XFASTINT (w->height) + XFASTINT (w->top) - 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4685 int in_mode_line = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4686
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4687 if (! FRAME_CURRENT_GLYPHS (f)->enable[x_mouse_y])
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4688 break;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4689
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4690 /* Erase previous rectangle. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4691 if (mouse_track_width)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4692 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4693 x_rectangle (f, f->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4694 mouse_track_left, mouse_track_top,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4695 mouse_track_width, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4696
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4697 if ((mouse_track_left == f->phys_cursor_x
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4698 || mouse_track_left == f->phys_cursor_x - 1)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4699 && mouse_track_top == f->phys_cursor_y)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4700 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4701 x_display_cursor (f, 1);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4702 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4703 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4704
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4705 mouse_track_left = x_mouse_x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4706 mouse_track_top = x_mouse_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4707 mouse_track_width = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4708
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4709 if (mouse_track_left > len) /* Past the end of line. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4710 goto draw_or_not;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4711
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4712 if (mouse_track_top == mode_line_vpos)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4713 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4714 in_mode_line = 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4715 goto draw_or_not;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4716 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4717
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4718 if (tab_width <= 0 || tab_width > 20) tab_width = 8;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4719 do
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4720 {
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
4721 c = FETCH_BYTE (p);
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4722 if (len == f->width && hp == len - 1 && c != '\n')
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4723 goto draw_or_not;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4724
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4725 switch (c)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4726 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4727 case '\t':
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4728 mouse_track_width = tab_width - (hp % tab_width);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4729 p++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4730 hp += mouse_track_width;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4731 if (hp > x_mouse_x)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4732 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4733 mouse_track_left = hp - mouse_track_width;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4734 goto draw_or_not;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4735 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4736 continue;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4737
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4738 case '\n':
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4739 mouse_track_width = -1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4740 goto draw_or_not;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4741
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4742 default:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4743 if (ctl_arrow_p && (c < 040 || c == 0177))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4744 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4745 if (p > ZV)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4746 goto draw_or_not;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4747
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4748 mouse_track_width = 2;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4749 p++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4750 hp +=2;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4751 if (hp > x_mouse_x)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4752 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4753 mouse_track_left = hp - mouse_track_width;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4754 goto draw_or_not;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4755 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4756 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4757 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4758 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4759 mouse_track_width = 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4760 p++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4761 hp++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4762 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4763 continue;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4764 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4765 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4766 while (hp <= x_mouse_x);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4767
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4768 draw_or_not:
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4769 if (mouse_track_width) /* Over text; use text pointer shape. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4770 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4771 XDefineCursor (FRAME_X_DISPLAY (f),
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
4772 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
4773 f->output_data.x->text_cursor);
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4774 x_rectangle (f, f->output_data.x->cursor_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4775 mouse_track_left, mouse_track_top,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4776 mouse_track_width, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4777 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4778 else if (in_mode_line)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4779 XDefineCursor (FRAME_X_DISPLAY (f),
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
4780 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
4781 f->output_data.x->modeline_cursor);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4782 else
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4783 XDefineCursor (FRAME_X_DISPLAY (f),
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
4784 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
4785 f->output_data.x->nontext_cursor);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4786 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4787
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4788 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4789 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4790
1096
d79192bacdce (Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents: 1050
diff changeset
4791 obj = read_char (-1, 0, 0, Qnil, 0);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4792 BLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4793 }
9103
948e8acb6990 (x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9022
diff changeset
4794 while (CONSP (obj) /* Mouse event */
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
4795 && EQ (Fcar (Fcdr (Fcdr (obj))), Qnil) /* Not scroll bar */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4796 && EQ (Vmouse_depressed, Qnil) /* Only motion events */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4797 && EQ (Vmouse_window, selected_window) /* In this window */
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4798 && x_mouse_frame);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4799
1601
a371ec79bc31 * xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents: 1528
diff changeset
4800 unread_command_event = obj;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4801
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4802 if (mouse_track_width)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4803 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4804 x_rectangle (f, f->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4805 mouse_track_left, mouse_track_top,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4806 mouse_track_width, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4807 mouse_track_width = 0;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4808 if ((mouse_track_left == f->phys_cursor_x
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4809 || mouse_track_left - 1 == f->phys_cursor_x)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4810 && mouse_track_top == f->phys_cursor_y)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4811 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4812 x_display_cursor (f, 1);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4813 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4814 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4815 XDefineCursor (FRAME_X_DISPLAY (f),
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
4816 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
4817 f->output_data.x->nontext_cursor);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4818 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4819 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4820
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4821 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4822 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4823 #endif
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4824
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4825 #if 0
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4826 #include "glyphs.h"
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4827
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4828 /* Draw a pixmap specified by IMAGE_DATA of dimensions WIDTH and HEIGHT
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4829 on the frame F at position X, Y. */
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4830
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4831 x_draw_pixmap (f, x, y, image_data, width, height)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4832 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4833 int x, y, width, height;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4834 char *image_data;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4835 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4836 Pixmap image;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4837
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4838 image = XCreateBitmapFromData (FRAME_X_DISPLAY (f),
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
4839 FRAME_X_WINDOW (f), image_data,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4840 width, height);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4841 XCopyPlane (FRAME_X_DISPLAY (f), image, FRAME_X_WINDOW (f),
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4842 f->output_data.x->normal_gc, 0, 0, width, height, x, y);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4843 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4844 #endif
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4845
4309
c79a44360ed9 (Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents: 4279
diff changeset
4846 #if 0 /* I'm told these functions are superfluous
c79a44360ed9 (Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents: 4279
diff changeset
4847 given the ability to bind function keys. */
c79a44360ed9 (Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents: 4279
diff changeset
4848
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4849 #ifdef HAVE_X11
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4850 DEFUN ("x-rebind-key", Fx_rebind_key, Sx_rebind_key, 3, 3, 0,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4851 "Rebind X keysym KEYSYM, with MODIFIERS, to generate NEWSTRING.\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4852 KEYSYM is a string which conforms to the X keysym definitions found\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4853 in X11/keysymdef.h, sans the initial XK_. MODIFIERS is nil or a\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4854 list of strings specifying modifier keys such as Control_L, which must\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4855 also be depressed for NEWSTRING to appear.")
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4856 (x_keysym, modifiers, newstring)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4857 register Lisp_Object x_keysym;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4858 register Lisp_Object modifiers;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4859 register Lisp_Object newstring;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4860 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4861 char *rawstring;
642
b0ddc138b0b5 *** empty log message ***
Joseph Arceneaux <jla@gnu.org>
parents: 641
diff changeset
4862 register KeySym keysym;
b0ddc138b0b5 *** empty log message ***
Joseph Arceneaux <jla@gnu.org>
parents: 641
diff changeset
4863 KeySym modifier_list[16];
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4864
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
4865 check_x ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4866 CHECK_STRING (x_keysym, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4867 CHECK_STRING (newstring, 3);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4868
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4869 keysym = XStringToKeysym ((char *) XSTRING (x_keysym)->data);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4870 if (keysym == NoSymbol)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4871 error ("Keysym does not exist");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4872
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 436
diff changeset
4873 if (NILP (modifiers))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4874 XRebindKeysym (x_current_display, keysym, modifier_list, 0,
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
4875 XSTRING (newstring)->data,
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
4876 STRING_BYTES (XSTRING (newstring)));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4877 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4878 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4879 register Lisp_Object rest, mod;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4880 register int i = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4881
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 436
diff changeset
4882 for (rest = modifiers; !NILP (rest); rest = Fcdr (rest))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4883 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4884 if (i == 16)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4885 error ("Can't have more than 16 modifiers");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4886
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4887 mod = Fcar (rest);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4888 CHECK_STRING (mod, 3);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4889 modifier_list[i] = XStringToKeysym ((char *) XSTRING (mod)->data);
3692
589aaa4a815b * xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents: 3679
diff changeset
4890 #ifndef HAVE_X11R5
589aaa4a815b * xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents: 3679
diff changeset
4891 if (modifier_list[i] == NoSymbol
589aaa4a815b * xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents: 3679
diff changeset
4892 || !(IsModifierKey (modifier_list[i])
589aaa4a815b * xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents: 3679
diff changeset
4893 || ((unsigned)(modifier_list[i]) == XK_Mode_switch)
589aaa4a815b * xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents: 3679
diff changeset
4894 || ((unsigned)(modifier_list[i]) == XK_Num_Lock)))
589aaa4a815b * xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents: 3679
diff changeset
4895 #else
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4896 if (modifier_list[i] == NoSymbol
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4897 || !IsModifierKey (modifier_list[i]))
3692
589aaa4a815b * xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents: 3679
diff changeset
4898 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4899 error ("Element is not a modifier keysym");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4900 i++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4901 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4902
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4903 XRebindKeysym (x_current_display, keysym, modifier_list, i,
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
4904 XSTRING (newstring)->data,
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
4905 STRING_BYTES (XSTRING (newstring)));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4906 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4907
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4908 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4909 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4910
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4911 DEFUN ("x-rebind-keys", Fx_rebind_keys, Sx_rebind_keys, 2, 2, 0,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4912 "Rebind KEYCODE to list of strings STRINGS.\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4913 STRINGS should be a list of 16 elements, one for each shift combination.\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4914 nil as element means don't change.\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4915 See the documentation of `x-rebind-key' for more information.")
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4916 (keycode, strings)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4917 register Lisp_Object keycode;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4918 register Lisp_Object strings;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4919 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4920 register Lisp_Object item;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4921 register unsigned char *rawstring;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4922 KeySym rawkey, modifier[1];
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4923 int strsize;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4924 register unsigned i;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4925
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
4926 check_x ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4927 CHECK_NUMBER (keycode, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4928 CHECK_CONS (strings, 2);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4929 rawkey = (KeySym) ((unsigned) (XINT (keycode))) & 255;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4930 for (i = 0; i <= 15; strings = Fcdr (strings), i++)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4931 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4932 item = Fcar (strings);
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 436
diff changeset
4933 if (!NILP (item))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4934 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4935 CHECK_STRING (item, 2);
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20629
diff changeset
4936 strsize = STRING_BYTES (XSTRING (item));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4937 rawstring = (unsigned char *) xmalloc (strsize);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4938 bcopy (XSTRING (item)->data, rawstring, strsize);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4939 modifier[1] = 1 << i;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4940 XRebindKeysym (x_current_display, rawkey, modifier, 1,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4941 rawstring, strsize);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4942 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4943 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4944 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4945 }
3141
ffe66ae9bfb3 (Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents: 3134
diff changeset
4946 #endif /* HAVE_X11 */
4309
c79a44360ed9 (Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents: 4279
diff changeset
4947 #endif /* 0 */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4948
4606
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4949 #ifndef HAVE_XSCREENNUMBEROFSCREEN
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4950 int
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4951 XScreenNumberOfScreen (scr)
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4952 register Screen *scr;
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4953 {
4771
d6ddaf79ea6a (XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents: 4696
diff changeset
4954 register Display *dpy;
d6ddaf79ea6a (XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents: 4696
diff changeset
4955 register Screen *dpyscr;
4606
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4956 register int i;
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4957
4771
d6ddaf79ea6a (XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents: 4696
diff changeset
4958 dpy = scr->display;
d6ddaf79ea6a (XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents: 4696
diff changeset
4959 dpyscr = dpy->screens;
d6ddaf79ea6a (XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents: 4696
diff changeset
4960
4606
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4961 for (i = 0; i < dpy->nscreens; i++, dpyscr++)
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4962 if (scr == dpyscr)
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4963 return i;
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4964
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4965 return -1;
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4966 }
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4967 #endif /* not HAVE_XSCREENNUMBEROFSCREEN */
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4968
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4969 Visual *
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4970 select_visual (dpy, screen, depth)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4971 Display *dpy;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4972 Screen *screen;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4973 unsigned int *depth;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4974 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4975 Visual *v;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4976 XVisualInfo *vinfo, vinfo_template;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4977 int n_visuals;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4978
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4979 v = DefaultVisualOfScreen (screen);
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
4980
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
4981 #ifdef HAVE_X11R4
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
4982 vinfo_template.visualid = XVisualIDFromVisual (v);
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
4983 #else
2341
1982e2983822 * xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents: 2328
diff changeset
4984 vinfo_template.visualid = v->visualid;
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
4985 #endif
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
4986
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
4987 vinfo_template.screen = XScreenNumberOfScreen (screen);
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
4988
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4989 vinfo = XGetVisualInfo (dpy,
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
4990 VisualIDMask | VisualScreenMask, &vinfo_template,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4991 &n_visuals);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4992 if (n_visuals != 1)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4993 fatal ("Can't get proper X visual info");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4994
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4995 if ((1 << vinfo->depth) == vinfo->colormap_size)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4996 *depth = vinfo->depth;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4997 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4998 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4999 int i = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5000 int n = vinfo->colormap_size - 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5001 while (n)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5002 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5003 n = n >> 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5004 i++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5005 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5006 *depth = i;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5007 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5008
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5009 XFree ((char *) vinfo);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5010 return v;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5011 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5012
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5013 /* 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
5014 Open a new connection if necessary. */
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5015
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5016 struct x_display_info *
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5017 x_display_info_for_name (name)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5018 Lisp_Object name;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5019 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5020 Lisp_Object names;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5021 struct x_display_info *dpyinfo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5022
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5023 CHECK_STRING (name, 0);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5024
12381
67cb86bbdb55 (Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents: 12347
diff changeset
5025 if (! EQ (Vwindow_system, intern ("x")))
67cb86bbdb55 (Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents: 12347
diff changeset
5026 error ("Not using X Windows");
67cb86bbdb55 (Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents: 12347
diff changeset
5027
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5028 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
5029 dpyinfo;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5030 dpyinfo = dpyinfo->next, names = XCONS (names)->cdr)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5031 {
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5032 Lisp_Object tem;
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5033 tem = Fstring_equal (XCONS (XCONS (names)->car)->car, name);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5034 if (!NILP (tem))
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5035 return dpyinfo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5036 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5037
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
5038 /* 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
5039 Vx_resource_name = Vinvocation_name;
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
5040
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5041 validate_x_resource_name ();
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5042
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5043 dpyinfo = x_term_init (name, (unsigned char *)0,
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
5044 (char *) XSTRING (Vx_resource_name)->data);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5045
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5046 if (dpyinfo == 0)
12046
d23f2c9990b2 (x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents: 12036
diff changeset
5047 error ("Cannot connect to X server %s", XSTRING (name)->data);
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5048
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5049 x_in_use = 1;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5050 XSETFASTINT (Vwindow_system_version, 11);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5051
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5052 return dpyinfo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5053 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5054
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5055 DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5056 1, 3, 0, "Open a connection to an X server.\n\
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5057 DISPLAY is the name of the display to connect to.\n\
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5058 Optional second arg XRM-STRING is a string of resources in xrdb format.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5059 If the optional third arg MUST-SUCCEED is non-nil,\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5060 terminate Emacs if we can't open the connection.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5061 (display, xrm_string, must_succeed)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5062 Lisp_Object display, xrm_string, must_succeed;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5063 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5064 unsigned int n_planes;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5065 unsigned char *xrm_option;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5066 struct x_display_info *dpyinfo;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5067
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5068 CHECK_STRING (display, 0);
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5069 if (! NILP (xrm_string))
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5070 CHECK_STRING (xrm_string, 1);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5071
12381
67cb86bbdb55 (Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents: 12347
diff changeset
5072 if (! EQ (Vwindow_system, intern ("x")))
67cb86bbdb55 (Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents: 12347
diff changeset
5073 error ("Not using X Windows");
67cb86bbdb55 (Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents: 12347
diff changeset
5074
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5075 if (! NILP (xrm_string))
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5076 xrm_option = (unsigned char *) XSTRING (xrm_string)->data;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5077 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5078 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
5079
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5080 validate_x_resource_name ();
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5081
7802
d687e885fa6a (Fx_open_connection): Set up Vx_resource_name and xrm_option
Richard M. Stallman <rms@gnu.org>
parents: 7797
diff changeset
5082 /* 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
5083 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
5084 dpyinfo = x_term_init (display, xrm_option,
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
5085 (char *) XSTRING (Vx_resource_name)->data);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5086
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5087 if (dpyinfo == 0)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5088 {
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5089 if (!NILP (must_succeed))
12046
d23f2c9990b2 (x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents: 12036
diff changeset
5090 fatal ("Cannot connect to X server %s.\n\
d23f2c9990b2 (x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents: 12036
diff changeset
5091 Check the DISPLAY environment variable or use `-d'.\n\
d23f2c9990b2 (x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents: 12036
diff changeset
5092 Also use the `xhost' program to verify that it is set to permit\n\
d23f2c9990b2 (x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents: 12036
diff changeset
5093 connections from your machine.\n",
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5094 XSTRING (display)->data);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5095 else
12046
d23f2c9990b2 (x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents: 12036
diff changeset
5096 error ("Cannot connect to X server %s", XSTRING (display)->data);
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5097 }
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5098
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5099 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
5100
9327
b3398cf56fba (Fx_open_connection): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents: 9285
diff changeset
5101 XSETFASTINT (Vwindow_system_version, 11);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5102 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5103 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5104
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5105 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
5106 Sx_close_connection, 1, 1, 0,
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5107 "Close the connection to DISPLAY's X server.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5108 For DISPLAY, specify either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5109 If DISPLAY is nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5110 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5111 Lisp_Object display;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5112 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5113 struct x_display_info *dpyinfo = check_x_display_info (display);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5114 struct x_display_info *tail;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5115 int i;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5116
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5117 if (dpyinfo->reference_count > 0)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5118 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
5119
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5120 BLOCK_INPUT;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5121 /* Free the fonts in the font table. */
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5122 for (i = 0; i < dpyinfo->n_fonts; i++)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5123 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5124 if (dpyinfo->font_table[i].name)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5125 free (dpyinfo->font_table[i].name);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5126 /* Don't free the full_name string;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5127 it is always shared with something else. */
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5128 XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5129 }
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5130 x_destroy_all_bitmaps (dpyinfo);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5131 XSetCloseDownMode (dpyinfo->display, DestroyAll);
9742
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
5132
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
5133 #ifdef USE_X_TOOLKIT
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
5134 XtCloseDisplay (dpyinfo->display);
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
5135 #else
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5136 XCloseDisplay (dpyinfo->display);
9742
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
5137 #endif
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5138
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5139 x_delete_display (dpyinfo);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5140 UNBLOCK_INPUT;
8782
51241477cfc5 Delete X11 conditionals.
Richard M. Stallman <rms@gnu.org>
parents: 8780
diff changeset
5141
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5142 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5143 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5144
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5145 DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5146 "Return the list of display names that Emacs has connections to.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5147 ()
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5148 {
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5149 Lisp_Object tail, result;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5150
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5151 result = Qnil;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5152 for (tail = x_display_name_list; ! NILP (tail); tail = XCONS (tail)->cdr)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5153 result = Fcons (XCONS (XCONS (tail)->car)->car, result);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5154
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5155 return result;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5156 }
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5157
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5158 DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0,
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5159 "If ON is non-nil, report X errors as soon as the erring request is made.\n\
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5160 If ON is nil, allow buffering of requests.\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5161 Turning on synchronization prohibits the Xlib routines from buffering\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5162 requests and seriously degrades performance, but makes debugging much\n\
10080
2e1987a4de30 (Fx_synchronize): Fix doc string syntax.
Richard M. Stallman <rms@gnu.org>
parents: 9956
diff changeset
5163 easier.\n\
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5164 The optional second argument DISPLAY specifies which display to act on.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5165 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5166 If DISPLAY is omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5167 (on, display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5168 Lisp_Object display, on;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5169 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5170 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5171
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5172 XSynchronize (dpyinfo->display, !EQ (on, Qnil));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5173
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5174 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5175 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5176
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5177 /* 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
5178
f900f7bba4c2 (x_sync): New function.
Richard M. Stallman <rms@gnu.org>
parents: 5429
diff changeset
5179 void
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5180 x_sync (f)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5181 FRAME_PTR f;
5536
f900f7bba4c2 (x_sync): New function.
Richard M. Stallman <rms@gnu.org>
parents: 5429
diff changeset
5182 {
5558
42ec75481b8b (x_sync): Block input.
Richard M. Stallman <rms@gnu.org>
parents: 5536
diff changeset
5183 BLOCK_INPUT;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5184 XSync (FRAME_X_DISPLAY (f), False);
5558
42ec75481b8b (x_sync): Block input.
Richard M. Stallman <rms@gnu.org>
parents: 5536
diff changeset
5185 UNBLOCK_INPUT;
5536
f900f7bba4c2 (x_sync): New function.
Richard M. Stallman <rms@gnu.org>
parents: 5429
diff changeset
5186 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5187
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5188 syms_of_xfns ()
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5189 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5190 /* 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
5191 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
5192
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5193 /* 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
5194 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
5195 /*&&& init symbols here &&&*/
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5196 Qauto_raise = intern ("auto-raise");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5197 staticpro (&Qauto_raise);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5198 Qauto_lower = intern ("auto-lower");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5199 staticpro (&Qauto_lower);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5200 Qbackground_color = intern ("background-color");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5201 staticpro (&Qbackground_color);
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
5202 Qbar = intern ("bar");
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
5203 staticpro (&Qbar);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5204 Qborder_color = intern ("border-color");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5205 staticpro (&Qborder_color);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5206 Qborder_width = intern ("border-width");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5207 staticpro (&Qborder_width);
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
5208 Qbox = intern ("box");
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
5209 staticpro (&Qbox);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5210 Qcursor_color = intern ("cursor-color");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5211 staticpro (&Qcursor_color);
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
5212 Qcursor_type = intern ("cursor-type");
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
5213 staticpro (&Qcursor_type);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5214 Qforeground_color = intern ("foreground-color");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5215 staticpro (&Qforeground_color);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5216 Qgeometry = intern ("geometry");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5217 staticpro (&Qgeometry);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5218 Qicon_left = intern ("icon-left");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5219 staticpro (&Qicon_left);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5220 Qicon_top = intern ("icon-top");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5221 staticpro (&Qicon_top);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5222 Qicon_type = intern ("icon-type");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5223 staticpro (&Qicon_type);
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
5224 Qicon_name = intern ("icon-name");
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
5225 staticpro (&Qicon_name);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5226 Qinternal_border_width = intern ("internal-border-width");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5227 staticpro (&Qinternal_border_width);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5228 Qleft = intern ("left");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5229 staticpro (&Qleft);
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
5230 Qright = intern ("right");
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
5231 staticpro (&Qright);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5232 Qmouse_color = intern ("mouse-color");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5233 staticpro (&Qmouse_color);
1874
19cf50641d6c * frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
5234 Qnone = intern ("none");
19cf50641d6c * frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
5235 staticpro (&Qnone);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5236 Qparent_id = intern ("parent-id");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5237 staticpro (&Qparent_id);
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
5238 Qscroll_bar_width = intern ("scroll-bar-width");
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
5239 staticpro (&Qscroll_bar_width);
2328
82e4fed9cdd6 * xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents: 2295
diff changeset
5240 Qsuppress_icon = intern ("suppress-icon");
82e4fed9cdd6 * xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents: 2295
diff changeset
5241 staticpro (&Qsuppress_icon);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5242 Qtop = intern ("top");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5243 staticpro (&Qtop);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5244 Qundefined_color = intern ("undefined-color");
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5245 staticpro (&Qundefined_color);
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
5246 Qvertical_scroll_bars = intern ("vertical-scroll-bars");
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
5247 staticpro (&Qvertical_scroll_bars);
2294
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
5248 Qvisibility = intern ("visibility");
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
5249 staticpro (&Qvisibility);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5250 Qwindow_id = intern ("window-id");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5251 staticpro (&Qwindow_id);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5252 Qx_frame_parameter = intern ("x-frame-parameter");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5253 staticpro (&Qx_frame_parameter);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
5254 Qx_resource_name = intern ("x-resource-name");
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
5255 staticpro (&Qx_resource_name);
7251
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
5256 Quser_position = intern ("user-position");
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
5257 staticpro (&Quser_position);
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
5258 Quser_size = intern ("user-size");
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
5259 staticpro (&Quser_size);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5260 Qdisplay = intern ("display");
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5261 staticpro (&Qdisplay);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5262 /* 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
5263
18631
62bcc6aff013 (x_set_font): Funcall Qface_set_after_frame_default.
Richard M. Stallman <rms@gnu.org>
parents: 18612
diff changeset
5264 Qface_set_after_frame_default = intern ("face-set-after-frame-default");
62bcc6aff013 (x_set_font): Funcall Qface_set_after_frame_default.
Richard M. Stallman <rms@gnu.org>
parents: 18612
diff changeset
5265 staticpro (&Qface_set_after_frame_default);
62bcc6aff013 (x_set_font): Funcall Qface_set_after_frame_default.
Richard M. Stallman <rms@gnu.org>
parents: 18612
diff changeset
5266
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5267 Fput (Qundefined_color, Qerror_conditions,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5268 Fcons (Qundefined_color, Fcons (Qerror, Qnil)));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5269 Fput (Qundefined_color, Qerror_message,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5270 build_string ("Undefined color"));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5271
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5272 init_x_parm_symbols ();
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5273
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
5274 DEFVAR_LISP ("x-bitmap-file-path", &Vx_bitmap_file_path,
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
5275 "List of directories to search for bitmap files for X.");
12036
035d4ee6cc80 (syms_of_xfns): Allow PATH_BITMAPS to be a colon-separated list.
Karl Heuer <kwzh@gnu.org>
parents: 12019
diff changeset
5276 Vx_bitmap_file_path = decode_env_path ((char *) 0, PATH_BITMAPS);
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
5277
4328
3d43e65a593d (syms_of_xfns): Use DEFVAR_LISP, not DEFVAR_INT, for Vx_pointer_shape.
Roland McGrath <roland@gnu.org>
parents: 4309
diff changeset
5278 DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape,
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5279 "The shape of the pointer when over text.\n\
2936
f9956cdb0d1d (syms_of_xfns): Don't make Lisp vars
Richard M. Stallman <rms@gnu.org>
parents: 2885
diff changeset
5280 Changing the value does not affect existing frames\n\
f9956cdb0d1d (syms_of_xfns): Don't make Lisp vars
Richard M. Stallman <rms@gnu.org>
parents: 2885
diff changeset
5281 unless you set the mouse color.");
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5282 Vx_pointer_shape = Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5283
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5284 DEFVAR_LISP ("x-resource-name", &Vx_resource_name,
16966
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5285 "The name Emacs uses to look up X resources.\n\
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5286 `x-get-resource' uses this as the first component of the instance name\n\
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5287 when requesting resource values.\n\
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5288 Emacs initially sets `x-resource-name' to the name under which Emacs\n\
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5289 was invoked, or to the value specified with the `-name' or `-rn'\n\
16966
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5290 switches, if present.\n\
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5291 \n\
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5292 It may be useful to bind this variable locally around a call\n\
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5293 to `x-get-resource'. See also the variable `x-resource-class'.");
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5294 Vx_resource_name = Qnil;
3170
647229114f47 * xfns.c: Make resource manager work correctly even when
Jim Blandy <jimb@redhat.com>
parents: 3141
diff changeset
5295
16966
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5296 DEFVAR_LISP ("x-resource-class", &Vx_resource_class,
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5297 "The class Emacs uses to look up X resources.\n\
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5298 `x-get-resource' uses this as the first component of the instance class\n\
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5299 when requesting resource values.\n\
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5300 Emacs initially sets `x-resource-class' to \"Emacs\".\n\
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5301 \n\
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5302 Setting this variable permanently is not a reasonable thing to do,\n\
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5303 but binding this variable locally around a call to `x-get-resource'\n\
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5304 is a reasonabvle practice. See also the variable `x-resource-name'.");
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5305 Vx_resource_class = build_string (EMACS_CLASS);
df9f838f255a (Vx_resource_class): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 16732
diff changeset
5306
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5307 #if 0 /* This doesn't really do anything. */
16396
4e4cc27b2a2a (x_set_internal_border_width): Only change
Richard M. Stallman <rms@gnu.org>
parents: 16357
diff changeset
5308 DEFVAR_LISP ("x-nontext-pointer-shape", &Vx_nontext_pointer_shape,
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5309 "The shape of the pointer when not over text.\n\
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5310 This variable takes effect when you create a new frame\n\
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5311 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
5312 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5313 Vx_nontext_pointer_shape = Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5314
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5315 #if 0 /* This doesn't really do anything. */
16396
4e4cc27b2a2a (x_set_internal_border_width): Only change
Richard M. Stallman <rms@gnu.org>
parents: 16357
diff changeset
5316 DEFVAR_LISP ("x-mode-pointer-shape", &Vx_mode_pointer_shape,
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5317 "The shape of the pointer when over the mode line.\n\
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5318 This variable takes effect when you create a new frame\n\
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5319 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
5320 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5321 Vx_mode_pointer_shape = Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5322
16396
4e4cc27b2a2a (x_set_internal_border_width): Only change
Richard M. Stallman <rms@gnu.org>
parents: 16357
diff changeset
5323 DEFVAR_LISP ("x-sensitive-text-pointer-shape",
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5324 &Vx_sensitive_text_pointer_shape,
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5325 "The shape of the pointer when over mouse-sensitive text.\n\
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5326 This variable takes effect when you create a new frame\n\
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5327 or when you set the mouse color.");
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5328 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
5329
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5330 DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5331 "A string indicating the foreground color of the cursor box.");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5332 Vx_cursor_fore_pixel = Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5333
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5334 DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager,
12209
5537ed125771 (syms_of_xfns): Initialize Vx_no_window_manager. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 12190
diff changeset
5335 "Non-nil if no X window manager is in use.\n\
5537ed125771 (syms_of_xfns): Initialize Vx_no_window_manager. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 12190
diff changeset
5336 Emacs doesn't try to figure this out; this is always nil\n\
5537ed125771 (syms_of_xfns): Initialize Vx_no_window_manager. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 12190
diff changeset
5337 unless you set it to something else.");
5537ed125771 (syms_of_xfns): Initialize Vx_no_window_manager. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 12190
diff changeset
5338 /* 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
5339 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
5340 Vx_no_window_manager = Qnil;
8170
d92a24366b22 (x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8103
diff changeset
5341
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5342 DEFVAR_LISP ("x-pixel-size-width-font-regexp",
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5343 &Vx_pixel_size_width_font_regexp,
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5344 "Regexp matching a font name whose width is the same as `PIXEL_SIZE'.\n\
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5345 \n\
17106
5075619fac7a (syms_of_xfns): Documentation of
Kenichi Handa <handa@m17n.org>
parents: 17048
diff changeset
5346 Since Emacs gets width of a font matching with this regexp from\n\
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5347 PIXEL_SIZE field of the name, font finding mechanism gets faster for\n\
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5348 such a font. This is especially effective for such large fonts as\n\
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5349 Chinese, Japanese, and Korean.");
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5350 Vx_pixel_size_width_font_regexp = Qnil;
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5351
8170
d92a24366b22 (x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8103
diff changeset
5352 #ifdef USE_X_TOOLKIT
8192
091cd6243cae (syms_of_xfns): Provide x-toolkit in toolkit version.
Richard M. Stallman <rms@gnu.org>
parents: 8170
diff changeset
5353 Fprovide (intern ("x-toolkit"));
8170
d92a24366b22 (x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8103
diff changeset
5354 #endif
12094
a9fda5417acf (syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents: 12080
diff changeset
5355 #ifdef USE_MOTIF
a9fda5417acf (syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents: 12080
diff changeset
5356 Fprovide (intern ("motif"));
a9fda5417acf (syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents: 12080
diff changeset
5357 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5358
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5359 defsubr (&Sx_get_resource);
689
45401d45581d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 687
diff changeset
5360 #if 0
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5361 defsubr (&Sx_draw_rectangle);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5362 defsubr (&Sx_erase_rectangle);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5363 defsubr (&Sx_contour_region);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5364 defsubr (&Sx_uncontour_region);
689
45401d45581d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 687
diff changeset
5365 #endif
8779
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
5366 defsubr (&Sx_list_fonts);
2277
773e47f29c5a (Fx_display_color_p): Renamed from Fx_color_display_p.
Richard M. Stallman <rms@gnu.org>
parents: 2276
diff changeset
5367 defsubr (&Sx_display_color_p);
8779
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
5368 defsubr (&Sx_display_grayscale_p);
2328
82e4fed9cdd6 * xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents: 2295
diff changeset
5369 defsubr (&Sx_color_defined_p);
8675
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
5370 defsubr (&Sx_color_values);
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
5371 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
5372 defsubr (&Sx_server_vendor);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5373 defsubr (&Sx_server_version);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5374 defsubr (&Sx_display_pixel_width);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5375 defsubr (&Sx_display_pixel_height);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5376 defsubr (&Sx_display_mm_width);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5377 defsubr (&Sx_display_mm_height);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5378 defsubr (&Sx_display_screens);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5379 defsubr (&Sx_display_planes);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5380 defsubr (&Sx_display_color_cells);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5381 defsubr (&Sx_display_visual_class);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5382 defsubr (&Sx_display_backing_store);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5383 defsubr (&Sx_display_save_under);
4309
c79a44360ed9 (Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents: 4279
diff changeset
5384 #if 0
3141
ffe66ae9bfb3 (Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents: 3134
diff changeset
5385 defsubr (&Sx_rebind_key);
ffe66ae9bfb3 (Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents: 3134
diff changeset
5386 defsubr (&Sx_rebind_keys);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5387 defsubr (&Sx_track_pointer);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5388 defsubr (&Sx_grab_pointer);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5389 defsubr (&Sx_ungrab_pointer);
436
6e0a136fca4f *** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents: 398
diff changeset
5390 #endif
2328
82e4fed9cdd6 * xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents: 2295
diff changeset
5391 defsubr (&Sx_parse_geometry);
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
5392 defsubr (&Sx_create_frame);
687
e2b747dd6a6e *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 642
diff changeset
5393 #if 0
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5394 defsubr (&Sx_horizontal_line);
687
e2b747dd6a6e *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 642
diff changeset
5395 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5396 defsubr (&Sx_open_connection);
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5397 defsubr (&Sx_close_connection);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5398 defsubr (&Sx_display_list);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5399 defsubr (&Sx_synchronize);
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5400
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5401 /* Setting callback functions for fontset handler. */
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5402 get_font_info_func = x_get_font_info;
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5403 list_fonts_func = x_list_fonts;
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5404 load_font_func = x_load_font;
21549
3b63301ea296 (syms_of_xfns): Initialize find_ccl_program_func.
Kenichi Handa <handa@m17n.org>
parents: 21536
diff changeset
5405 find_ccl_program_func = x_find_ccl_program;
17048
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5406 query_font_func = x_query_font;
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5407 set_frame_fontset_func = x_set_font;
2da4e24ceee5 Include charset.h and fontset.h.
Karl Heuer <kwzh@gnu.org>
parents: 16966
diff changeset
5408 check_window_system_func = check_x;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5409 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5410
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5411 #endif /* HAVE_X_WINDOWS */