annotate src/xfns.c @ 16740:202689a911b7

(set_point): Use virtual bounds, not real bounds, in the abort test for POSITION. Skip the intangibility test if POSITION is at either end of buffer.
author Richard M. Stallman <rms@gnu.org>
date Fri, 20 Dec 1996 18:15:52 +0000
parents f52c4fd47f03
children df9f838f255a
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.
15079
b11a1ef8c709 Update copyright year.
Richard M. Stallman <rms@gnu.org>
parents: 15071
diff changeset
2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996 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>
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 #ifdef HAVE_X_WINDOWS
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 extern void abort ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43
13781
fc1cf507c51b [X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents: 13751
diff changeset
44 /* On some systems, the character-composition stuff is broken in X11R5. */
fc1cf507c51b [X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents: 13751
diff changeset
45 #if defined (HAVE_X11R5) && ! defined (HAVE_X11R6)
fc1cf507c51b [X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents: 13751
diff changeset
46 #ifdef X11R5_INHIBIT_I18N
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
47 #define X_I18N_INHIBITED
13781
fc1cf507c51b [X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents: 13751
diff changeset
48 #endif
fc1cf507c51b [X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents: 13751
diff changeset
49 #endif
fc1cf507c51b [X11R5_INHIBIT_I18N]: Undef HAVE_X_I18N if X11R5.
Karl Heuer <kwzh@gnu.org>
parents: 13751
diff changeset
50
2355
cec8c9490d8a * xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents: 2341
diff changeset
51 #ifndef VMS
3821
8f353c2491d0 * xfns.c: Always #include "bitmaps/gray.xbm"; the bitmaps seem to
Jim Blandy <jimb@redhat.com>
parents: 3692
diff changeset
52 #if 1 /* Used to be #ifdef EMACS_BITMAP_FILES, but this should always work. */
3512
2657b04dd324 [EMACS_BIT_MAPS]: Include gray.xbm from ./bitmaps.
Richard M. Stallman <rms@gnu.org>
parents: 3507
diff changeset
53 #include "bitmaps/gray.xbm"
2657b04dd324 [EMACS_BIT_MAPS]: Include gray.xbm from ./bitmaps.
Richard M. Stallman <rms@gnu.org>
parents: 3507
diff changeset
54 #else
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
55 #include <X11/bitmaps/gray>
3512
2657b04dd324 [EMACS_BIT_MAPS]: Include gray.xbm from ./bitmaps.
Richard M. Stallman <rms@gnu.org>
parents: 3507
diff changeset
56 #endif
2355
cec8c9490d8a * xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents: 2341
diff changeset
57 #else
cec8c9490d8a * xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents: 2341
diff changeset
58 #include "[.bitmaps]gray.xbm"
cec8c9490d8a * xfns.c [VMS]: Get the gray_bits from [.bitmaps]gray.xbm.
Jim Blandy <jimb@redhat.com>
parents: 2341
diff changeset
59 #endif
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
60
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
61 #ifdef USE_X_TOOLKIT
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
62 #include <X11/Shell.h>
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
63
12616
ca170048a679 [USE_MOTIF]: Don't include X11/Xaw/Paned.h, X11/Xaw/Label.h.
Richard M. Stallman <rms@gnu.org>
parents: 12546
diff changeset
64 #ifndef USE_MOTIF
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
65 #include <X11/Xaw/Paned.h>
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
66 #include <X11/Xaw/Label.h>
12616
ca170048a679 [USE_MOTIF]: Don't include X11/Xaw/Paned.h, X11/Xaw/Label.h.
Richard M. Stallman <rms@gnu.org>
parents: 12546
diff changeset
67 #endif /* USE_MOTIF */
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
68
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
69 #ifdef USG
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
70 #undef USG /* ####KLUDGE for Solaris 2.2 and up */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
71 #include <X11/Xos.h>
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
72 #define USG
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
73 #else
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
74 #include <X11/Xos.h>
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
75 #endif
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
76
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
77 #include "widget.h"
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
78
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
79 #include "../lwlib/lwlib.h"
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
80
13508
b64345cf1ee9 (HACK_EDITRES): Don't define if NO_EDITRES is defined.
Richard M. Stallman <rms@gnu.org>
parents: 13227
diff changeset
81 /* Do the EDITRES protocol if running X11R5
b64345cf1ee9 (HACK_EDITRES): Don't define if NO_EDITRES is defined.
Richard M. Stallman <rms@gnu.org>
parents: 13227
diff changeset
82 Exception: HP-UX (at least version A.09.05) has X11R5 without EditRes */
b64345cf1ee9 (HACK_EDITRES): Don't define if NO_EDITRES is defined.
Richard M. Stallman <rms@gnu.org>
parents: 13227
diff changeset
83 #if (XtSpecificationRelease >= 5) && !defined(NO_EDITRES)
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
84 #define HACK_EDITRES
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
85 extern void _XEditResCheckMessages ();
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
86 #endif /* R5 + Athena */
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
87
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
88 /* Unique id counter for widgets created by the Lucid Widget
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
89 Library. */
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
90 extern LWLIB_ID widget_id_tick;
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
91
15720
f1549b7501af (Fx_create_frame): Do xlwmenu hack only if USE_LUCID.
Karl Heuer <kwzh@gnu.org>
parents: 15706
diff changeset
92 #ifdef USE_LUCID
9742
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
93 /* 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
94 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
95 #endif
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
96
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
97 extern void free_frame_menubar ();
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
98 #endif /* USE_X_TOOLKIT */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
99
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 #define min(a,b) ((a) < (b) ? (a) : (b))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101 #define max(a,b) ((a) > (b) ? (a) : (b))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
103 #ifdef HAVE_X11R4
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
104 #define MAXREQUEST(dpy) (XMaxRequestSize (dpy))
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
105 #else
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
106 #define MAXREQUEST(dpy) ((dpy)->max_request_size)
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
107 #endif
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
108
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
109 /* The name we're using in resource queries. */
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
110 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
111
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112 /* 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
113 over text or in the modeline. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114 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
115 /* The shape when over mouse-sensitive text. */
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
116 Lisp_Object Vx_sensitive_text_pointer_shape;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
118 /* Color of chars displayed in cursor box. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119 Lisp_Object Vx_cursor_fore_pixel;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
121 /* Nonzero if using X. */
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
122 static int x_in_use;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
123
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
124 /* Non nil if no window manager is in use. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125 Lisp_Object Vx_no_window_manager;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
127 /* Search path for bitmap files. */
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
128 Lisp_Object Vx_bitmap_file_path;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
129
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
130 /* 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
131 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
132 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
133 evaluate this expression.
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
134
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
135 (progn
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
136 ;; 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
137 ;; 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
138 (goto-char (point-min))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
139 (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
140 (let (symbol-list)
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
141 (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
142 (setq symbol-list
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
143 (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
144 symbol-list))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
145 (forward-line 1))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
146 (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
147 ;; 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
148 (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
149 (let ((start (point)))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
150 (while (looking-at "^ Q")
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
151 (forward-line 2))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
152 (kill-region start (point)))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
153 ;; 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
154 (while symbol-list
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
155 (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
156 (let ((start (point)))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
157 (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
158 (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
159 (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
160 (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
161
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
162 */
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
163
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
164 /*&&& symbols declared here &&&*/
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
165 Lisp_Object Qauto_raise;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
166 Lisp_Object Qauto_lower;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
167 Lisp_Object Qbackground_color;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
168 Lisp_Object Qbar;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
169 Lisp_Object Qborder_color;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
170 Lisp_Object Qborder_width;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
171 Lisp_Object Qbox;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
172 Lisp_Object Qcursor_color;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
173 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
174 Lisp_Object Qforeground_color;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
175 Lisp_Object Qgeometry;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
176 Lisp_Object Qicon_left;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
177 Lisp_Object Qicon_top;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
178 Lisp_Object Qicon_type;
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
179 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
180 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
181 Lisp_Object Qleft;
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
182 Lisp_Object Qright;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
183 Lisp_Object Qmouse_color;
1874
19cf50641d6c * frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
184 Lisp_Object Qnone;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
185 Lisp_Object Qparent_id;
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
186 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
187 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
188 Lisp_Object Qtop;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
189 Lisp_Object Qundefined_color;
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
190 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
191 Lisp_Object Qvisibility;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
192 Lisp_Object Qwindow_id;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
193 Lisp_Object Qx_frame_parameter;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
194 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
195 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
196 Lisp_Object Quser_size;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
197 Lisp_Object Qdisplay;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
198
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
199 /* 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
200 extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth;
14381
4d038c841cf4 (Qtitle): Declared.
Richard M. Stallman <rms@gnu.org>
parents: 14186
diff changeset
201 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
202
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
203 extern Lisp_Object Vwindow_system_version;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
204
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
205
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
206 /* Error if we are not connected to X. */
5948
ef777779bd80 (check_x): Make it global.
Karl Heuer <kwzh@gnu.org>
parents: 5900
diff changeset
207 void
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
208 check_x ()
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
209 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
210 if (! x_in_use)
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
211 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
212 }
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
213
13867
19a05b5a597d (check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents: 13781
diff changeset
214 /* 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
215 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
216
2b4e4a76468b (using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7683
diff changeset
217 int
13867
19a05b5a597d (check_x_display_info, check_x_frame, x_set_font)
Richard M. Stallman <rms@gnu.org>
parents: 13781
diff changeset
218 have_menus_p ()
7791
2b4e4a76468b (using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7683
diff changeset
219 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
220 return x_in_use;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
221 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
222
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
223 /* 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
224 and checking validity for X. */
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
225
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
226 FRAME_PTR
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
227 check_x_frame (frame)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
228 Lisp_Object frame;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
229 {
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
230 FRAME_PTR f;
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 if (NILP (frame))
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
233 f = selected_frame;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
234 else
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 CHECK_LIVE_FRAME (frame, 0);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
237 f = XFRAME (frame);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
238 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
239 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
240 error ("Non-X frame used");
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
241 return f;
7791
2b4e4a76468b (using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7683
diff changeset
242 }
2b4e4a76468b (using_x_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7683
diff changeset
243
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
244 /* 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
245 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
246 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
247
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
248 static struct x_display_info *
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
249 check_x_display_info (frame)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
250 Lisp_Object frame;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
251 {
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
252 if (NILP (frame))
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
253 {
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
254 if (FRAME_X_P (selected_frame))
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
255 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
256 else if (x_display_list != 0)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
257 return x_display_list;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
258 else
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
259 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
260 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
261 else if (STRINGP (frame))
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
262 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
263 else
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
264 {
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
265 FRAME_PTR f;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
266
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
267 CHECK_LIVE_FRAME (frame, 0);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
268 f = XFRAME (frame);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
269 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
270 error ("Non-X frame used");
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
271 return FRAME_X_DISPLAY_INFO (f);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
272 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
273 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
274
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
275 /* Return the Emacs frame-object corresponding to an X window.
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
276 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
277
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
278 /* 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
279
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
280 struct frame *
11197
1bdc265aab86 (x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11060
diff changeset
281 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
282 struct x_display_info *dpyinfo;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
283 int wdesc;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
284 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
285 Lisp_Object tail, frame;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
286 struct frame *f;
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 for (tail = Vframe_list; GC_CONSP (tail); tail = XCONS (tail)->cdr)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
289 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
290 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
291 if (!GC_FRAMEP (frame))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
292 continue;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
293 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
294 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
295 continue;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
296 #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
297 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
298 && 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
299 || f->output_data.x->icon_desc == wdesc)
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
300 return f;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
301 #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
302 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
303 || f->output_data.x->icon_desc == wdesc)
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
304 return f;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
305 #endif /* not USE_X_TOOLKIT */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
306 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
307 return 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
308 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
309
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
310 #ifdef USE_X_TOOLKIT
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
311 /* 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
312 windows. */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
313
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
314 struct frame *
11197
1bdc265aab86 (x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11060
diff changeset
315 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
316 struct x_display_info *dpyinfo;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
317 int wdesc;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
318 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
319 Lisp_Object tail, frame;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
320 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
321 struct x_output *x;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
322
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
323 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
324 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
325 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
326 if (!GC_FRAMEP (frame))
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
327 continue;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
328 f = XFRAME (frame);
12672
63201a2c1247 Do renamings:
Karl Heuer <kwzh@gnu.org>
parents: 12667
diff changeset
329 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
330 continue;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
331 x = f->output_data.x;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
332 /* 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
333 if (wdesc == XtWindow (x->widget)
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
334 || wdesc == XtWindow (x->column_widget)
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
335 || wdesc == XtWindow (x->edit_widget))
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
336 return f;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
337 /* 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
338 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
339 return f;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
340 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
341 return 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
342 }
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
343
11611
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
344 /* 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
345
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
346 struct frame *
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
347 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
348 struct x_display_info *dpyinfo;
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
349 int wdesc;
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
350 {
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
351 Lisp_Object tail, frame;
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
352 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
353 struct x_output *x;
11611
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
354
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
355 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
356 {
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
357 frame = XCONS (tail)->car;
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
358 if (!GC_FRAMEP (frame))
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
359 continue;
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
360 f = XFRAME (frame);
12672
63201a2c1247 Do renamings:
Karl Heuer <kwzh@gnu.org>
parents: 12667
diff changeset
361 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
362 continue;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
363 x = f->output_data.x;
11611
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
364 /* 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
365 if (wdesc == XtWindow (x->widget)
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
366 || wdesc == XtWindow (x->column_widget)
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
367 || wdesc == XtWindow (x->edit_widget))
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
368 return f;
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
369 }
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
370 return 0;
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
371 }
bf53e9945a3c (x_non_menubar_window_to_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11537
diff changeset
372
12656
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
373 /* 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
374
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
375 struct frame *
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
376 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
377 struct x_display_info *dpyinfo;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
378 int wdesc;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
379 {
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
380 Lisp_Object tail, frame;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
381 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
382 struct x_output *x;
12656
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
383
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
384 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
385 {
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
386 frame = XCONS (tail)->car;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
387 if (!GC_FRAMEP (frame))
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
388 continue;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
389 f = XFRAME (frame);
12672
63201a2c1247 Do renamings:
Karl Heuer <kwzh@gnu.org>
parents: 12667
diff changeset
390 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
391 continue;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
392 x = f->output_data.x;
12656
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
393 /* 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
394 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
395 return f;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
396 }
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
397 return 0;
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
398 }
5beb1d2be5c1 (x_menubar_window_to_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 12616
diff changeset
399
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
400 /* 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
401 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
402
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
403 struct frame *
11197
1bdc265aab86 (x_window_to_frame): New arg DPYINFO. All callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11060
diff changeset
404 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
405 struct x_display_info *dpyinfo;
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
406 int wdesc;
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
407 {
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
408 Lisp_Object tail, frame;
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
409 struct frame *f;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
410 struct x_output *x;
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
411
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
412 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
413 {
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
414 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
415 if (!GC_FRAMEP (frame))
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
416 continue;
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
417 f = XFRAME (frame);
12672
63201a2c1247 Do renamings:
Karl Heuer <kwzh@gnu.org>
parents: 12667
diff changeset
418 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
419 continue;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
420 x = f->output_data.x;
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
421 /* 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
422 if (wdesc == XtWindow (x->widget))
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
423 return f;
12019
63ee64941021 (x_top_window_to_frame): Don't match menu-bar widget.
Karl Heuer <kwzh@gnu.org>
parents: 12011
diff changeset
424 #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
425 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
426 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
427 /* 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
428 if (x->menubar_widget
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
429 && wdesc == XtWindow (x->menubar_widget))
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
430 return f;
12019
63ee64941021 (x_top_window_to_frame): Don't match menu-bar widget.
Karl Heuer <kwzh@gnu.org>
parents: 12011
diff changeset
431 #endif
7040
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
432 }
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
433 return 0;
cd4dd38925f9 (x_window): Test FRAME_EXTERNAL_MENU_BAR
Richard M. Stallman <rms@gnu.org>
parents: 6940
diff changeset
434 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
435 #endif /* USE_X_TOOLKIT */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
436
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
437
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
438
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
439 /* 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
440 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
441 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
442
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
443 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
444 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
445
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
446 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
447 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
448 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
449
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
450
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
451 /* 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
452
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
453 int
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
454 x_bitmap_height (f, id)
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
455 FRAME_PTR f;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
456 int id;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
457 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
458 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
459 }
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
460
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
461 int
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
462 x_bitmap_width (f, id)
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
463 FRAME_PTR f;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
464 int id;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
465 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
466 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
467 }
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
468
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
469 int
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
470 x_bitmap_pixmap (f, id)
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
471 FRAME_PTR f;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
472 int id;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
473 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
474 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
475 }
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
476
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
477
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
478 /* 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
479
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
480 static int
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
481 x_allocate_bitmap_record (f)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
482 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
483 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
484 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
485 int i;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
486
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
487 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
488 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
489 dpyinfo->bitmaps_size = 10;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
490 dpyinfo->bitmaps
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
491 = (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
492 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
493 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
494 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
495
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
496 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
497 return ++dpyinfo->bitmaps_last;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
498
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
499 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
500 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
501 return i + 1;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
502
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
503 dpyinfo->bitmaps_size *= 2;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
504 dpyinfo->bitmaps
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
505 = (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
506 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
507 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
508 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
509
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
510 /* 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
511
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
512 void
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
513 x_reference_bitmap (f, id)
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
514 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
515 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
516 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
517 ++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
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 /* 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
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 int
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
523 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
524 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
525 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
526 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
527 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
528 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
529 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
530 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
531
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
532 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
533 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
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
535 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
536 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
537
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
538 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
539 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
540 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
541 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
542 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
543 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
544 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
545
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
546 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
547 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
548
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
549 /* 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
550
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
551 int
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
552 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
553 struct frame *f;
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
554 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
555 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
556 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
557 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
558 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
559 int xhot, yhot, result, id;
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
560 Lisp_Object found;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
561 int fd;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
562 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
563
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
564 /* 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
565 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
566 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
567 if (dpyinfo->bitmaps[id].refcount
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
568 && dpyinfo->bitmaps[id].file
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
569 && !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
570 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
571 ++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
572 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
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 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
575
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
576 /* Search bitmap-file-path for the file, if appropriate. */
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
577 fd = openp (Vx_bitmap_file_path, file, "", &found, 0);
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
578 if (fd < 0)
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
579 return -1;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
580 close (fd);
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
581
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
582 filename = (char *) XSTRING (found)->data;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
583
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
584 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
585 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
586 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
587 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
588
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
589 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
590 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
591 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
592 dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (XSTRING (file)->size + 1);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
593 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
594 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
595 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
596 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
597
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
598 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
599 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
600
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
601 /* 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
602
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
603 int
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
604 x_destroy_bitmap (f, id)
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
605 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
606 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
607 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
608 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
609
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
610 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
611 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
612 --dpyinfo->bitmaps[id - 1].refcount;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
613 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
614 {
12051
f193ce9efe24 (x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents: 12046
diff changeset
615 BLOCK_INPUT;
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
616 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
617 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
618 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
619 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
620 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
621 }
12051
f193ce9efe24 (x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents: 12046
diff changeset
622 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
623 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
624 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
625 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
626
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
627 /* 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
628
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
629 static void
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
630 x_destroy_all_bitmaps (dpyinfo)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
631 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
632 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
633 int i;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
634 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
635 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
636 {
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
637 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
638 if (dpyinfo->bitmaps[i].file)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
639 free (dpyinfo->bitmaps[i].file);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
640 }
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
641 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
642 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
643
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
644 /* Connect the frame-parameter names for X frames
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
645 to the ways of passing the parameter values to the window system.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
646
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
647 The name of a parameter, as a Lisp symbol,
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
648 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
649 that is an index in this table. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
650
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
651 struct x_frame_parm_table
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
652 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
653 char *name;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
654 void (*setter)( /* struct frame *frame, Lisp_Object val, oldval */ );
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
655 };
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
656
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
657 void x_set_foreground_color ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
658 void x_set_background_color ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
659 void x_set_mouse_color ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
660 void x_set_cursor_color ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
661 void x_set_border_color ();
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
662 void x_set_cursor_type ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
663 void x_set_icon_type ();
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
664 void x_set_icon_name ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
665 void x_set_font ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
666 void x_set_border_width ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
667 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
668 void x_explicitly_set_name ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
669 void x_set_autoraise ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
670 void x_set_autolower ();
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
671 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
672 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
673 void x_set_menu_bar_lines ();
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
674 void x_set_scroll_bar_width ();
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
675 void x_set_title ();
9580
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
676 void x_set_unsplittable ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
677
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
678 static struct x_frame_parm_table x_frame_parms[] =
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
679 {
1874
19cf50641d6c * frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
680 "auto-raise", x_set_autoraise,
19cf50641d6c * frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
681 "auto-lower", x_set_autolower,
14439
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
682 "background-color", x_set_background_color,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
683 "border-color", x_set_border_color,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
684 "border-width", x_set_border_width,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
685 "cursor-color", x_set_cursor_color,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
686 "cursor-type", x_set_cursor_type,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
687 "font", x_set_font,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
688 "foreground-color", x_set_foreground_color,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
689 "icon-name", x_set_icon_name,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
690 "icon-type", x_set_icon_type,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
691 "internal-border-width", x_set_internal_border_width,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
692 "menu-bar-lines", x_set_menu_bar_lines,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
693 "mouse-color", x_set_mouse_color,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
694 "name", x_explicitly_set_name,
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
695 "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
696 "title", x_set_title,
14439
201ccc109ce7 (x_frame_parms): Alphabetize.
Richard M. Stallman <rms@gnu.org>
parents: 14381
diff changeset
697 "unsplittable", x_set_unsplittable,
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
698 "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
699 "visibility", x_set_visibility,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
700 };
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
701
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
702 /* Attach the `x-frame-parameter' properties to
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
703 the Lisp symbol names of parameters relevant to X. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
704
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
705 init_x_parm_symbols ()
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
706 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
707 int i;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
708
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
709 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
710 Fput (intern (x_frame_parms[i].name), Qx_frame_parameter,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
711 make_number (i));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
712 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
713
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
714 /* Change the parameters of FRAME as specified by ALIST.
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
715 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
716 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
717
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
718 void
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
719 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
720 FRAME_PTR f;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
721 Lisp_Object alist;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
722 {
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
723 Lisp_Object tail;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
724
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
725 /* 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
726 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
727 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
728 int width, height;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
729
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
730 /* Same here. */
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
731 Lisp_Object left, top;
3203
1055aa1b7547 * xfns.c (x_set_frame_parameters): Use the first
Jim Blandy <jimb@redhat.com>
parents: 3173
diff changeset
732
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
733 /* Same with these. */
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
734 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
735
3447
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
736 /* 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
737 Lisp_Object *parms;
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
738 Lisp_Object *values;
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
739 int i;
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
740 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
741 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
742
3447
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
743 i = 0;
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
744 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
745 i++;
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
746
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
747 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
748 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
749
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
750 /* 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
751
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
752 i = 0;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
753 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
754 {
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
755 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
756
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
757 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
758 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
759 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
760 i++;
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
761 }
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
762
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
763 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
764 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
765
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
766 /* 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
767 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
768 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
769 else
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
770 width = FRAME_WIDTH (f);
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
771
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
772 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
773 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
774 else
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
775 height = FRAME_HEIGHT (f);
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
776
3447
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
777 /* 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
778 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
779 {
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
780 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
781
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
782 prop = parms[i];
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
783 val = values[i];
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
784
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
785 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
786 width = XFASTINT (val);
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
787 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
788 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
789 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
790 top = val;
3447
ed2a17aac4cd (x_set_frame_parameters): Process all parms in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 3446
diff changeset
791 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
792 left = val;
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
793 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
794 icon_top = val;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
795 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
796 icon_left = val;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
797 else
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
798 {
6519
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
799 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
800
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
801 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
802 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
803 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
804 if (NATNUMP (param_index)
cc76b76a1ed1 (CHECK_NATNUM): Use NATNUMP instead of its expansion.
Karl Heuer <kwzh@gnu.org>
parents: 9948
diff changeset
805 && (XFASTINT (param_index)
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
806 < 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
807 (*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
808 }
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
809 }
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
810
4617
807ba8bcc309 (x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents: 4606
diff changeset
811 /* 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
812 if (EQ (left, Qunbound))
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
813 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
814 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
815 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
816 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
817 else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
818 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
819 }
4617
807ba8bcc309 (x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents: 4606
diff changeset
820 if (EQ (top, Qunbound))
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
821 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
822 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
823 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
824 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
825 else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
826 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
827 }
4617
807ba8bcc309 (x_set_frame_parameters): Don't die if just one of
Richard M. Stallman <rms@gnu.org>
parents: 4606
diff changeset
828
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
829 /* 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
830 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
831 {
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
832 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
833 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
834 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
835 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
836 }
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
837 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
838 {
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
839 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
840 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
841 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
842 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
843 }
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
844
11932
f3fb1e5dfde1 (x_set_frame_parameters) Fix typo.
Karl Heuer <kwzh@gnu.org>
parents: 11917
diff changeset
845 /* 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
846 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
847 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
848 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
849
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
850 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
851 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
852 yet. */
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
853 {
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
854 Lisp_Object frame;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
855
5107
2a019dd8ed51 (x_set_frame_parameters): Call check_frame_size
Richard M. Stallman <rms@gnu.org>
parents: 4771
diff changeset
856 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
857
9285
75f1c0d90b3d (x_set_frame_parameters, x_set_visibility, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9240
diff changeset
858 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
859
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
860 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
861 || 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
862 || 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
863 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
864
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
865 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
866 && ! (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
867 && ! (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
868 && 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
869 {
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
870 int leftpos = 0;
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
871 int toppos = 0;
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
872
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
873 /* 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
874 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
875 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
876 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
877 else if (INTEGERP (left))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
878 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
879 leftpos = XINT (left);
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
880 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
881 f->output_data.x->size_hint_flags |= XNegative;
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
882 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
883 else if (CONSP (left) && EQ (XCONS (left)->car, Qminus)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
884 && CONSP (XCONS (left)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
885 && INTEGERP (XCONS (XCONS (left)->cdr)->car))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
886 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
887 leftpos = - XINT (XCONS (XCONS (left)->cdr)->car);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
888 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
889 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
890 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
891 && CONSP (XCONS (left)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
892 && 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
893 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
894 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
895 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
896
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
897 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
898 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
899 else if (INTEGERP (top))
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 toppos = XINT (top);
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
902 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
903 f->output_data.x->size_hint_flags |= YNegative;
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
904 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
905 else if (CONSP (top) && EQ (XCONS (top)->car, Qminus)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
906 && CONSP (XCONS (top)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
907 && INTEGERP (XCONS (XCONS (top)->cdr)->car))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
908 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
909 toppos = - XINT (XCONS (XCONS (top)->cdr)->car);
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
910 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
911 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
912 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
913 && CONSP (XCONS (top)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
914 && 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
915 {
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
916 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
917 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
918
8090
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
919
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
920 /* 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
921 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
922 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
923
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
924 f->output_data.x->win_gravity = NorthWestGravity;
8090
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
925
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
926 /* 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
927 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
928 }
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
929
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
930 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
931 && ! (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
932 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
933 }
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
934 }
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
935
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
936 /* 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
937 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
938 not Emacs's own window. */
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
939
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
940 void
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
941 x_real_positions (f, xptr, yptr)
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
942 FRAME_PTR f;
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
943 int *xptr, *yptr;
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
944 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
945 int win_x, win_y;
7408
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
946 Window child;
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
947
7946
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
948 /* 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
949 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
950
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
951 #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
952 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
953 #else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
954 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
955 #endif
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
956 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
957 Window *tmp_children;
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
958 int tmp_nchildren;
4dbba88e2717 (x_real_positions): Make sure we know the parent window.
Richard M. Stallman <rms@gnu.org>
parents: 7899
diff changeset
959
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
960 while (1)
7408
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
961 {
12111
832023e90d4d (x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents: 12094
diff changeset
962 x_catch_errors (FRAME_X_DISPLAY (f));
832023e90d4d (x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents: 12094
diff changeset
963
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
964 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
965 &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
966 &tmp_children, &tmp_nchildren);
14563
6aa8b322b4d7 (x_real_positions): Cast arg of XFree.
Karl Heuer <kwzh@gnu.org>
parents: 14530
diff changeset
967 XFree ((char *) tmp_children);
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
968
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
969 win_x = win_y = 0;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
970
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
971 /* 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
972 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
973 if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window)
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
974 {
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
975 XTranslateCoordinates (FRAME_X_DISPLAY (f),
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
976
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
977 /* From-window, to-window. */
7408
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
978 #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
979 XtWindow (f->output_data.x->widget),
7408
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
980 #else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
981 f->output_data.x->window_desc,
7408
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
982 #endif
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
983 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
984
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
985 /* From-position, to-position. */
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
986 0, 0, &win_x, &win_y,
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
987
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
988 /* Child of win. */
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
989 &child);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
990
11900
54186a96c5b2 (x_set_frame_parameters): Pass 1 as change_gravity
Karl Heuer <kwzh@gnu.org>
parents: 11897
diff changeset
991 #if 0 /* The values seem to be right without this and wrong with. */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
992 win_x += f->output_data.x->border_width;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
993 win_y += f->output_data.x->border_width;
11900
54186a96c5b2 (x_set_frame_parameters): Pass 1 as change_gravity
Karl Heuer <kwzh@gnu.org>
parents: 11897
diff changeset
994 #endif
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
995 }
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
996
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
997 /* 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
998 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
999 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
1000 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
1001 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
1002 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
1003 {
94467271b641 (x_real_positions): Don't call x_uncatch_errors twice.
Richard M. Stallman <rms@gnu.org>
parents: 15081
diff changeset
1004 x_uncatch_errors (FRAME_X_DISPLAY (f));
94467271b641 (x_real_positions): Don't call x_uncatch_errors twice.
Richard M. Stallman <rms@gnu.org>
parents: 15081
diff changeset
1005 break;
94467271b641 (x_real_positions): Don't call x_uncatch_errors twice.
Richard M. Stallman <rms@gnu.org>
parents: 15081
diff changeset
1006 }
12111
832023e90d4d (x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents: 12094
diff changeset
1007
832023e90d4d (x_real_positions): Uncatch and recatch X errors in the loop.
Karl Heuer <kwzh@gnu.org>
parents: 12094
diff changeset
1008 x_uncatch_errors (FRAME_X_DISPLAY (f));
7408
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
1009 }
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
1010
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1011 *xptr = f->output_data.x->left_pos - win_x;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1012 *yptr = f->output_data.x->top_pos - win_y;
7408
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
1013 }
65c133b66371 (x_real_positions): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7308
diff changeset
1014
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1015 /* Insert a description of internally-recorded parameters of frame X
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1016 into the parameter alist *ALISTPTR that is to be given to the user.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1017 Only parameters that are specific to the X window system
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1018 and whose values are not correctly recorded in the frame's
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1019 param_alist need to be considered here. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1020
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1021 x_report_frame_params (f, alistptr)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1022 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1023 Lisp_Object *alistptr;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1024 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1025 char buf[16];
11986
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1026 Lisp_Object tem;
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1027
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1028 /* 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
1029 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
1030 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
1031 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
1032 store_in_alist (alistptr, Qleft, tem);
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1033 else
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1034 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
1035
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->top_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->top_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, Qtop, 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, Qtop, Fcons (Qplus, Fcons (tem, Qnil)));
bfdf35b8c34b (x_report_frame_params): Report top and left
Karl Heuer <kwzh@gnu.org>
parents: 11962
diff changeset
1041
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
1042 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
1043 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
1044 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
1045 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
1046 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
1047 store_in_alist (alistptr, Qwindow_id,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1048 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
1049 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
1050 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
1051 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
1052 (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
1053 : 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
1054 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
1055 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
1056
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
1057 store_in_alist (alistptr, Qparent_id,
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
1058 (f->output_data.x->parent_desc == FRAME_X_DISPLAY_INFO (f)->root_window
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
1059 ? Qnil : f->output_data.x->parent_desc));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1060 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1061
10920
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1062
8675
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
1063 /* 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
1064 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
1065 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
1066
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1067 int
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1068 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
1069 FRAME_PTR f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1070 char *color;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1071 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
1072 int alloc;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1073 {
10920
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1074 register int status;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1075 Colormap screen_colormap;
10920
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1076 Display *display = FRAME_X_DISPLAY (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1077
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1078 BLOCK_INPUT;
10920
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1079 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
1080
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1081 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
1082 if (status && alloc)
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1083 {
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1084 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
1085 if (!status)
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1086 {
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1087 /* 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
1088 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
1089 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
1090 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
1091
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1092 XColor *cells;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1093 int no_cells;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1094 int nearest;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1095 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
1096 int x;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1097
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1098 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
1099 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
1100
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1101 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
1102 cells[x].pixel = x;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1103
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1104 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
1105 nearest = 0;
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1106 /* 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
1107 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
1108 * ((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
1109 +
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1110 (((color_def->green >> 8) - (cells[0].green >> 8))
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1111 * ((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
1112 +
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1113 (((color_def->blue >> 8) - (cells[0].blue >> 8))
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1114 * ((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
1115 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
1116 {
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1117 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
1118 * ((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
1119 +
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1120 (((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
1121 * ((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
1122 +
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1123 (((color_def->blue >> 8) - (cells[x].blue >> 8))
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1124 * ((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
1125 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
1126 {
14615
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1127 XColor temp;
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1128 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
1129 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
1130 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
1131 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
1132 if (status)
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1133 {
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1134 nearest = x;
1bbe2716bcea (defined_color): When we find a "near" color in the map,
Karl Heuer <kwzh@gnu.org>
parents: 14595
diff changeset
1135 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
1136 }
10920
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1137 }
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1138 }
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1139 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
1140 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
1141 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
1142 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
1143 }
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1144 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1145 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1146
10920
bb3f9aaf0e46 (defined_color): If colormap is full, find closest match.
Richard M. Stallman <rms@gnu.org>
parents: 10742
diff changeset
1147 if (status)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1148 return 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1149 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1150 return 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1151 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1152
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1153 /* 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
1154 suitable for screen F.
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1155 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
1156 ARG says. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1157
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1158 int
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1159 x_decode_color (f, arg, def)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1160 FRAME_PTR f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1161 Lisp_Object arg;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1162 int def;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1163 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1164 XColor cdef;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1165
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1166 CHECK_STRING (arg, 0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1167
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1168 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
1169 return BLACK_PIX_DEFAULT (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1170 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
1171 return WHITE_PIX_DEFAULT (f);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1172
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1173 if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1174 return def;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1175
11060
0a7048d331e6 (x_decode_color): Don't use cdef if defined_color failed.
Richard M. Stallman <rms@gnu.org>
parents: 11014
diff changeset
1176 /* 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
1177 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
1178 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
1179 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
1180
13083
16638ebb209f (Fx_create_frame): Set up buffer-predicate slot.
Richard M. Stallman <rms@gnu.org>
parents: 12832
diff changeset
1181 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
1182 Fcons (arg, Qnil)));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1183 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1184
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1185 /* Functions called only from `x_set_frame_param'
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1186 to set individual parameters.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1187
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
1188 If FRAME_X_WINDOW (f) is 0,
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1189 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
1190 In that case, just record the parameter's new value
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1191 in the standard place; do not attempt to change the window. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1192
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1193 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1194 x_set_foreground_color (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1195 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1196 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1197 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1198 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
1199 = 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
1200 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1201 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1202 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
1203 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
1204 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
1205 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
1206 f->output_data.x->foreground_pixel);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1207 UNBLOCK_INPUT;
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1208 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
1209 if (FRAME_VISIBLE_P (f))
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1210 redraw_frame (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1211 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1212 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1213
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1214 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1215 x_set_background_color (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1216 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1217 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1218 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1219 Pixmap temp;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1220 int mask;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1221
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1222 f->output_data.x->background_pixel
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1223 = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f));
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1224
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
1225 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1226 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1227 BLOCK_INPUT;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1228 /* 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
1229 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
1230 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
1231 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
1232 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
1233 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
1234 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
1235 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
1236 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
1237 {
880fcef68f73 (x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents: 7525
diff changeset
1238 Lisp_Object bar;
880fcef68f73 (x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents: 7525
diff changeset
1239 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
1240 bar = XSCROLL_BAR (bar)->next)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1241 XSetWindowBackground (FRAME_X_DISPLAY (f),
7599
880fcef68f73 (x_set_background_color): Set scroll bar backgrounds.
Karl Heuer <kwzh@gnu.org>
parents: 7525
diff changeset
1242 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
1243 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
1244 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1245 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1246
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1247 recompute_basic_faces (f);
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1248
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1249 if (FRAME_VISIBLE_P (f))
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1250 redraw_frame (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1251 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1252 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1253
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1254 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1255 x_set_mouse_color (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1256 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1257 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1258 {
6759
e0938c42218c (syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6610
diff changeset
1259 Cursor cursor, nontext_cursor, mode_cursor, cross_cursor;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1260 int mask_color;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1261
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1262 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
1263 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
1264 = 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
1265 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
1266 /* 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
1267 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
1268 && 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
1269 f->output_data.x->mouse_pixel = f->output_data.x->foreground_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1270
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1271 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
1272
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 3512
diff changeset
1273 /* It's not okay to crash if the user selects a screwy cursor. */
9703
85ac0e4030d4 (x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents: 9690
diff changeset
1274 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
1275
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1276 if (!EQ (Qnil, Vx_pointer_shape))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1277 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1278 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
1279 cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XINT (Vx_pointer_shape));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1280 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1281 else
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1282 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
1283 x_check_errors (FRAME_X_DISPLAY (f), "bad text pointer cursor: %s");
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1284
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1285 if (!EQ (Qnil, Vx_nontext_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_nontext_pointer_shape, 0);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1288 nontext_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1289 XINT (Vx_nontext_pointer_shape));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1290 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1291 else
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1292 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
1293 x_check_errors (FRAME_X_DISPLAY (f), "bad nontext pointer cursor: %s");
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1294
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1295 if (!EQ (Qnil, Vx_mode_pointer_shape))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1296 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1297 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
1298 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
1299 XINT (Vx_mode_pointer_shape));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1300 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1301 else
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1302 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
1303 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
1304
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
1305 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
1306 {
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
1307 CHECK_NUMBER (Vx_sensitive_text_pointer_shape, 0);
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
1308 cross_cursor
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1309 = XCreateFontCursor (FRAME_X_DISPLAY (f),
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
1310 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
1311 }
e0938c42218c (syms_of_xfns): Define Vx_cross_pointer_shape.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6610
diff changeset
1312 else
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1313 cross_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_crosshair);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1314
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
1315 /* 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
1316 x_check_errors (FRAME_X_DISPLAY (f), "can't set cursor shape: %s");
85ac0e4030d4 (x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents: 9690
diff changeset
1317 x_uncatch_errors (FRAME_X_DISPLAY (f));
1050
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
1318
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1319 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1320 XColor fore_color, back_color;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1321
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1322 fore_color.pixel = f->output_data.x->mouse_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1323 back_color.pixel = mask_color;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1324 XQueryColor (FRAME_X_DISPLAY (f),
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1325 DefaultColormap (FRAME_X_DISPLAY (f),
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1326 DefaultScreen (FRAME_X_DISPLAY (f))),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1327 &fore_color);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1328 XQueryColor (FRAME_X_DISPLAY (f),
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1329 DefaultColormap (FRAME_X_DISPLAY (f),
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1330 DefaultScreen (FRAME_X_DISPLAY (f))),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1331 &back_color);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1332 XRecolorCursor (FRAME_X_DISPLAY (f), cursor,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1333 &fore_color, &back_color);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1334 XRecolorCursor (FRAME_X_DISPLAY (f), nontext_cursor,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1335 &fore_color, &back_color);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1336 XRecolorCursor (FRAME_X_DISPLAY (f), mode_cursor,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1337 &fore_color, &back_color);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1338 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
1339 &fore_color, &back_color);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1340 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1341
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
1342 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1343 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1344 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1345 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1346
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1347 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
1348 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
1349 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
1350
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1351 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
1352 && 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
1353 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
1354 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
1355
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1356 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
1357 && 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
1358 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
1359 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
1360 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
1361 && 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
1362 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
1363 f->output_data.x->cross_cursor = cross_cursor;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1364
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1365 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1366 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1367 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1368
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1369 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1370 x_set_cursor_color (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1371 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1372 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1373 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1374 unsigned long fore_pixel;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1375
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1376 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
1377 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
1378 WHITE_PIX_DEFAULT (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1379 else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1380 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
1381 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
1382
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
1383 /* 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
1384 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
1385 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1386 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
1387 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
1388 fore_pixel = f->output_data.x->background_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1389 }
12667
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_foreground_pixel = fore_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1391
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
1392 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1393 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1394 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
1395 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
1396 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
1397 XSetForeground (FRAME_X_DISPLAY (f), f->output_data.x->cursor_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1398 fore_pixel);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1399 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1400
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1401 if (FRAME_VISIBLE_P (f))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1402 {
15999
0e148af7d4ec (x_set_cursor_color): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents: 15942
diff changeset
1403 x_update_cursor (f, 0);
0e148af7d4ec (x_set_cursor_color): Use x_update_cursor.
Richard M. Stallman <rms@gnu.org>
parents: 15942
diff changeset
1404 x_update_cursor (f, 1);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1405 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1406 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1407 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1408
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1409 /* Set the border-color of frame F to value described by ARG.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1410 ARG can be a string naming a color.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1411 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
1412 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
1413 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
1414
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1415 Note: this is done in two routines because of the way X10 works.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1416
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1417 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
1418 and so emacs' border colors may be overridden. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1419
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1420 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1421 x_set_border_color (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1422 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1423 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1424 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1425 unsigned char *str;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1426 int pix;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1427
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1428 CHECK_STRING (arg, 0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1429 str = XSTRING (arg)->data;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1430
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1431 pix = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1432
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1433 x_set_border_pixel (f, pix);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1434 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1435
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1436 /* Set the border-color of frame F to pixel value PIX.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1437 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
1438 F has an x-window. */
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1439
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1440 x_set_border_pixel (f, pix)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1441 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1442 int pix;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1443 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1444 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
1445
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1446 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
1447 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1448 Pixmap temp;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1449 int mask;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1450
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1451 BLOCK_INPUT;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1452 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
1453 (unsigned long)pix);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1454 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1455
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1456 if (FRAME_VISIBLE_P (f))
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1457 redraw_frame (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1458 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1459 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1460
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1461 void
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1462 x_set_cursor_type (f, arg, oldval)
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1463 FRAME_PTR f;
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1464 Lisp_Object arg, oldval;
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1465 {
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1466 if (EQ (arg, Qbar))
10742
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1467 {
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1468 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
1469 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
1470 }
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1471 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
1472 && INTEGERP (XCONS (arg)->cdr))
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1473 {
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1474 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
1475 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
1476 }
3134
efdaaa695ad4 (x_set_cursor_type): If arg not recognized, use box cursor.
Richard M. Stallman <rms@gnu.org>
parents: 3108
diff changeset
1477 else
10742
e4d6f6f1fc17 (x_set_cursor_type): Set cursor_width field.
Richard M. Stallman <rms@gnu.org>
parents: 10717
diff changeset
1478 /* 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
1479 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
1480 .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
1481 FRAME_DESIRED_CURSOR (f) = filled_box_cursor;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1482
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1483 /* 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
1484 often do people change cursor types? */
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1485 update_mode_lines++;
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1486 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1487
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
1488 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1489 x_set_icon_type (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1490 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1491 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1492 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1493 Lisp_Object tem;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1494 int result;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1495
9543
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
1496 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
1497 {
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
1498 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
1499 return;
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
1500 }
3cf8aa53c4cf (x_set_icon_type): If icon-type is a string, then use
Richard M. Stallman <rms@gnu.org>
parents: 9528
diff changeset
1501 else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1502 return;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1503
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1504 BLOCK_INPUT;
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 436
diff changeset
1505 if (NILP (arg))
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1506 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
1507 (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
1508 ? f->icon_name
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1509 : f->name))->data);
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1510 else
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1511 result = x_bitmap_icon (f, arg);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1512
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1513 if (result)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1514 {
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
1515 UNBLOCK_INPUT;
9353
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1516 error ("No icon window available");
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1517 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1518
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1519 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1520 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1521 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1522
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1523 /* Return non-nil if frame F wants a bitmap icon. */
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1524
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1525 Lisp_Object
9353
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1526 x_icon_type (f)
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1527 FRAME_PTR f;
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1528 {
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1529 Lisp_Object tem;
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1530
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1531 tem = assq_no_quit (Qicon_type, f->param_alist);
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1532 if (CONSP (tem))
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1533 return XCONS (tem)->cdr;
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1534 else
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
1535 return Qnil;
9353
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1536 }
30659ed71a1b (x_set_icon_type): Remove period from error message.
Richard M. Stallman <rms@gnu.org>
parents: 9329
diff changeset
1537
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1538 void
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1539 x_set_icon_name (f, arg, oldval)
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1540 struct frame *f;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1541 Lisp_Object arg, oldval;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1542 {
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1543 Lisp_Object tem;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1544 int result;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1545
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1546 if (STRINGP (arg))
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1547 {
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1548 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt))
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1549 return;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1550 }
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1551 else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil))
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1552 return;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1553
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
1554 f->icon_name = arg;
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1555
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1556 if (f->output_data.x->icon_bitmap != 0)
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1557 return;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1558
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1559 BLOCK_INPUT;
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 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
1562 (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
1563 ? f->icon_name
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1564 : !NILP (f->title)
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1565 ? f->title
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1566 : f->name))->data);
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1567
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1568 if (result)
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1569 {
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1570 UNBLOCK_INPUT;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1571 error ("No icon window available");
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1572 }
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1573
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1574 XFlush (FRAME_X_DISPLAY (f));
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1575 UNBLOCK_INPUT;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1576 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1577
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1578 extern Lisp_Object x_new_font ();
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1579
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1580 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1581 x_set_font (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1582 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1583 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1584 {
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1585 Lisp_Object result;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1586
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1587 CHECK_STRING (arg, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1588
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1589 BLOCK_INPUT;
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1590 result = x_new_font (f, XSTRING (arg)->data);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1591 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1592
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1593 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
1594 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
1595 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
1596 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
1597 else if (STRINGP (result))
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1598 {
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1599 recompute_basic_faces (f);
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1600 store_frame_param (f, Qfont, result);
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1601 }
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1602 else
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
1603 abort ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1604 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1605
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1606 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1607 x_set_border_width (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1608 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1609 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1610 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1611 CHECK_NUMBER (arg, 0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1612
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1613 if (XINT (arg) == f->output_data.x->border_width)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1614 return;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1615
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
1616 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1617 error ("Cannot change the border width of a window");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1618
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1619 f->output_data.x->border_width = XINT (arg);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1620 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1621
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1622 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1623 x_set_internal_border_width (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1624 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1625 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1626 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1627 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
1628 int old = f->output_data.x->internal_border_width;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1629
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1630 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
1631 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
1632 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
1633 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
1634
16396
4e4cc27b2a2a (x_set_internal_border_width): Only change
Richard M. Stallman <rms@gnu.org>
parents: 16357
diff changeset
1635 #ifdef USE_X_TOOLKIT
16351
ac552926fc7e (x_set_internal_border_width, Fx_create_frame):
Richard M. Stallman <rms@gnu.org>
parents: 16305
diff changeset
1636 if (f->output_data.x->edit_widget)
ac552926fc7e (x_set_internal_border_width, Fx_create_frame):
Richard M. Stallman <rms@gnu.org>
parents: 16305
diff changeset
1637 widget_store_internal_border (f->output_data.x->edit_widget,
ac552926fc7e (x_set_internal_border_width, Fx_create_frame):
Richard M. Stallman <rms@gnu.org>
parents: 16305
diff changeset
1638 f->output_data.x->internal_border_width);
16396
4e4cc27b2a2a (x_set_internal_border_width): Only change
Richard M. Stallman <rms@gnu.org>
parents: 16357
diff changeset
1639 #endif
16351
ac552926fc7e (x_set_internal_border_width, Fx_create_frame):
Richard M. Stallman <rms@gnu.org>
parents: 16305
diff changeset
1640
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1641 if (f->output_data.x->internal_border_width == old)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1642 return;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1643
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
1644 if (FRAME_X_WINDOW (f) != 0)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1645 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1646 BLOCK_INPUT;
5899
4e8f26a0f2b7 *** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 5721
diff changeset
1647 x_set_window_size (f, 0, f->width, f->height);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1648 #if 0
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1649 x_set_resize_hint (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1650 #endif
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1651 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1652 UNBLOCK_INPUT;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1653 SET_FRAME_GARBAGED (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1654 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1655 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1656
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1657 void
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1658 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
1659 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
1660 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
1661 {
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1662 Lisp_Object frame;
9285
75f1c0d90b3d (x_set_frame_parameters, x_set_visibility, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9240
diff changeset
1663 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
1664
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1665 if (NILP (value))
5899
4e8f26a0f2b7 *** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 5721
diff changeset
1666 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
1667 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
1668 Ficonify_frame (frame);
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
1669 else
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1670 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
1671 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1672
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1673 static void
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1674 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
1675 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
1676 int n;
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1677 {
3477
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1678 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
1679
9329
4e1048594e7f (x_set_menu_bar_lines_1): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents: 9327
diff changeset
1680 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
1681 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
1682
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1683 /* 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
1684 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
1685 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
1686
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1687 /* 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
1688 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
1689 {
3477
c079a2d6cf0e (x_set_menu_bar_lines_1): Adjust just the uppermost child
Richard M. Stallman <rms@gnu.org>
parents: 3447
diff changeset
1690 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
1691 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
1692 }
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1693 }
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1694
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1695 void
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1696 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
1697 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
1698 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
1699 {
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1700 int nlines;
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1701 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
1702
2880
9a78169e44df * xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents: 2842
diff changeset
1703 /* 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
1704 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
1705 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
1706 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
1707 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
1708 return;
9a78169e44df * xfns.c (x_set_menu_bar_lines): Minibuffer-only frames can't have
Jim Blandy <jimb@redhat.com>
parents: 2842
diff changeset
1709
9103
948e8acb6990 (x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9022
diff changeset
1710 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
1711 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
1712 else
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1713 nlines = 0;
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
1714
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1715 #ifdef USE_X_TOOLKIT
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1716 FRAME_MENU_BAR_LINES (f) = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1717 if (nlines)
12832
0d750e41c4f2 (x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents: 12773
diff changeset
1718 {
0d750e41c4f2 (x_set_menu_bar_lines) [USE_X_TOOLKIT]: When turning
Richard M. Stallman <rms@gnu.org>
parents: 12773
diff changeset
1719 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
1720 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
1721 /* 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
1722 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
1723 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1724 else
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1725 {
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
1726 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
1727 free_frame_menubar (f);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1728 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
1729 if (FRAME_X_P (f))
714433bead7f (x_set_menu_bar_lines) [USE_X_TOOLKIT]:
Richard M. Stallman <rms@gnu.org>
parents: 13508
diff changeset
1730 f->output_data.x->menubar_widget = 0;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1731 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1732 #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
1733 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
1734 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
1735 #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
1736 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1737
4650
d81041bb1e3d comment fix
David J. MacKenzie <djm@gnu.org>
parents: 4629
diff changeset
1738 /* 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
1739 x_id_name.
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1740
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1741 If 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
1742 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
1743 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
1744
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1745 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
1746 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
1747 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
1748
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1749 void
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1750 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
1751 struct frame *f;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1752 Lisp_Object name;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1753 int explicit;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1754 {
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1755 /* 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
1756 Emacs redisplay code. */
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1757 if (explicit)
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1758 {
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1759 /* 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
1760 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
1761 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
1762 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
1763
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1764 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
1765 }
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1766 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
1767 return;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1768
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1769 /* 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
1770 if (NILP (name))
8090
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
1771 {
bb03e344f07e (x_set_frame_parameters): Call x_set_offset directly.
Richard M. Stallman <rms@gnu.org>
parents: 7989
diff changeset
1772 /* 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
1773 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
1774 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
1775 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
1776 return;
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
1777 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
1778 }
833
14748faa4f17 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 817
diff changeset
1779 else
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1780 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
1781
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1782 /* 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
1783 if (! NILP (Fstring_equal (name, f->name)))
727
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 708
diff changeset
1784 return;
540b047ece4d *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 708
diff changeset
1785
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1786 f->name = name;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1787
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1788 /* 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
1789 the name parameter. */
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1790 if (! NILP (f->title))
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1791 name = f->title;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1792
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
1793 if (FRAME_X_WINDOW (f))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1794 {
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 700
diff changeset
1795 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
1796 #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
1797 {
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1798 XTextProperty text, icon;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1799 Lisp_Object icon_name;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1800
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
1801 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
1802 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
1803 text.format = 8;
133bad38bde1 * xfns.c (x_icon): Don't call x_wm_set_icon_positions if the user
Jim Blandy <jimb@redhat.com>
parents: 1018
diff changeset
1804 text.nitems = XSTRING (name)->size;
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1805
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
1806 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
1807
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1808 icon.value = XSTRING (icon_name)->data;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1809 icon.encoding = XA_STRING;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1810 icon.format = 8;
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
1811 icon.nitems = XSTRING (icon_name)->size;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1812 #ifdef USE_X_TOOLKIT
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1813 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
1814 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
1815 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
1816 &icon);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1817 #else /* not USE_X_TOOLKIT */
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1818 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
1819 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
1820 #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
1821 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1822 #else /* not HAVE_X11R4 */
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1823 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
1824 XSTRING (name)->data);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
1825 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
1826 XSTRING (name)->data);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
1827 #endif /* not HAVE_X11R4 */
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 700
diff changeset
1828 UNBLOCK_INPUT;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1829 }
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1830 }
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1831
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1832 /* 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
1833 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
1834 redisplay code. */
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1835 void
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1836 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
1837 FRAME_PTR f;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1838 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
1839 {
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1840 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
1841 }
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1842
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1843 /* 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
1844 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
1845 lisp code. */
1125
059624bf9bf0 Declare x_implicitly_set_name to be void.
Jim Blandy <jimb@redhat.com>
parents: 1096
diff changeset
1846 void
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1847 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
1848 FRAME_PTR f;
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1849 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
1850 {
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
1851 x_set_name (f, arg, 0);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1852 }
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1853
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1854 /* 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
1855 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
1856
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1857 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
1858 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
1859 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
1860
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1861 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
1862 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
1863 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
1864
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1865 void
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1866 x_set_title (f, name)
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1867 struct frame *f;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1868 Lisp_Object name;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1869 {
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1870 /* 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
1871 if (EQ (name, f->title))
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1872 return;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1873
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1874 update_mode_lines = 1;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1875
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1876 f->title = name;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1877
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1878 if (NILP (name))
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1879 name = f->name;
16732
f52c4fd47f03 (x_set_title): Check data type of NAME.
Richard M. Stallman <rms@gnu.org>
parents: 16682
diff changeset
1880 else
f52c4fd47f03 (x_set_title): Check data type of NAME.
Richard M. Stallman <rms@gnu.org>
parents: 16682
diff changeset
1881 CHECK_STRING (name, 0);
14482
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1882
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1883 if (FRAME_X_WINDOW (f))
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1884 {
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1885 BLOCK_INPUT;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1886 #ifdef HAVE_X11R4
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 XTextProperty text, icon;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1889 Lisp_Object icon_name;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1890
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1891 text.value = XSTRING (name)->data;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1892 text.encoding = XA_STRING;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1893 text.format = 8;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1894 text.nitems = XSTRING (name)->size;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1895
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1896 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
1897
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1898 icon.value = XSTRING (icon_name)->data;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1899 icon.encoding = XA_STRING;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1900 icon.format = 8;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1901 icon.nitems = XSTRING (icon_name)->size;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1902 #ifdef USE_X_TOOLKIT
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1903 XSetWMName (FRAME_X_DISPLAY (f),
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1904 XtWindow (f->output_data.x->widget), &text);
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1905 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
1906 &icon);
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1907 #else /* not USE_X_TOOLKIT */
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1908 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
1909 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
1910 #endif /* not USE_X_TOOLKIT */
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1911 }
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1912 #else /* not HAVE_X11R4 */
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1913 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
1914 XSTRING (name)->data);
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1915 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
1916 XSTRING (name)->data);
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1917 #endif /* not HAVE_X11R4 */
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1918 UNBLOCK_INPUT;
479987ba2c8d (x_frame_parms): Add "title" element.
Richard M. Stallman <rms@gnu.org>
parents: 14439
diff changeset
1919 }
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
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1922 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1923 x_set_autoraise (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1924 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1925 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1926 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1927 f->auto_raise = !EQ (Qnil, arg);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1928 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1929
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1930 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1931 x_set_autolower (f, arg, oldval)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1932 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1933 Lisp_Object arg, oldval;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1934 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
1935 f->auto_lower = !EQ (Qnil, arg);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1936 }
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1937
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1938 void
9580
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1939 x_set_unsplittable (f, arg, oldval)
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1940 struct frame *f;
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1941 Lisp_Object arg, oldval;
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1942 {
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1943 f->no_split = !NILP (arg);
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1944 }
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1945
bcc9342cf633 (x_set_unsplittable): New function.
Karl Heuer <kwzh@gnu.org>
parents: 9563
diff changeset
1946 void
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
1947 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
1948 struct frame *f;
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1949 Lisp_Object arg, oldval;
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1950 {
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1951 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
1952 || (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
1953 || (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
1954 || (!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
1955 {
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1956 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
1957 = (NILP (arg)
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1958 ? vertical_scroll_bar_none
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1959 : EQ (Qright, arg)
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1960 ? vertical_scroll_bar_right
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
1961 : 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
1962
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
1963 /* 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
1964 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
1965 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
1966 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
1967 if (FRAME_X_WINDOW (f))
5899
4e8f26a0f2b7 *** empty log message ***
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 5721
diff changeset
1968 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
1969 }
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
1970 }
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
1971
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
1972 void
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
1973 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
1974 struct frame *f;
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
1975 Lisp_Object arg, oldval;
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
1976 {
9166
44b44e900cf1 (x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents: 9103
diff changeset
1977 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
1978 {
44b44e900cf1 (x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents: 9103
diff changeset
1979 FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = 0;
16302
025b3dc7a6ba (Fx_create_frame): Default Qinternal_border_width to 1.
Richard M. Stallman <rms@gnu.org>
parents: 16254
diff changeset
1980 FRAME_SCROLL_BAR_COLS (f) = 3;
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
1981 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
1982 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
1983 }
44b44e900cf1 (x_set_scroll_bar_width): Nil now means 2 columns' worth of pixels.
Karl Heuer <kwzh@gnu.org>
parents: 9103
diff changeset
1984 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
1985 && 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
1986 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
1987 int wid = FONT_WIDTH (f->output_data.x->font);
16682
fe4b95eb15ae (x_set_scroll_bar_width): Reject a width that's too small.
Richard M. Stallman <rms@gnu.org>
parents: 16515
diff changeset
1988
fe4b95eb15ae (x_set_scroll_bar_width): Reject a width that's too small.
Richard M. Stallman <rms@gnu.org>
parents: 16515
diff changeset
1989 if (XFASTINT (arg) < 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM)
fe4b95eb15ae (x_set_scroll_bar_width): Reject a width that's too small.
Richard M. Stallman <rms@gnu.org>
parents: 16515
diff changeset
1990 Fsignal (Qargs_out_of_range, Fcons (arg, Qnil));
fe4b95eb15ae (x_set_scroll_bar_width): Reject a width that's too small.
Richard M. Stallman <rms@gnu.org>
parents: 16515
diff changeset
1991
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
1992 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
1993 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
1994 if (FRAME_X_WINDOW (f))
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
1995 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
1996 }
16302
025b3dc7a6ba (Fx_create_frame): Default Qinternal_border_width to 1.
Richard M. Stallman <rms@gnu.org>
parents: 16254
diff changeset
1997
025b3dc7a6ba (Fx_create_frame): Default Qinternal_border_width to 1.
Richard M. Stallman <rms@gnu.org>
parents: 16254
diff changeset
1998 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
1999 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
2000 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2001
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2002 /* Subroutines of creating an X frame. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2003
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2004 /* 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
2005 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
2006
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2007 static void
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2008 validate_x_resource_name ()
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2009 {
11353
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2010 int len;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2011 /* 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
2012 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
2013 /* 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
2014 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
2015 Lisp_Object new;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2016 int i;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2017
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
2018 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
2019 {
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2020 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
2021 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
2022
11353
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2023 len = XSTRING (Vx_resource_name)->size;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2024
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2025 /* 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
2026 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
2027 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
2028 {
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2029 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
2030 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
2031 || (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
2032 || (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
2033 || c == '-' || c == '_'))
11353
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2034 bad_count++;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2035 else
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2036 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
2037 }
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2038 }
5b784d881c0f (validate_x_resource_name): Don't let Vx_resource_name have invalid characters.
Richard M. Stallman <rms@gnu.org>
parents: 7408
diff changeset
2039 else
11353
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2040 /* 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
2041 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
2042
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2043 /* 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
2044 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
2045 return;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2046
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2047 /* 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
2048 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
2049 || (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
2050 {
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2051 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
2052 return;
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2053 }
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2054
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2055 /* 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
2056 with underscores. */
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2057
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2058 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
2059
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2060 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
2061 {
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2062 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
2063 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
2064 || (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
2065 || (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
2066 || c == '-' || c == '_'))
9e3da029f921 (x_window): Copy the frame name to non-Lisp string.
Richard M. Stallman <rms@gnu.org>
parents: 11235
diff changeset
2067 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
2068 }
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2069 }
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2070
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2071
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2072 extern char *x_get_string_resource ();
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2073
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2074 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
2075 "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
2076 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
2077 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
2078 the name specified by the `-name' or `-rn' command-line arguments.\n\
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2079 \n\
1733
2d41a3d7b9a6 (Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents: 1719
diff changeset
2080 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
2081 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
2082 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
2083 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
2084 (attribute, class, component, subclass)
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2085 Lisp_Object attribute, class, component, subclass;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2086 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2087 register char *value;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2088 char *name_key;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2089 char *class_key;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2090
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
2091 check_x ();
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
2092
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2093 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
2094 CHECK_STRING (class, 0);
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2095
1733
2d41a3d7b9a6 (Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents: 1719
diff changeset
2096 if (!NILP (component))
2d41a3d7b9a6 (Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents: 1719
diff changeset
2097 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
2098 if (!NILP (subclass))
2d41a3d7b9a6 (Fx_get_resource): Use EMACS_CLASS to make class_key
Richard M. Stallman <rms@gnu.org>
parents: 1719
diff changeset
2099 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
2100 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
2101 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
2102
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2103 validate_x_resource_name ();
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2104
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2105 /* 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
2106 and the final '\0'. Make them big enough for the worst case. */
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2107 name_key = (char *) alloca (XSTRING (Vx_resource_name)->size
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2108 + (STRINGP (component)
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2109 ? XSTRING (component)->size : 0)
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2110 + XSTRING (attribute)->size
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2111 + 3);
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2112
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2113 class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2114 + XSTRING (class)->size
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2115 + (STRINGP (subclass)
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2116 ? XSTRING (subclass)->size : 0)
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2117 + 3);
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2118
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2119 /* 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
2120 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
2121 strcpy (name_key, XSTRING (Vx_resource_name)->data);
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2122 strcpy (class_key, EMACS_CLASS);
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2123
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2124 strcat (class_key, ".");
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2125 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
2126
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2127 if (!NILP (component))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2128 {
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2129 strcat (class_key, ".");
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2130 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
2131
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2132 strcat (name_key, ".");
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2133 strcat (name_key, XSTRING (component)->data);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2134 }
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 strcat (name_key, ".");
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2137 strcat (name_key, XSTRING (attribute)->data);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2138
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2139 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
2140 name_key, class_key);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2141
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2142 if (value != (char *) 0)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2143 return build_string (value);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2144 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2145 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2146 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2147
3173
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2148 /* 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
2149
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2150 char *
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2151 x_get_resource_string (attribute, class)
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2152 char *attribute, *class;
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2153 {
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2154 register char *value;
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2155 char *name_key;
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2156 char *class_key;
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2157
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2158 /* 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
2159 and the final '\0'. */
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2160 name_key = (char *) alloca (XSTRING (Vinvocation_name)->size
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2161 + strlen (attribute) + 2);
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2162 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
2163 + strlen (class) + 2);
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2164
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2165 sprintf (name_key, "%s.%s",
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2166 XSTRING (Vinvocation_name)->data,
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2167 attribute);
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2168 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
2169
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2170 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
2171 name_key, class_key);
3173
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2172 }
c3c1b1ceab05 (x_get_resource_string): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3170
diff changeset
2173
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2174 /* Types we might convert a resource string into. */
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2175 enum resource_types
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2176 {
4571
25bee4fe64aa (enum resource_types): Delete final comma.
Richard M. Stallman <rms@gnu.org>
parents: 4367
diff changeset
2177 number, boolean, string, symbol
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2178 };
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2179
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2180 /* Return the value of parameter PARAM.
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2181
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2182 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
2183 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
2184
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2185 Convert the resource to the type specified by desired_type.
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2186
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2187 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
2188 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
2189 and don't let it get stored in any Lisp-visible variables! */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2190
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2191 static Lisp_Object
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2192 x_get_arg (alist, param, attribute, class, type)
641
78a0b78aa6de *** empty log message ***
Joseph Arceneaux <jla@gnu.org>
parents: 621
diff changeset
2193 Lisp_Object alist, param;
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2194 char *attribute;
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2195 char *class;
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2196 enum resource_types type;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2197 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2198 register Lisp_Object tem;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2199
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2200 tem = Fassq (param, alist);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2201 if (EQ (tem, Qnil))
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2202 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
2203 if (EQ (tem, Qnil))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2204 {
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2205
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2206 if (attribute)
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2207 {
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2208 tem = Fx_get_resource (build_string (attribute),
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2209 build_string (class),
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2210 Qnil, Qnil);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2211
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2212 if (NILP (tem))
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2213 return Qunbound;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2214
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2215 switch (type)
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2216 {
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2217 case number:
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2218 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
2219
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2220 case boolean:
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2221 tem = Fdowncase (tem);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2222 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
2223 || !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
2224 return Qt;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2225 else
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2226 return Qnil;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2227
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2228 case string:
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2229 return tem;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2230
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
2231 case symbol:
2294
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
2232 /* 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
2233 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
2234 {
6519
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
2235 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
2236 lower = Fdowncase (tem);
6523
d9d9ab5951dd (x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents: 6522
diff changeset
2237 if (!strcmp (XSTRING (lower)->data, "on")
d9d9ab5951dd (x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents: 6522
diff changeset
2238 || !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
2239 return Qt;
6523
d9d9ab5951dd (x_get_arg): Use downcased string in compare.
Karl Heuer <kwzh@gnu.org>
parents: 6522
diff changeset
2240 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
2241 || !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
2242 return Qnil;
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
2243 else
2686
a84b9a78ab08 (x_get_arg): Call Fintern, not intern.
Richard M. Stallman <rms@gnu.org>
parents: 2439
diff changeset
2244 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
2245 }
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
2246
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2247 default:
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2248 abort ();
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2249 }
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2250 }
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2251 else
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2252 return Qunbound;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2253 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2254 return Fcdr (tem);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2255 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2256
16156
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2257 /* 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
2258
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2259 static Lisp_Object
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2260 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
2261 struct frame *f;
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2262 Lisp_Object alist, param;
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2263 char *attribute;
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2264 char *class;
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2265 enum resource_types type;
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2266 {
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2267 Lisp_Object value;
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2268
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2269 value = x_get_arg (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
2270 if (! NILP (value))
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2271 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
2272
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2273 return value;
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2274 }
d435199e529d (x_set_frame_parameters): Make height and width ints.
Richard M. Stallman <rms@gnu.org>
parents: 16041
diff changeset
2275
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2276 /* Record in frame F the specified or default value according to ALIST
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2277 of the parameter named PARAM (a Lisp symbol).
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2278 If no value is specified for PARAM, look for an X default for XPROP
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2279 on the frame named NAME.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2280 If that is not found either, use the value DEFLT. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2281
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2282 static Lisp_Object
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2283 x_default_parameter (f, alist, prop, deflt, xprop, xclass, type)
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2284 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2285 Lisp_Object alist;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2286 Lisp_Object prop;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2287 Lisp_Object deflt;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2288 char *xprop;
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2289 char *xclass;
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
2290 enum resource_types type;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2291 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2292 Lisp_Object tem;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2293
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2294 tem = x_get_arg (alist, prop, xprop, xclass, type);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2295 if (EQ (tem, Qunbound))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2296 tem = deflt;
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2297 x_set_frame_parameters (f, Fcons (Fcons (prop, tem), Qnil));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2298 return tem;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2299 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2300
2328
82e4fed9cdd6 * xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents: 2295
diff changeset
2301 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
2302 "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
2303 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
2304 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
2305 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
2306 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
2307 or a list (- N) meaning -N pixels relative to bottom/right corner.")
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2308 (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
2309 Lisp_Object string;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2310 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2311 int geometry, x, y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2312 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
2313 Lisp_Object result;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2314
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2315 CHECK_STRING (string, 0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2316
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2317 geometry = XParseGeometry ((char *) XSTRING (string)->data,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2318 &x, &y, &width, &height);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2319
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2320 #if 0
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2321 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
2322 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
2323 #endif
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2324
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2325 result = Qnil;
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2326 if (geometry & XValue)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2327 {
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2328 Lisp_Object element;
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2329
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2330 if (x >= 0 && (geometry & XNegative))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2331 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
2332 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
2333 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
2334 else
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2335 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
2336 result = Fcons (element, result);
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2337 }
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2338
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2339 if (geometry & YValue)
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2340 {
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2341 Lisp_Object element;
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2342
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2343 if (y >= 0 && (geometry & YNegative))
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2344 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
2345 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
2346 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
2347 else
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2348 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
2349 result = Fcons (element, result);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2350 }
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2351
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2352 if (geometry & WidthValue)
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2353 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
2354 if (geometry & HeightValue)
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2355 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
2356
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2357 return result;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2358 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2359
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2360 /* 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
2361 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
2362
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2363 This function does not make the coordinates positive. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2364
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2365 #define DEFAULT_ROWS 40
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2366 #define DEFAULT_COLS 80
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2367
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2368 static int
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2369 x_figure_window_size (f, parms)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2370 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2371 Lisp_Object parms;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2372 {
7251
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
2373 register Lisp_Object tem0, tem1, tem2;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2374 int height, width, left, top;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2375 register int geometry;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2376 long window_prompting = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2377
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2378 /* Default values if we fall through.
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2379 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
2380 window manager prompting. */
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
2381 SET_FRAME_WIDTH (f, DEFAULT_COLS);
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2382 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
2383 /* 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
2384 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
2385 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
2386 f->output_data.x->left_pos = 0;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2387
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2388 tem0 = x_get_arg (parms, Qheight, 0, 0, number);
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2389 tem1 = x_get_arg (parms, Qwidth, 0, 0, number);
7251
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
2390 tem2 = x_get_arg (parms, Quser_size, 0, 0, number);
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2391 if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2392 {
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2393 if (!EQ (tem0, Qunbound))
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2394 {
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2395 CHECK_NUMBER (tem0, 0);
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2396 f->height = XINT (tem0);
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2397 }
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2398 if (!EQ (tem1, Qunbound))
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2399 {
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2400 CHECK_NUMBER (tem1, 0);
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
2401 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
2402 }
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2403 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
2404 window_prompting |= USSize;
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
2405 else
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
2406 window_prompting |= PSize;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2407 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2408
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2409 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
2410 = (!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
2411 ? 0
60497ceed71a (x_figure_window_size): Use new formula for scroll bar width.
Karl Heuer <kwzh@gnu.org>
parents: 9231
diff changeset
2412 : 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
2413 ? 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
2414 : (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
2415 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
2416 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
2417
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2418 tem0 = x_get_arg (parms, Qtop, 0, 0, number);
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2419 tem1 = x_get_arg (parms, Qleft, 0, 0, number);
7251
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
2420 tem2 = x_get_arg (parms, Quser_position, 0, 0, number);
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2421 if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2422 {
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2423 if (EQ (tem0, Qminus))
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2424 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2425 f->output_data.x->top_pos = 0;
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2426 window_prompting |= YNegative;
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2427 }
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2428 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
2429 && CONSP (XCONS (tem0)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2430 && 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
2431 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2432 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
2433 window_prompting |= YNegative;
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2434 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2435 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
2436 && CONSP (XCONS (tem0)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2437 && 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
2438 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2439 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
2440 }
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2441 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
2442 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
2443 else
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2444 {
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2445 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
2446 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
2447 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
2448 window_prompting |= YNegative;
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2449 }
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2450
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2451 if (EQ (tem1, Qminus))
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2452 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2453 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
2454 window_prompting |= XNegative;
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2455 }
9022
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2456 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
2457 && CONSP (XCONS (tem1)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2458 && 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
2459 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2460 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
2461 window_prompting |= XNegative;
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2462 }
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2463 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
2464 && CONSP (XCONS (tem1)->cdr)
10fa443c671a (Fx_create_frame): Rename menuBarLines resource to menuBar.
Richard M. Stallman <rms@gnu.org>
parents: 9014
diff changeset
2465 && 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
2466 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2467 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
2468 }
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2469 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
2470 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
2471 else
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2472 {
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2473 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
2474 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
2475 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
2476 window_prompting |= XNegative;
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2477 }
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2478
10264
92dcc001aa20 (x_figure_window_size): Treat missing user-position parm as nil.
Richard M. Stallman <rms@gnu.org>
parents: 10222
diff changeset
2479 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
2480 window_prompting |= USPosition;
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
2481 else
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
2482 window_prompting |= PPosition;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2483 }
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
2484
3293
03e4cad68481 (Fx_close_current_connection): Clear x_current_display.
Richard M. Stallman <rms@gnu.org>
parents: 3203
diff changeset
2485 return window_prompting;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2486 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2487
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2488 #if !defined (HAVE_X11R4) && !defined (HAVE_XSETWMPROTOCOLS)
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2489
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2490 Status
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2491 XSetWMProtocols (dpy, w, protocols, count)
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2492 Display *dpy;
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2493 Window w;
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2494 Atom *protocols;
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2495 int count;
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2496 {
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2497 Atom prop;
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2498 prop = XInternAtom (dpy, "WM_PROTOCOLS", False);
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2499 if (prop == None) return False;
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2500 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
2501 (unsigned char *) protocols, count);
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2502 return True;
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
2503 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2504 #endif /* not HAVE_X11R4 && not HAVE_XSETWMPROTOCOLS */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2505
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2506 #ifdef USE_X_TOOLKIT
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2507
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
2508 /* 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
2509 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
2510 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
2511 for example, but Xt doesn't). */
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2512
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2513 static void
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2514 hack_wm_protocols (f, widget)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2515 FRAME_PTR f;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2516 Widget widget;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2517 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2518 Display *dpy = XtDisplay (widget);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2519 Window w = XtWindow (widget);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2520 int need_delete = 1;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2521 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
2522 int need_save = 1;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2523
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2524 BLOCK_INPUT;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2525 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2526 Atom type, *atoms = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2527 int format = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2528 unsigned long nitems = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2529 unsigned long bytes_after;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2530
11882
8b3575269610 (hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents: 11774
diff changeset
2531 if ((XGetWindowProperty (dpy, w,
8b3575269610 (hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents: 11774
diff changeset
2532 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
2533 (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
2534 &type, &format, &nitems, &bytes_after,
8b3575269610 (hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents: 11774
diff changeset
2535 (unsigned char **) &atoms)
8b3575269610 (hack_wm_protocols): Cast args of XGetWindowProperty.
Karl Heuer <kwzh@gnu.org>
parents: 11774
diff changeset
2536 == Success)
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2537 && format == 32 && type == XA_ATOM)
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2538 while (nitems > 0)
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2539 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2540 nitems--;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2541 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
2542 need_delete = 0;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2543 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
2544 need_focus = 0;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2545 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
2546 need_save = 0;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2547 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2548 if (atoms) XFree ((char *) atoms);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2549 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2550 {
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2551 Atom props [10];
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2552 int count = 0;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2553 if (need_delete)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2554 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
2555 if (need_focus)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2556 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
2557 if (need_save)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2558 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
2559 if (count)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2560 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
2561 XA_ATOM, 32, PropModeAppend,
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2562 (unsigned char *) props, count);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2563 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2564 UNBLOCK_INPUT;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2565 }
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2566 #endif
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2567
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2568 #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
2569
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2570 /* 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
2571
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2572 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
2573 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
2574 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
2575 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
2576 int minibuffer_only;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2577 {
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2578 XClassHint class_hints;
6059
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2579 XSetWindowAttributes attributes;
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2580 unsigned long attribute_mask;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2581
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2582 Widget shell_widget;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2583 Widget pane_widget;
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2584 Widget frame_widget;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2585 Arg al [25];
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2586 int ac;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2587
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2588 BLOCK_INPUT;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2589
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2590 /* 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
2591 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
2592 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
2593
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2594 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
2595
11496
db02849ee365 (x_window): Use (or reuse) frame's namebuf instead of a
Karl Heuer <kwzh@gnu.org>
parents: 11483
diff changeset
2596 {
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2597 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
2598 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
2599 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
2600 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2601
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2602 ac = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2603 XtSetArg (al[ac], XtNallowShellResize, 1); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2604 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
2605 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
2606 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
2607 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
2608 applicationShellWidgetClass,
9742
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
2609 FRAME_X_DISPLAY (f), al, ac);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2610
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2611 f->output_data.x->widget = shell_widget;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2612 /* maybe_set_screen_title_format (shell_widget); */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2613
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2614 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
2615 (widget_value *) NULL,
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2616 shell_widget, False,
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2617 (lw_callback) NULL,
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2618 (lw_callback) NULL,
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2619 (lw_callback) NULL);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2620
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2621 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
2622
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2623 /* 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
2624 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
2625
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2626 ac = 0;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2627 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2628 XtSetArg (al[ac], XtNshowGrip, 0); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2629 XtSetArg (al[ac], XtNallowResize, 1); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2630 XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2631 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
2632 frame_widget = XtCreateWidget (f->namebuf,
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2633 emacsFrameClass,
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2634 pane_widget, al, ac);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2635
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2636 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
2637
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2638 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
2639
bb11213734d6 (x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6523
diff changeset
2640 /* 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
2641 {
bb11213734d6 (x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6523
diff changeset
2642 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
2643 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
2644 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
2645 int ac = 0;
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2646 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
2647 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
2648 = (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
2649 ? (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
2650 + 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
2651 : 0);
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2652 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
2653
15942
ff30ec8aab54 (x_window): Don't add ibw to menubar_size.
Richard M. Stallman <rms@gnu.org>
parents: 15891
diff changeset
2654 #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
2655 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
2656 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
2657 {
9808
4c43c9dbe130 (x_window): Make ibw 0 by default.
Richard M. Stallman <rms@gnu.org>
parents: 9742
diff changeset
2658 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
2659 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
2660 menubar_size += ibw;
7f15f77cb644 (x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents: 7946
diff changeset
2661 }
15942
ff30ec8aab54 (x_window): Don't add ibw to menubar_size.
Richard M. Stallman <rms@gnu.org>
parents: 15891
diff changeset
2662 #endif
7969
7f15f77cb644 (x_window): Take account of pane widget internal border width.
Richard M. Stallman <rms@gnu.org>
parents: 7946
diff changeset
2663
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2664 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
2665
16305
00e57c8adaba (x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents: 16302
diff changeset
2666 #ifndef USE_LUCID
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2667 /* 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
2668 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
2669 Both conclusions reached experimentally. -- rms. */
16305
00e57c8adaba (x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents: 16302
diff changeset
2670 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
2671 &extra_borders, NULL);
00e57c8adaba (x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents: 16302
diff changeset
2672 extra_borders *= 2;
00e57c8adaba (x_window): With Motif, double extra_borders.
Richard M. Stallman <rms@gnu.org>
parents: 16302
diff changeset
2673 #endif
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2674
11707
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2675 /* 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
2676 and specify it.
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2677 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
2678 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
2679 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
2680 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2681 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
2682 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
2683 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
2684 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
2685 if (xneg)
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2686 left = -left;
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2687 if (yneg)
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2688 top = -top;
11893
1f70ffad3d6d [USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents: 11882
diff changeset
2689
1f70ffad3d6d [USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents: 11882
diff changeset
2690 if (window_prompting & USPosition)
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2691 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
2692 PIXEL_WIDTH (f) + extra_borders,
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2693 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
2694 (xneg ? '-' : '+'), left,
1f70ffad3d6d [USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents: 11882
diff changeset
2695 (yneg ? '-' : '+'), top);
1f70ffad3d6d [USE_X_TOOLKIT] (x_window): Pass position to toolkit
Karl Heuer <kwzh@gnu.org>
parents: 11882
diff changeset
2696 else
12190
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2697 sprintf (shell_position, "=%dx%d",
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2698 PIXEL_WIDTH (f) + extra_borders,
e0abe30899a9 [USE_X_TOOLKIT] (x_window): If using Motif,
Karl Heuer <kwzh@gnu.org>
parents: 12111
diff changeset
2699 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
2700 }
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
2701
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
2702 len = strlen (shell_position) + 1;
bb11213734d6 (x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6523
diff changeset
2703 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
2704 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
2705 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
2706 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
2707 }
bb11213734d6 (x_window) [USE_X_TOOLKIT]: New args window_prompting and minibuffer_only.
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6523
diff changeset
2708
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2709 XtManageChild (pane_widget);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2710 XtRealizeWidget (shell_widget);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2711
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2712 FRAME_X_WINDOW (f) = XtWindow (frame_widget);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2713
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2714 validate_x_resource_name ();
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2715
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2716 class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data;
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2717 class_hints.res_class = EMACS_CLASS;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2718 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
2719
13227
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2720 #ifdef HAVE_X_I18N
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2721 #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
2722 {
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2723 XIM xim;
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2724 XIC xic = NULL;
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2725
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2726 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
2727
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2728 if (xim)
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2729 {
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2730 xic = XCreateIC (xim,
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2731 XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2732 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
2733 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
2734 NULL);
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2735
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2736 if (xic == 0)
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2737 {
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2738 XCloseIM (xim);
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2739 xim = NULL;
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2740 }
13227
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2741 }
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2742 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
2743 FRAME_XIC (f) = xic;
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2744 }
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2745 #else /* X_I18N_INHIBITED */
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2746 FRAME_XIM (f) = 0;
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2747 FRAME_XIC (f) = 0;
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2748 #endif /* X_I18N_INHIBITED */
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2749 #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
2750
12667
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->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
2752 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
2753 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
2754 &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
2755
9703
85ac0e4030d4 (x_window): Pass new arg f to hack_wm_protocols.
Richard M. Stallman <rms@gnu.org>
parents: 9690
diff changeset
2756 hack_wm_protocols (f, shell_widget);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2757
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2758 #ifdef HACK_EDITRES
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2759 XtAddEventHandler (shell_widget, 0, True, _XEditResCheckMessages, 0);
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2760 #endif
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2761
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2762 /* 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
2763 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
2764 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
2765 */
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2766 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
2767 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
2768 XA_ATOM, 32, PropModeAppend,
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2769 (unsigned char*) NULL, 0);
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2770
6059
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2771 /* 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
2772 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
2773 attribute_mask = CWEventMask;
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2774 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
2775 attribute_mask, &attributes);
0021cbdc591b (x_window): Call XChangeWindowAttributes with the standard
Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
parents: 6011
diff changeset
2776
9231
eeb35369e536 (HACK_EDITRES): Declare if using X11R5.
Paul Reilly <pmr@pajato.com>
parents: 9182
diff changeset
2777 XtMapWidget (frame_widget);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2778
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2779 /* 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
2780 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
2781 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
2782 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
2783 {
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2784 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
2785 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
2786
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2787 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
2788 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
2789 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
2790 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
2791 }
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2792
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2793 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
2794 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
2795
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2796 UNBLOCK_INPUT;
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2797
11962
f9b853c18bb5 (x_window): Call initialize_frame_menubar
Karl Heuer <kwzh@gnu.org>
parents: 11932
diff changeset
2798 if (!minibuffer_only && FRAME_EXTERNAL_MENU_BAR (f))
f9b853c18bb5 (x_window): Call initialize_frame_menubar
Karl Heuer <kwzh@gnu.org>
parents: 11932
diff changeset
2799 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
2800 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
2801
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2802 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
2803 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
2804 }
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2805
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2806 #else /* not USE_X_TOOLKIT */
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2807
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2808 /* 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
2809
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2810 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
2811 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
2812
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2813 {
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2814 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
2815 XSetWindowAttributes attributes;
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2816 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
2817
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2818 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
2819 attributes.border_pixel = f->output_data.x->border_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2820 attributes.bit_gravity = StaticGravity;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2821 attributes.backing_store = NotUseful;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2822 attributes.save_under = True;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2823 attributes.event_mask = STANDARD_EVENT_SET;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2824 attribute_mask = (CWBackPixel | CWBorderPixel | CWBitGravity
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2825 #if 0
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2826 | CWBackingStore | CWSaveUnder
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2827 #endif
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2828 | CWEventMask);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2829
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2830 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
2831 FRAME_X_WINDOW (f)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2832 = 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
2833 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
2834 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
2835 f->output_data.x->top_pos,
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2836 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
2837 f->output_data.x->border_width,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2838 CopyFromParent, /* depth */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2839 InputOutput, /* class */
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2840 FRAME_X_DISPLAY_INFO (f)->visual,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2841 attribute_mask, &attributes);
13227
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2842 #ifdef HAVE_X_I18N
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2843 #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
2844 {
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2845 XIM xim;
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2846 XIC xic = NULL;
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2847
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2848 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
2849
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2850 if (xim)
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2851 {
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2852 xic = XCreateIC (xim,
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2853 XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2854 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
2855 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
2856 NULL);
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2857
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2858 if (!xic)
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2859 {
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2860 XCloseIM (xim);
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2861 xim = NULL;
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2862 }
13227
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2863 }
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2864
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2865 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
2866 FRAME_XIC (f) = xic;
d8af44485b3c (x_window, both versions): Add HAVE_X_I18N support.
Richard M. Stallman <rms@gnu.org>
parents: 13083
diff changeset
2867 }
14831
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2868 #else /* X_I18N_INHIBITED */
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2869 FRAME_XIM (f) = 0;
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2870 FRAME_XIC (f) = 0;
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2871 #endif /* X_I18N_INHIBITED */
df37dc2b9bfb (X_I18N_INHIBITED): New macro--define this
Richard M. Stallman <rms@gnu.org>
parents: 14746
diff changeset
2872 #endif /* HAVE_X_I18N */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2873
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2874 validate_x_resource_name ();
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
2875
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
2876 class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2877 class_hints.res_class = EMACS_CLASS;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2878 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
2879
11897
cbd3724a9696 (x_window) [both versions]: Set menubar_height.
Karl Heuer <kwzh@gnu.org>
parents: 11894
diff changeset
2880 /* 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
2881 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
2882 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
2883
1719
48f539ac6921 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1657
diff changeset
2884 /* 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
2885 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
2886 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
2887 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
2888
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
2889 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
2890 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
2891 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
2892 &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
2893 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
2894
26a1d7b2670b (x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents: 7802
diff changeset
2895 /* 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
2896 {
26a1d7b2670b (x_window): Request "save yourself" commands.
Richard M. Stallman <rms@gnu.org>
parents: 7802
diff changeset
2897 Atom protocols[2];
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2898 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
2899 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
2900 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
2901 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2902
817
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2903 /* 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
2904 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
2905 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
2906 the X server hasn't been told. */
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2907 {
6519
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
2908 Lisp_Object name;
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2909 int explicit = f->explicit_name;
817
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2910
6519
22c56514eeb3 (x_set_frame_parameters, x_get_arg, x_window, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 6506
diff changeset
2911 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
2912 name = f->name;
817
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2913 f->name = Qnil;
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
2914 x_set_name (f, name, explicit);
817
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2915 }
1dd126823b36 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 771
diff changeset
2916
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
2917 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
2918 f->output_data.x->text_cursor);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2919
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2920 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2921
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
2922 if (FRAME_X_WINDOW (f) == 0)
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2923 error ("Unable to create window");
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2924 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2925
6790
ee8090b47ea6 (x_figure_window_size): Don't call x_calc_absolute_position.
Richard M. Stallman <rms@gnu.org>
parents: 6783
diff changeset
2926 #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
2927
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2928 /* Handle the icon stuff for this window. Perhaps later we might
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2929 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
2930 well. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2931
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2932 static void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2933 x_icon (f, parms)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2934 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2935 Lisp_Object parms;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2936 {
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2937 Lisp_Object icon_x, icon_y;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2938
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2939 /* 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
2940 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
2941 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
2942 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
2943 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2944 {
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2945 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
2946 CHECK_NUMBER (icon_y, 0);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2947 }
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2948 else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2949 error ("Both left and top icon corners of icon must be specified");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2950
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2951 BLOCK_INPUT;
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2952
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
2953 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
2954 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
2955
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2956 /* 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
2957 x_wm_set_window_state
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
2958 (f, (EQ (x_get_arg (parms, Qvisibility, 0, 0, symbol), Qicon)
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
2959 ? IconicState
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
2960 : NormalState));
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
2961
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
2962 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
2963 ? 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
2964 : f->name))->data);
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
2965
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2966 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2967 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2968
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2969 /* Make the GC's needed for this window, setting the
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2970 background, border and mouse colors; also create the
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2971 mouse cursor and the gray border tile. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2972
1018
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
2973 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
2974 {
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
2975 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
2976 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
2977 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
2978 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
2979 };
5fd29acd3db7 * xfns.c (x_set_name): Take new argument EXPLICIT, instead of
Jim Blandy <jimb@redhat.com>
parents: 974
diff changeset
2980
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2981 static void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2982 x_make_gc (f)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2983 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2984 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2985 XGCValues gc_values;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2986 GC temp_gc;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2987 XImage tileimage;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2988
2341
1982e2983822 * xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents: 2328
diff changeset
2989 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
2990
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
2991 /* Create the GC's of this frame.
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
2992 Note that many default values are used. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2993
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2994 /* 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
2995 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
2996 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
2997 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
2998 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
2999 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
3000 FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3001 GCLineWidth | GCFont
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3002 | GCForeground | GCBackground,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3003 &gc_values);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3004
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3005 /* 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
3006 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
3007 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
3008 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
3009 FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3010 GCFont | GCForeground | GCBackground
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3011 | GCLineWidth,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3012 &gc_values);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3013
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3014 /* 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
3015 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
3016 gc_values.background = f->output_data.x->cursor_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3017 gc_values.fill_style = FillOpaqueStippled;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3018 gc_values.stipple
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3019 = XCreateBitmapFromData (FRAME_X_DISPLAY (f),
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3020 FRAME_X_DISPLAY_INFO (f)->root_window,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3021 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
3022 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
3023 = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3024 (GCFont | GCForeground | GCBackground
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3025 | GCFillStyle | GCStipple | GCLineWidth),
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3026 &gc_values);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3027
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3028 /* 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
3029 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
3030 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
3031 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
3032 = (XCreatePixmapFromBitmapData
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3033 (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
3034 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
3035 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
3036 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
3037 DefaultDepth (FRAME_X_DISPLAY (f),
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3038 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
3039
1982e2983822 * xfns.c (x_make_gc): Don't forget to block X input around the
Jim Blandy <jimb@redhat.com>
parents: 2328
diff changeset
3040 UNBLOCK_INPUT;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3041 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3042
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3043 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3044 1, 1, 0,
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3045 "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
3046 Returns an Emacs frame object.\n\
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3047 ALIST is an alist of frame parameters.\n\
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3048 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
3049 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
3050 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
3051 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
3052 \n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3053 This function is an internal primitive--use `make-frame' instead.")
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3054 (parms)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3055 Lisp_Object parms;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3056 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3057 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
3058 Lisp_Object frame, tem;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3059 Lisp_Object name;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3060 int minibuffer_only = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3061 long window_prompting = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3062 int width, height;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3063 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
3064 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
3065 Lisp_Object display;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3066 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
3067 Lisp_Object parent;
11774
0b5cb5170084 (Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents: 11772
diff changeset
3068 struct kboard *kb;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3069
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
3070 check_x ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3071
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3072 /* 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
3073 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
3074 Vx_resource_name = Vinvocation_name;
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3075
12316
459ad0d54bef (Fx_create_frame): Fix last arg to x_get_arg for Qdisplay.
Richard M. Stallman <rms@gnu.org>
parents: 12276
diff changeset
3076 display = x_get_arg (parms, Qdisplay, 0, 0, string);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3077 if (EQ (display, Qunbound))
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3078 display = Qnil;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3079 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
3080 #ifdef MULTI_KBOARD
0b5cb5170084 (Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents: 11772
diff changeset
3081 kb = dpyinfo->kboard;
0b5cb5170084 (Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents: 11772
diff changeset
3082 #else
0b5cb5170084 (Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents: 11772
diff changeset
3083 kb = &the_only_kboard;
0b5cb5170084 (Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents: 11772
diff changeset
3084 #endif
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3085
14381
4d038c841cf4 (Qtitle): Declared.
Richard M. Stallman <rms@gnu.org>
parents: 14186
diff changeset
3086 name = x_get_arg (parms, Qname, "name", "Name", string);
9103
948e8acb6990 (x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9022
diff changeset
3087 if (!STRINGP (name)
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3088 && ! EQ (name, Qunbound)
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3089 && ! NILP (name))
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3090 error ("Invalid frame name--not a string or nil");
398
a60eafebd43f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 389
diff changeset
3091
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3092 if (STRINGP (name))
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3093 Vx_resource_name = name;
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
3094
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3095 /* See if parent window is specified. */
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3096 parent = x_get_arg (parms, Qparent_id, NULL, NULL, number);
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3097 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
3098 parent = Qnil;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3099 if (! NILP (parent))
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3100 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
3101
15566
3d03a3fb8757 (Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents: 15495
diff changeset
3102 /* 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
3103 /* 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
3104 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
3105 frame = Qnil;
3d03a3fb8757 (Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents: 15495
diff changeset
3106 GCPRO4 (parms, parent, name, frame);
16515
18e4e6c705ed (Fx_create_frame): Look for X-resource for minibuffer.
Richard M. Stallman <rms@gnu.org>
parents: 16396
diff changeset
3107 tem = x_get_arg (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
3108 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
3109 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
3110 else if (EQ (tem, Qonly))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3111 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3112 f = make_minibuffer_frame ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3113 minibuffer_only = 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3114 }
9103
948e8acb6990 (x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9022
diff changeset
3115 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
3116 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
3117 else
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3118 f = make_frame (1);
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3119
15566
3d03a3fb8757 (Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents: 15495
diff changeset
3120 XSETFRAME (frame, f);
3d03a3fb8757 (Fx_create_frame): Gcpro parms, parent, and name.
Richard M. Stallman <rms@gnu.org>
parents: 15495
diff changeset
3121
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
3122 /* 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
3123 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
3124
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3125 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
3126 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
3127 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
3128 f->output_data.x->icon_bitmap = -1;
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3129
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
3130 f->icon_name
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
3131 = x_get_arg (parms, Qicon_name, "iconName", "Title", string);
12276
2e376a4397bc (x_report_frame_params, x_set_icon_type, x_set_icon_name)
Richard M. Stallman <rms@gnu.org>
parents: 12209
diff changeset
3132 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
3133 f->icon_name = Qnil;
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
3134
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3135 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
3136 #ifdef MULTI_KBOARD
11774
0b5cb5170084 (Fx_create_frame): Pass kb to make_frame_without_minibuffer.
Karl Heuer <kwzh@gnu.org>
parents: 11772
diff changeset
3137 FRAME_KBOARD (f) = kb;
11014
634a98104921 (Fx_create_frame): set the frame's kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10920
diff changeset
3138 #endif
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3139
10222
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3140 /* 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
3141
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3142 if (!NILP (parent))
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3143 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3144 f->output_data.x->parent_desc = parent;
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3145 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
3146 }
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3147 else
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3148 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3149 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
3150 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
3151 }
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3152
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3153 /* 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
3154 f->phys_cursor_x = -1;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3155
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3156 /* 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
3157 be set. */
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3158 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
3159 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3160 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
3161 f->explicit_name = 0;
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3162 }
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3163 else
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3164 {
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3165 f->name = name;
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3166 f->explicit_name = 1;
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3167 /* 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
3168 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
3169 }
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3170
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3171 /* Extract the window parameters from the supplied values
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3172 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
3173 {
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
3174 Lisp_Object font;
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
3175
4259
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3176 font = x_get_arg (parms, Qfont, "font", "Font", string);
4150
e2e92cd737bf * xfns.c (Fx_create_frame): Block input around call to
Jim Blandy <jimb@redhat.com>
parents: 4146
diff changeset
3177 BLOCK_INPUT;
4259
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3178 /* 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
3179 if (STRINGP (font))
4269
fcbdc9cca97a (Fx_create_frame): Typo in previous change.
Richard M. Stallman <rms@gnu.org>
parents: 4259
diff changeset
3180 font = x_new_font (f, XSTRING (font)->data);
4259
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3181 /* 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
3182 if (!STRINGP (font))
8270
1a0af0f4fb1d (Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents: 8192
diff changeset
3183 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
3184 if (! STRINGP (font))
8270
1a0af0f4fb1d (Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents: 8192
diff changeset
3185 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
3186 if (! STRINGP (font))
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3187 /* 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
3188 and takes too long. */
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3189 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
3190 /* 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
3191 if (! STRINGP (font))
8270
1a0af0f4fb1d (Fx_create_frame): Use 140 as default font size.
Richard M. Stallman <rms@gnu.org>
parents: 8192
diff changeset
3192 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
3193 UNBLOCK_INPUT;
e2e92cd737bf * xfns.c (Fx_create_frame): Block input around call to
Jim Blandy <jimb@redhat.com>
parents: 4146
diff changeset
3194 if (! STRINGP (font))
4259
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3195 font = build_string ("fixed");
085095792d99 (Fx_create_frame): Don't look for default font
Richard M. Stallman <rms@gnu.org>
parents: 4195
diff changeset
3196
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
3197 x_default_parameter (f, parms, Qfont, font,
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
3198 "font", "Font", string);
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
3199 }
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3200
15720
f1549b7501af (Fx_create_frame): Do xlwmenu hack only if USE_LUCID.
Karl Heuer <kwzh@gnu.org>
parents: 15706
diff changeset
3201 #ifdef USE_LUCID
9742
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
3202 /* 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
3203 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
3204 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
3205 #endif
9742
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
3206
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3207 x_default_parameter (f, parms, Qborder_width, make_number (2),
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3208 "borderwidth", "BorderWidth", number);
3923
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3209 /* 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
3210 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
3211 it). */
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3212 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
3213 {
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3214 Lisp_Object value;
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3215
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3216 value = x_get_arg (parms, Qinternal_border_width,
16351
ac552926fc7e (x_set_internal_border_width, Fx_create_frame):
Richard M. Stallman <rms@gnu.org>
parents: 16305
diff changeset
3217 "internalBorder", "internalBorder", number);
3923
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3218 if (! EQ (value, Qunbound))
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3219 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
3220 parms);
cb16ebff1c44 * xfns.c (Fx_create_frame): Check for internalBorder resource, as
Jim Blandy <jimb@redhat.com>
parents: 3888
diff changeset
3221 }
16302
025b3dc7a6ba (Fx_create_frame): Default Qinternal_border_width to 1.
Richard M. Stallman <rms@gnu.org>
parents: 16254
diff changeset
3222 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
3223 "internalBorderWidth", "internalBorderWidth", number);
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
3224 x_default_parameter (f, parms, Qvertical_scroll_bars, Qleft,
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
3225 "verticalScrollBars", "ScrollBars", boolean);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3226
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3227 /* 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
3228 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
3229 "foreground", "Foreground", string);
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3230 x_default_parameter (f, parms, 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
3231 "background", "Background", string);
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3232 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
3233 "pointerColor", "Foreground", string);
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3234 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
3235 "cursorColor", "Foreground", string);
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3236 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
3237 "borderColor", "BorderColor", string);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3238
8758
fac1c4722677 (Fx_create_frame): Make 1 the default for menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 8675
diff changeset
3239 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
3240 "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
3241 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
3242 "scrollBarWidth", "ScrollBarWidth", number);
13083
16638ebb209f (Fx_create_frame): Set up buffer-predicate slot.
Richard M. Stallman <rms@gnu.org>
parents: 12832
diff changeset
3243 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
3244 "bufferPredicate", "BufferPredicate", symbol);
14381
4d038c841cf4 (Qtitle): Declared.
Richard M. Stallman <rms@gnu.org>
parents: 14186
diff changeset
3245 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
3246 "title", "Title", string);
6882
3096a6f7fffb (Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents: 6790
diff changeset
3247
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3248 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
3249 window_prompting = x_figure_window_size (f, parms);
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3250
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
3251 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
3252 {
7261
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
3253 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
3254 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
3255 else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3256 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
3257 }
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
3258 else
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
3259 {
a752899939f7 (x_figure_window_size): Handle `-' for top or left.
Richard M. Stallman <rms@gnu.org>
parents: 7251
diff changeset
3260 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
3261 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
3262 else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3263 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
3264 }
675e4ec5f14f (Fx_create_frame): Delete excess args to x_wm_set_size_hint.
Richard M. Stallman <rms@gnu.org>
parents: 6882
diff changeset
3265
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3266 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
3267
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
3268 #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
3269 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
3270 #else
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3271 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
3272 #endif
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3273 x_icon (f, parms);
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3274 x_make_gc (f);
3075
878381e48b0d * xfns.c: Clear out the old face stuff.
Jim Blandy <jimb@redhat.com>
parents: 3048
diff changeset
3275 init_frame_faces (f);
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3276
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3277 /* 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
3278 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
3279 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
3280 "bitmapIcon", "BitmapIcon", symbol);
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3281
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3282 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
3283 "autoRaise", "AutoRaiseLower", boolean);
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3284 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
3285 "autoLower", "AutoRaiseLower", boolean);
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
3286 x_default_parameter (f, parms, Qcursor_type, Qbox,
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
3287 "cursorType", "CursorType", symbol);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
3288
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3289 /* Dimensions, especially f->height, must be done via change_frame_size.
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3290 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
3291 f->height. */
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3292 width = f->width;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3293 height = f->height;
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
3294 f->height = 0;
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
3295 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
3296 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
3297
11707
b0cb8129be58 [USE_X_TOOLKIT] (x_window): Always pass position in geometry.
Richard M. Stallman <rms@gnu.org>
parents: 11611
diff changeset
3298 /* 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
3299 and how badly we want them. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3300 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
3301 x_wm_set_size_hint (f, window_prompting, 0);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3302 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3303
1786
5179baee010b * xfns.c (Fx_create_frame): After mapping the frame, call
Jim Blandy <jimb@redhat.com>
parents: 1733
diff changeset
3304 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean);
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3305 f->no_split = minibuffer_only || EQ (tem, Qt);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3306
8103
b0d56b9856c4 (Fx_create_frame): Add GC protection for local var `f'.
Paul Reilly <pmr@pajato.com>
parents: 8091
diff changeset
3307 UNGCPRO;
b0d56b9856c4 (Fx_create_frame): Add GC protection for local var `f'.
Paul Reilly <pmr@pajato.com>
parents: 8091
diff changeset
3308
5429
87c67c389867 (Fx_list_fonts): Don't fail to init `tail'.
Richard M. Stallman <rms@gnu.org>
parents: 5229
diff changeset
3309 /* 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
3310 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
3311 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
3312 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
3313 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
3314
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3315 /* 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
3316 its display. */
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3317 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
3318
2136
17ab6ed0f98b (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2067
diff changeset
3319 /* 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
3320 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
3321 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
3322 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
3323 {
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3324 Lisp_Object visibility;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3325
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3326 visibility = x_get_arg (parms, Qvisibility, 0, 0, symbol);
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3327 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
3328 visibility = Qt;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3329
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3330 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
3331 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
3332 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
3333 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
3334 else
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3335 /* 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
3336 ;
617bee0c64f6 (x_set_frame_parameters): Handle icon-left, icon-top parms.
Richard M. Stallman <rms@gnu.org>
parents: 10080
diff changeset
3337 }
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3338
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
3339 return unbind_to (count, frame);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3340 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3341
11537
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3342 /* 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
3343 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
3344 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
3345
6485
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3346 Lisp_Object
11537
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3347 x_get_focus_frame (frame)
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3348 struct frame *frame;
6485
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3349 {
11537
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3350 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
3351 Lisp_Object xfocus;
11537
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3352 if (! dpyinfo->x_focus_frame)
6485
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3353 return Qnil;
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3354
11537
9d4df3cf95b3 (x_get_focus_frame): New arg FRAME. Callers changed.
Karl Heuer <kwzh@gnu.org>
parents: 11496
diff changeset
3355 XSETFRAME (xfocus, dpyinfo->x_focus_frame);
6485
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3356 return xfocus;
b0825eef18b1 (x_get_focus_frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6480
diff changeset
3357 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3358
16041
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3359 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
3360 "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
3361 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
3362 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
3363 \n\
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3364 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
3365 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
3366 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
3367 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
3368 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
3369 \n\
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3370 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
3371 set-face-font.\n\
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3372 \n\
6783
3122395ded44 (Fx_list_fonts): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 6770
diff changeset
3373 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
3374 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
3375 \n\
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3376 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
3377 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
3378 (pattern, face, frame, maximum)
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3379 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
3380 {
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3381 int num_fonts;
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3382 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
3383 #ifndef BROKEN_XLISTFONTSWITHINFO
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3384 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
3385 #endif
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3386 XFontStruct *size_ref;
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3387 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
3388 FRAME_PTR f;
16041
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3389 Lisp_Object key;
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3390 int maxnames;
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3391
5948
ef777779bd80 (check_x): Make it global.
Karl Heuer <kwzh@gnu.org>
parents: 5900
diff changeset
3392 check_x ();
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3393 CHECK_STRING (pattern, 0);
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3394 if (!NILP (face))
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3395 CHECK_SYMBOL (face, 1);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3396
16041
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3397 if (NILP (maximum))
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3398 maxnames = 2000;
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3399 else
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3400 {
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3401 CHECK_NATNUM (maximum, 0);
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3402 maxnames = XINT (maximum);
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3403 }
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3404
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3405 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
3406
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3407 /* 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
3408
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3409 if (NILP (face))
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3410 size_ref = 0;
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3411 else
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3412 {
6882
3096a6f7fffb (Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents: 6790
diff changeset
3413 int face_id;
3096a6f7fffb (Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents: 6790
diff changeset
3414
3096a6f7fffb (Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents: 6790
diff changeset
3415 /* 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
3416 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
3417 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
3418
3096a6f7fffb (Fx_list_fonts): Error if non-X frame used.
Richard M. Stallman <rms@gnu.org>
parents: 6790
diff changeset
3419 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
3420
3881
9d92b383b584 Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents: 3821
diff changeset
3421 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
3422 || 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
3423 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
3424 else
53c89f73e85a (Fx_create_frame): Use bitmapIcon, not iconType.
Richard M. Stallman <rms@gnu.org>
parents: 3339
diff changeset
3425 {
3881
9d92b383b584 Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents: 3821
diff changeset
3426 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
3427 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
3428 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
3429 }
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3430 }
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3431
9014
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3432 /* 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
3433 key = Fcons (pattern, maximum);
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3434 list = Fassoc (key,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3435 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
3436
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3437 /* 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
3438 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
3439 {
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3440 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
3441
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3442 /* 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
3443 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
3444
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3445 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
3446 return list;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3447
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3448 BLOCK_INPUT;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3449
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3450 /* 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
3451 newlist = Qnil;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3452 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
3453 {
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3454 XFontStruct *thisinfo;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3455
14979
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3456 x_catch_errors (FRAME_X_DISPLAY (f));
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3457
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3458 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
3459 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
3460
14979
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3461 x_check_errors (FRAME_X_DISPLAY (f), "XLoadQueryFont failure: %s");
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3462 x_uncatch_errors (FRAME_X_DISPLAY (f));
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3463
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3464 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
3465 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
3466
12546
f4fb791df099 (Fx_list_fonts): Don't free thisinfo if it is 0.
Karl Heuer <kwzh@gnu.org>
parents: 12470
diff changeset
3467 if (thisinfo != 0)
f4fb791df099 (Fx_list_fonts): Don't free thisinfo if it is 0.
Karl Heuer <kwzh@gnu.org>
parents: 12470
diff changeset
3468 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
3469 }
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3470
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3471 UNBLOCK_INPUT;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3472
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3473 return newlist;
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3474 }
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3475
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3476 BLOCK_INPUT;
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3477
14979
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3478 x_catch_errors (FRAME_X_DISPLAY (f));
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3479
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3480 /* 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
3481 #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
3482 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
3483 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
3484 XSTRING (pattern)->data,
16041
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3485 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
3486 &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
3487 &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
3488 else
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3489 #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
3490 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
3491 XSTRING (pattern)->data,
16041
737a86ba36d7 (Fx_list_fonts): New optional arg MAXIMUM.
Richard M. Stallman <rms@gnu.org>
parents: 15999
diff changeset
3492 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
3493 &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
3494
14979
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3495 x_check_errors (FRAME_X_DISPLAY (f), "XListFonts failure: %s");
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3496 x_uncatch_errors (FRAME_X_DISPLAY (f));
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3497
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3498 UNBLOCK_INPUT;
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3499
3640
df1a2751ca24 (Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3500 list = Qnil;
df1a2751ca24 (Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3501
df1a2751ca24 (Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3502 if (names)
df1a2751ca24 (Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3503 {
df1a2751ca24 (Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3504 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
3505 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
3506
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3507 /* 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
3508 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
3509 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
3510 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
3511 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
3512 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
3513 = 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
3514 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
3515
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3516 /* 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
3517 list = Qnil;
3640
df1a2751ca24 (Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3518 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
3519 {
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
3520 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
3521
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
3522 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
3523 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
3524 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
3525 {
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3526 #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
3527 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
3528
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
3529 BLOCK_INPUT;
14979
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3530
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3531 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
3532 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
3533 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
3534 "XLoadQueryFont failure: %s");
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3535 x_uncatch_errors (FRAME_X_DISPLAY (f));
fc1c21bc2e05 (Fx_list_fonts): Handle X protocol errors.
Richard M. Stallman <rms@gnu.org>
parents: 14965
diff changeset
3536
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
3537 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
3538
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
3539 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
3540 BLOCK_INPUT;
2ae4beb73bf5 (Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents: 15022
diff changeset
3541 if (thisinfo && ! keeper)
2ae4beb73bf5 (Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents: 15022
diff changeset
3542 XFreeFont (FRAME_X_DISPLAY (f), thisinfo);
2ae4beb73bf5 (Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents: 15022
diff changeset
3543 else if (thisinfo)
2ae4beb73bf5 (Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents: 15022
diff changeset
3544 XFreeFontInfo (NULL, thisinfo, 1);
2ae4beb73bf5 (Fx_list_fonts) [BROKEN_XLISTFONTSWITHINFO]:
Richard M. Stallman <rms@gnu.org>
parents: 15022
diff changeset
3545 UNBLOCK_INPUT;
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3546 #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
3547 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
3548 #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
3549 }
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
3550 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
3551 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
3552 }
9014
7b805f79f3b4 (Fx_list_fonts): Use a cache stored in FRAME_X_SCREEN.
Richard M. Stallman <rms@gnu.org>
parents: 8961
diff changeset
3553 list = Fnreverse (list);
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3554
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3555 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
3556 #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
3557 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
3558 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
3559 else
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3560 #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
3561 XFreeFontNames (names);
5229
110539a25499 (Fx_list_fonts): Handle BROKEN_XLISTFONTSWITHINFO.
Richard M. Stallman <rms@gnu.org>
parents: 5193
diff changeset
3562 UNBLOCK_INPUT;
3640
df1a2751ca24 (Fx_list_fonts): If names is 0, just return nil.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3563 }
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3564
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3565 return list;
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3566 }
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3567
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
3568
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3569 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
3570 "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
3571 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
3572 (color, frame)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3573 Lisp_Object color, frame;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3574 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3575 XColor foo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3576 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
3577
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3578 CHECK_STRING (color, 1);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3579
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3580 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
3581 return Qt;
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3582 else
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3583 return Qnil;
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3584 }
1fe413b0a916 (defined_color): New arg ALLOC--optionally don't allocate the color.
Richard M. Stallman <rms@gnu.org>
parents: 8655
diff changeset
3585
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3586 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
3587 "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
3588 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
3589 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
3590 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
3591 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
3592 (color, frame)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3593 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
3594 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3595 XColor foo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3596 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
3597
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3598 CHECK_STRING (color, 1);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3599
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3600 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
3601 {
4c69fcaaa037 (Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents: 8405
diff changeset
3602 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
3603
4c69fcaaa037 (Fx_color_defined_p): Return list of RGB values, not just t.
Richard M. Stallman <rms@gnu.org>
parents: 8405
diff changeset
3604 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
3605 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
3606 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
3607 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
3608 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3609 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3610 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3611 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3612
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3613 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
3614 "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
3615 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
3616 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
3617 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
3618 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3619 Lisp_Object display;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3620 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3621 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
3622
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3623 if (dpyinfo->n_planes <= 2)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3624 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3625
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3626 switch (dpyinfo->visual->class)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3627 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3628 case StaticColor:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3629 case PseudoColor:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3630 case TrueColor:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3631 case DirectColor:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3632 return Qt;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3633
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3634 default:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3635 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3636 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3637 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3638
8779
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
3639 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
3640 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3641 "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
3642 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
3643 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
3644 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
3645 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
3646 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3647 Lisp_Object display;
8779
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
3648 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3649 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
3650
12347
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3651 if (dpyinfo->n_planes <= 1)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3652 return Qnil;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3653
12347
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3654 switch (dpyinfo->visual->class)
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3655 {
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3656 case StaticColor:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3657 case PseudoColor:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3658 case TrueColor:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3659 case DirectColor:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3660 case StaticGray:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3661 case GrayScale:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3662 return Qt;
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3663
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3664 default:
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3665 return Qnil;
0731c1ec96ad (Fx_display_grayscale_p): Return t or nil.
Richard M. Stallman <rms@gnu.org>
parents: 12316
diff changeset
3666 }
8779
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
3667 }
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
3668
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3669 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
3670 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3671 "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
3672 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
3673 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
3674 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
3675 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3676 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3677 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3678 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
3679
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3680 return make_number (dpyinfo->width);
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3681 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3682
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3683 DEFUN ("x-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
3684 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
3685 "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
3686 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
3687 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
3688 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
3689 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3690 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3691 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3692 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
3693
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3694 return make_number (dpyinfo->height);
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3695 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3696
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3697 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
3698 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3699 "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
3700 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
3701 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
3702 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
3703 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3704 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3705 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3706 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
3707
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3708 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
3709 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3710
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3711 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
3712 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3713 "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
3714 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
3715 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
3716 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
3717 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3718 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3719 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3720 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
3721
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3722 return make_number (DisplayCells (dpyinfo->display,
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3723 XScreenNumberOfScreen (dpyinfo->screen)));
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3724 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3725
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3726 DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3727 Sx_server_max_request_size,
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3728 0, 1, 0,
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3729 "Returns the 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
3730 The optional argument DISPLAY specifies which display to ask about.\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3731 DISPLAY should be either a frame or a display name (a string).\n\
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3732 If omitted or nil, that stands for the selected frame's display.")
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3733 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3734 Lisp_Object display;
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3735 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3736 struct x_display_info *dpyinfo = check_x_display_info (display);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3737
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3738 return make_number (MAXREQUEST (dpyinfo->display));
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3739 }
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
3740
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3741 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
3742 "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
3743 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
3744 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
3745 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
3746 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3747 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3748 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3749 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
3750 char *vendor = ServerVendor (dpyinfo->display);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3751
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3752 if (! vendor) vendor = "";
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3753 return build_string (vendor);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3754 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3755
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3756 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
3757 "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
3758 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
3759 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
3760 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
3761 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
3762 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
3763 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
3764 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3765 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3766 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3767 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
3768 Display *dpy = dpyinfo->display;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3769
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3770 return Fcons (make_number (ProtocolVersion (dpy)),
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3771 Fcons (make_number (ProtocolRevision (dpy)),
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3772 Fcons (make_number (VendorRelease (dpy)), Qnil)));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3773 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3774
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3775 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
3776 "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
3777 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
3778 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
3779 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
3780 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3781 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3782 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3783 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
3784
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3785 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
3786 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3787
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3788 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
3789 "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
3790 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
3791 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
3792 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
3793 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3794 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3795 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3796 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
3797
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3798 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
3799 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3800
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3801 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
3802 "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
3803 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
3804 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
3805 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
3806 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3807 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3808 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3809 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
3810
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3811 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
3812 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3813
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3814 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
3815 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
3816 "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
3817 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
3818 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
3819 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
3820 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
3821 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3822 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3823 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3824 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
3825
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3826 switch (DoesBackingStore (dpyinfo->screen))
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3827 {
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3828 case Always:
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3829 return intern ("always");
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3830
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3831 case WhenMapped:
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3832 return intern ("when-mapped");
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 case NotUseful:
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3835 return intern ("not-useful");
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3836
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3837 default:
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3838 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
3839 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3840 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3841
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3842 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
3843 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
3844 "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
3845 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
3846 `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
3847 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
3848 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
3849 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
3850 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3851 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3852 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3853 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
3854
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3855 switch (dpyinfo->visual->class)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3856 {
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3857 case StaticGray: return (intern ("static-gray"));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3858 case GrayScale: return (intern ("gray-scale"));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3859 case StaticColor: return (intern ("static-color"));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3860 case PseudoColor: return (intern ("pseudo-color"));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3861 case TrueColor: return (intern ("true-color"));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3862 case DirectColor: return (intern ("direct-color"));
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3863 default:
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3864 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
3865 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3866 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3867
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3868 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
3869 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
3870 "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
3871 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
3872 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
3873 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
3874 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3875 Lisp_Object display;
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3876 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
3877 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
3878
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3879 if (DoesSaveUnders (dpyinfo->screen) == True)
2276
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3880 return Qt;
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3881 else
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3882 return Qnil;
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3883 }
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
3884
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3885 int
2067
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3886 x_pixel_width (f)
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3887 register struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3888 {
2067
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3889 return PIXEL_WIDTH (f);
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3890 }
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3891
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3892 int
2067
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3893 x_pixel_height (f)
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3894 register struct frame *f;
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3895 {
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3896 return PIXEL_HEIGHT (f);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3897 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3898
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3899 int
2067
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3900 x_char_width (f)
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3901 register struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3902 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3903 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
3904 }
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3905
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3906 int
2067
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3907 x_char_height (f)
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3908 register struct frame *f;
0a353ddd4bf4 (Fx_pixel_width, Fx_pixel_height): Fns deleted.
Richard M. Stallman <rms@gnu.org>
parents: 1994
diff changeset
3909 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3910 return f->output_data.x->line_height;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3911 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3912
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3913 int
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3914 x_screen_planes (frame)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3915 Lisp_Object frame;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3916 {
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3917 return FRAME_X_DISPLAY_INFO (XFRAME (frame))->n_planes;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3918 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3919
689
45401d45581d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 687
diff changeset
3920 #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
3921
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3922 /* Draw a rectangle on the frame with left top corner including
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3923 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
3924 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
3925
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3926 void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3927 x_rectangle (f, gc, left_char, top_char, chars, lines)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3928 register struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3929 GC gc;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3930 register int top_char, left_char, chars, lines;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3931 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3932 int width;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3933 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
3934 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
3935 + 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
3936 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
3937 + f->output_data.x->internal_border_width);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3938
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3939 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
3940 width = FONT_WIDTH (f->output_data.x->font) / 2;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3941 else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3942 width = FONT_WIDTH (f->output_data.x->font) * chars;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3943 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
3944 height = f->output_data.x->line_height / 2;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3945 else
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
3946 height = f->output_data.x->line_height * lines;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3947
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
3948 XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3949 gc, left, top, width, height);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3950 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3951
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3952 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
3953 "Draw a rectangle on FRAME between coordinates specified by\n\
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3954 numbers X0, Y0, X1, Y1 in the cursor pixel.")
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3955 (frame, X0, Y0, X1, Y1)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3956 register Lisp_Object frame, X0, X1, Y0, Y1;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3957 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3958 register int x0, y0, x1, y1, top, left, n_chars, n_lines;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3959
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
3960 CHECK_LIVE_FRAME (frame, 0);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3961 CHECK_NUMBER (X0, 0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3962 CHECK_NUMBER (Y0, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3963 CHECK_NUMBER (X1, 2);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3964 CHECK_NUMBER (Y1, 3);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3965
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3966 x0 = XINT (X0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3967 x1 = XINT (X1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3968 y0 = XINT (Y0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3969 y1 = XINT (Y1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3970
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3971 if (y1 > y0)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3972 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3973 top = y0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3974 n_lines = y1 - y0 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3975 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3976 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3977 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3978 top = y1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3979 n_lines = y0 - y1 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3980 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3981
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3982 if (x1 > x0)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3983 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3984 left = x0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3985 n_chars = x1 - x0 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3986 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3987 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3988 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3989 left = x1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3990 n_chars = x0 - x1 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3991 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3992
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3993 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
3994 x_rectangle (XFRAME (frame), XFRAME (frame)->output_data.x->cursor_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3995 left, top, n_chars, n_lines);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3996 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3997
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3998 return Qt;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3999 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4000
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4001 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
4002 "Draw a rectangle drawn on FRAME between coordinates\n\
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4003 X0, Y0, X1, Y1 in the regular background-pixel.")
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4004 (frame, X0, Y0, X1, Y1)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4005 register Lisp_Object frame, X0, Y0, X1, Y1;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4006 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4007 register int x0, y0, x1, y1, top, left, n_chars, n_lines;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4008
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4009 CHECK_LIVE_FRAME (frame, 0);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4010 CHECK_NUMBER (X0, 0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4011 CHECK_NUMBER (Y0, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4012 CHECK_NUMBER (X1, 2);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4013 CHECK_NUMBER (Y1, 3);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4014
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4015 x0 = XINT (X0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4016 x1 = XINT (X1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4017 y0 = XINT (Y0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4018 y1 = XINT (Y1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4019
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4020 if (y1 > y0)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4021 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4022 top = y0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4023 n_lines = y1 - y0 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4024 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4025 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4026 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4027 top = y1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4028 n_lines = y0 - y1 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4029 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4030
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4031 if (x1 > x0)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4032 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4033 left = x0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4034 n_chars = x1 - x0 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4035 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4036 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4037 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4038 left = x1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4039 n_chars = x0 - x1 + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4040 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4041
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4042 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
4043 x_rectangle (XFRAME (frame), XFRAME (frame)->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4044 left, top, n_chars, n_lines);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4045 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4046
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4047 return Qt;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4048 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4049
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4050 /* Draw lines around the text region beginning at the character position
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4051 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
4052 pixel and line characteristics. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4053
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4054 #define line_len(line) (FRAME_CURRENT_GLYPHS (f)->used[(line)])
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4055
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4056 static void
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4057 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
4058 register struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4059 GC gc;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4060 int top_x, top_y, bottom_x, bottom_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4061 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4062 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
4063 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
4064 register int font_h = f->output_data.x->line_height;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4065 int y = top_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4066 int x = line_len (y);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
4067 XPoint *pixel_points
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
4068 = (XPoint *) alloca (((bottom_y - top_y + 2) * 4) * sizeof (XPoint));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4069 register XPoint *this_point = pixel_points;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4070
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4071 /* Do the horizontal top line/lines */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4072 if (top_x == 0)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4073 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4074 this_point->x = ibw;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4075 this_point->y = ibw + (font_h * top_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4076 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4077 if (x == 0)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4078 this_point->x = ibw + (font_w / 2); /* Half-size for newline chars. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4079 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4080 this_point->x = ibw + (font_w * x);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4081 this_point->y = (this_point - 1)->y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4082 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4083 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4084 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4085 this_point->x = ibw;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4086 this_point->y = ibw + (font_h * (top_y + 1));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4087 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4088 this_point->x = ibw + (font_w * top_x);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4089 this_point->y = (this_point - 1)->y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4090 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4091 this_point->x = (this_point - 1)->x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4092 this_point->y = ibw + (font_h * top_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4093 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4094 this_point->x = ibw + (font_w * x);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4095 this_point->y = (this_point - 1)->y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4096 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4097
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4098 /* Now do the right side. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4099 while (y < bottom_y)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4100 { /* Right vertical edge */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4101 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4102 this_point->x = (this_point - 1)->x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4103 this_point->y = ibw + (font_h * (y + 1));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4104 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4105
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4106 y++; /* Horizontal connection to next line */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4107 x = line_len (y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4108 if (x == 0)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4109 this_point->x = ibw + (font_w / 2);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4110 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4111 this_point->x = ibw + (font_w * x);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4112
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4113 this_point->y = (this_point - 1)->y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4114 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4115
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4116 /* Now do the bottom and connect to the top left point. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4117 this_point->x = ibw + (font_w * (bottom_x + 1));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4118
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4119 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4120 this_point->x = (this_point - 1)->x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4121 this_point->y = ibw + (font_h * (bottom_y + 1));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4122 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4123 this_point->x = ibw;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4124 this_point->y = (this_point - 1)->y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4125 this_point++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4126 this_point->x = pixel_points->x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4127 this_point->y = pixel_points->y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4128
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4129 XDrawLines (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4130 gc, pixel_points,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4131 (this_point - pixel_points + 1), CoordModeOrigin);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4132 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4133
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4134 DEFUN ("x-contour-region", Fx_contour_region, Sx_contour_region, 1, 1, 0,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4135 "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
4136 selected frame.")
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4137 (event)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4138 register Lisp_Object event;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4139 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4140 register int x0, y0, x1, y1;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4141 register struct frame *f = selected_frame;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4142 register int p1, p2;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4143
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4144 CHECK_CONS (event, 0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4145
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4146 BLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4147 x0 = XINT (Fcar (Fcar (event)));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4148 y0 = XINT (Fcar (Fcdr (Fcar (event))));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4149
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4150 /* 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
4151 /* ReWrite this... */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4152
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4153 x1 = f->cursor_x;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4154 y1 = f->cursor_y;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4155
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4156 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
4157 outline_region (f, f->output_data.x->cursor_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4158 x0, y0, x1, y1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4159 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
4160 outline_region (f, f->output_data.x->cursor_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4161 x1, y1, x0, y0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4162 else /* same line: draw horizontal rectangle */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4163 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4164 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
4165 x_rectangle (f, f->output_data.x->cursor_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4166 x0, y0, (x1 - x0 + 1), 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4167 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
4168 x_rectangle (f, f->output_data.x->cursor_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4169 x1, y1, (x0 - x1 + 1), 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4170 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4171
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4172 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4173 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4174
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4175 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4176 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4177
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4178 DEFUN ("x-uncontour-region", Fx_uncontour_region, Sx_uncontour_region, 1, 1, 0,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4179 "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
4180 at X, Y on the selected frame.")
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4181 (event)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4182 register Lisp_Object event;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4183 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4184 register int x0, y0, x1, y1;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4185 register struct frame *f = selected_frame;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4186
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4187 BLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4188 x0 = XINT (Fcar (Fcar (event)));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4189 y0 = XINT (Fcar (Fcdr (Fcar (event))));
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4190 x1 = f->cursor_x;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4191 y1 = f->cursor_y;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4192
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4193 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
4194 outline_region (f, f->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4195 x0, y0, x1, y1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4196 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
4197 outline_region (f, f->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4198 x1, y1, x0, y0);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4199 else /* same line: draw horizontal rectangle */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4200 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4201 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
4202 x_rectangle (f, f->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4203 x0, y0, (x1 - x0 + 1), 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4204 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
4205 x_rectangle (f, f->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4206 x1, y1, (x0 - x1 + 1), 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4207 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4208 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4209
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4210 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4211 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4212
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4213 #if 0
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4214 int contour_begin_x, contour_begin_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4215 int contour_end_x, contour_end_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4216 int contour_npoints;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4217
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4218 /* 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
4219 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
4220 down a line at that character. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4221
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4222 static void
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4223 clip_contour_top (y_pos, x_pos)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4224 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4225 register XPoint *begin = contour_lines[y_pos].top_left;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4226 register XPoint *end;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4227 register int npoints;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4228 register struct display_line *line = selected_frame->phys_lines[y_pos + 1];
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4229
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4230 if (x_pos >= line->len - 1) /* Draw one, straight horizontal line. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4231 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4232 end = contour_lines[y_pos].top_right;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4233 npoints = (end - begin + 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4234 XDrawLines (x_current_display, contour_window,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4235 contour_erase_gc, begin_erase, npoints, CoordModeOrigin);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4236
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4237 bcopy (end, begin + 1, contour_last_point - end + 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4238 contour_last_point -= (npoints - 2);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4239 XDrawLines (x_current_display, contour_window,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4240 contour_erase_gc, begin, 2, CoordModeOrigin);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4241 XFlush (x_current_display);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4242
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4243 /* Now, update contour_lines structure. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4244 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4245 /* ______. */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4246 else /* |________*/
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4247 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4248 register XPoint *p = begin + 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4249 end = contour_lines[y_pos].bottom_right;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4250 npoints = (end - begin + 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4251 XDrawLines (x_current_display, contour_window,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4252 contour_erase_gc, begin_erase, npoints, CoordModeOrigin);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4253
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4254 p->y = begin->y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4255 p->x = ibw + (font_w * (x_pos + 1));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4256 p++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4257 p->y = begin->y + font_h;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4258 p->x = (p - 1)->x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4259 bcopy (end, begin + 3, contour_last_point - end + 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4260 contour_last_point -= (npoints - 5);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4261 XDrawLines (x_current_display, contour_window,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4262 contour_erase_gc, begin, 4, CoordModeOrigin);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4263 XFlush (x_current_display);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4264
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4265 /* Now, update contour_lines structure. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4266 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4267 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4268
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 3512
diff changeset
4269 /* 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
4270 the contour upwards. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4271
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4272 static void
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4273 extend_contour_top (line)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4274 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4275 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4276
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4277 static void
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4278 clip_contour_bottom (x_pos, y_pos)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4279 int x_pos, y_pos;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4280 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4281 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4282
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4283 static void
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4284 extend_contour_bottom (x_pos, y_pos)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4285 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4286 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4287
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4288 DEFUN ("x-select-region", Fx_select_region, Sx_select_region, 1, 1, "e",
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4289 "")
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4290 (event)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4291 Lisp_Object event;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4292 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4293 register struct frame *f = selected_frame;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4294 register int point_x = f->cursor_x;
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4295 register int point_y = f->cursor_y;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4296 register int mouse_below_point;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4297 register Lisp_Object obj;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4298 register int x_contour_x, x_contour_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4299
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4300 x_contour_x = x_mouse_x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4301 x_contour_y = x_mouse_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4302 if (x_contour_y > point_y || (x_contour_y == point_y
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4303 && x_contour_x > point_x))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4304 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4305 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
4306 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
4307 x_contour_x, x_contour_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4308 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4309 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4310 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4311 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
4312 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
4313 point_x, point_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4314 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4315
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4316 while (1)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4317 {
1096
d79192bacdce (Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents: 1050
diff changeset
4318 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
4319 if (!CONSP (obj))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4320 break;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4321
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4322 if (mouse_below_point)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4323 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4324 if (x_mouse_y <= point_y) /* Flipped. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4325 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4326 mouse_below_point = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4327
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4328 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
4329 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
4330 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
4331 point_x, point_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4332 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4333 else if (x_mouse_y < x_contour_y) /* Bottom clipped. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4334 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4335 clip_contour_bottom (x_mouse_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4336 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4337 else if (x_mouse_y > x_contour_y) /* Bottom extended. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4338 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4339 extend_bottom_contour (x_mouse_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4340 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4341
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4342 x_contour_x = x_mouse_x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4343 x_contour_y = x_mouse_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4344 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4345 else /* mouse above or same line as point */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4346 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4347 if (x_mouse_y >= point_y) /* Flipped. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4348 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4349 mouse_below_point = 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4350
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4351 outline_region (f, f->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4352 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
4353 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
4354 x_mouse_x, x_mouse_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4355 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4356 else if (x_mouse_y > x_contour_y) /* Top clipped. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4357 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4358 clip_contour_top (x_mouse_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4359 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4360 else if (x_mouse_y < x_contour_y) /* Top extended. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4361 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4362 extend_contour_top (x_mouse_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4363 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4364 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4365 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4366
1601
a371ec79bc31 * xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents: 1528
diff changeset
4367 unread_command_event = obj;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4368 if (mouse_below_point)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4369 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4370 contour_begin_x = point_x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4371 contour_begin_y = point_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4372 contour_end_x = x_contour_x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4373 contour_end_y = x_contour_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4374 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4375 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4376 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4377 contour_begin_x = x_contour_x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4378 contour_begin_y = x_contour_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4379 contour_end_x = point_x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4380 contour_end_y = point_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4381 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4382 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4383 #endif
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4384
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4385 DEFUN ("x-horizontal-line", Fx_horizontal_line, Sx_horizontal_line, 1, 1, "e",
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4386 "")
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4387 (event)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4388 Lisp_Object event;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4389 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4390 register Lisp_Object obj;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4391 struct frame *f = selected_frame;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4392 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
4393 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
4394 register GC erase_gc = f->output_data.x->reverse_gc;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4395 #if 0
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4396 char dash_list[] = {6, 4, 6, 4};
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4397 int dashes = 4;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4398 XGCValues gc_values;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4399 #endif
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4400 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
4401 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
4402 + 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
4403 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
4404 + (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
4405 * FONT_WIDTH (f->output_data.x->font));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4406 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
4407 * 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
4408 - f->output_data.x->internal_border_width;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4409
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4410 #if 0
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4411 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
4412 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
4413 gc_values.background = f->output_data.x->background_pixel;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4414 gc_values.line_width = 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4415 gc_values.line_style = LineOnOffDash;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4416 gc_values.cap_style = CapRound;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4417 gc_values.join_style = JoinRound;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4418
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4419 line_gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4420 GCLineStyle | GCJoinStyle | GCCapStyle
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4421 | GCLineWidth | GCForeground | GCBackground,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4422 &gc_values);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4423 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
4424 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
4425 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
4426 erase_gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4427 GCLineStyle | GCJoinStyle | GCCapStyle
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4428 | GCLineWidth | GCForeground | GCBackground,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4429 &gc_values);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4430 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
4431 UNBLOCK_INPUT;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4432 #endif
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4433
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4434 while (1)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4435 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4436 BLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4437 if (x_mouse_y >= XINT (w->top)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4438 && x_mouse_y < XINT (w->top) + XINT (w->height) - 1)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4439 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4440 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
4441 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
4442 + 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
4443 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4444 line_gc, left, line, right, line);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4445 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4446 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4447 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4448
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4449 do
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4450 {
1096
d79192bacdce (Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents: 1050
diff changeset
4451 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
4452 if (!CONSP (obj)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4453 || (! 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
4454 Qvertical_scroll_bar))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4455 || x_mouse_grabbed)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4456 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4457 BLOCK_INPUT;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4458 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4459 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
4460 unread_command_event = obj;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4461 #if 0
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4462 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
4463 XFreeGC (FRAME_X_DISPLAY (f), erase_gc);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4464 #endif
12051
f193ce9efe24 (x_destroy_bitmap): Block and unblock input.
Karl Heuer <kwzh@gnu.org>
parents: 12046
diff changeset
4465 UNBLOCK_INPUT;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4466 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4467 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4468 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4469 while (x_mouse_y == previous_y);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4470
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4471 BLOCK_INPUT;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4472 XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4473 erase_gc, left, line, right, line);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4474 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4475 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4476 }
687
e2b747dd6a6e *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 642
diff changeset
4477 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4478
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4479 #if 0
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4480 /* 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
4481 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
4482
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4483 /* Offset in buffer of character under the pointer, or 0. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4484 int mouse_buffer_offset;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4485
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4486 DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 0, 0, 0,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4487 "Track the pointer.")
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 static Cursor current_pointer_shape;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4491 FRAME_PTR f = x_mouse_frame;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4492
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4493 BLOCK_INPUT;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4494 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
4495 && (current_pointer_shape != f->output_data.x->nontext_cursor))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4496 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4497 unsigned char c;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4498 struct buffer *buf;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4499
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4500 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
4501 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
4502 FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4503 current_pointer_shape);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4504
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4505 buf = XBUFFER (XWINDOW (Vmouse_window)->buffer);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4506 c = *(BUF_CHAR_ADDRESS (buf, mouse_buffer_offset));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4507 }
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4508 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
4509 && (current_pointer_shape != f->output_data.x->modeline_cursor))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4510 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4511 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
4512 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
4513 FRAME_X_WINDOW (f),
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4514 current_pointer_shape);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4515 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4516
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4517 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4518 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4519 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4520 #endif
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4521
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4522 #if 0
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4523 DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 1, 1, "e",
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4524 "Draw rectangle around character under mouse pointer, if there is one.")
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4525 (event)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4526 Lisp_Object event;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4527 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4528 struct window *w = XWINDOW (Vmouse_window);
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4529 struct frame *f = XFRAME (WINDOW_FRAME (w));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4530 struct buffer *b = XBUFFER (w->buffer);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4531 Lisp_Object obj;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4532
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4533 if (! EQ (Vmouse_window, selected_window))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4534 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4535
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4536 if (EQ (event, Qnil))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4537 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4538 int x, y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4539
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4540 x_read_mouse_position (selected_frame, &x, &y);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4541 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4542
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4543 BLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4544 mouse_track_width = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4545 mouse_track_left = mouse_track_top = -1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4546
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4547 do
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4548 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4549 if ((x_mouse_x != mouse_track_left
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4550 && (x_mouse_x < mouse_track_left
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4551 || x_mouse_x > (mouse_track_left + mouse_track_width)))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4552 || x_mouse_y != mouse_track_top)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4553 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4554 int hp = 0; /* Horizontal position */
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4555 int len = FRAME_CURRENT_GLYPHS (f)->used[x_mouse_y];
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4556 int p = FRAME_CURRENT_GLYPHS (f)->bufp[x_mouse_y];
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4557 int tab_width = XINT (b->tab_width);
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 436
diff changeset
4558 int ctl_arrow_p = !NILP (b->ctl_arrow);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4559 unsigned char c;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4560 int mode_line_vpos = XFASTINT (w->height) + XFASTINT (w->top) - 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4561 int in_mode_line = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4562
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4563 if (! FRAME_CURRENT_GLYPHS (f)->enable[x_mouse_y])
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4564 break;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4565
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4566 /* Erase previous rectangle. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4567 if (mouse_track_width)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4568 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4569 x_rectangle (f, f->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4570 mouse_track_left, mouse_track_top,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4571 mouse_track_width, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4572
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4573 if ((mouse_track_left == f->phys_cursor_x
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4574 || mouse_track_left == f->phys_cursor_x - 1)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4575 && mouse_track_top == f->phys_cursor_y)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4576 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4577 x_display_cursor (f, 1);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4578 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4579 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4580
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4581 mouse_track_left = x_mouse_x;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4582 mouse_track_top = x_mouse_y;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4583 mouse_track_width = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4584
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4585 if (mouse_track_left > len) /* Past the end of line. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4586 goto draw_or_not;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4587
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4588 if (mouse_track_top == mode_line_vpos)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4589 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4590 in_mode_line = 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4591 goto draw_or_not;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4592 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4593
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4594 if (tab_width <= 0 || tab_width > 20) tab_width = 8;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4595 do
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4596 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4597 c = FETCH_CHAR (p);
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4598 if (len == f->width && hp == len - 1 && c != '\n')
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4599 goto draw_or_not;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4600
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4601 switch (c)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4602 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4603 case '\t':
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4604 mouse_track_width = tab_width - (hp % tab_width);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4605 p++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4606 hp += mouse_track_width;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4607 if (hp > x_mouse_x)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4608 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4609 mouse_track_left = hp - mouse_track_width;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4610 goto draw_or_not;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4611 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4612 continue;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4613
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4614 case '\n':
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4615 mouse_track_width = -1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4616 goto draw_or_not;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4617
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4618 default:
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4619 if (ctl_arrow_p && (c < 040 || c == 0177))
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4620 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4621 if (p > ZV)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4622 goto draw_or_not;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4623
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4624 mouse_track_width = 2;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4625 p++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4626 hp +=2;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4627 if (hp > x_mouse_x)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4628 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4629 mouse_track_left = hp - mouse_track_width;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4630 goto draw_or_not;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4631 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4632 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4633 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4634 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4635 mouse_track_width = 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4636 p++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4637 hp++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4638 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4639 continue;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4640 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4641 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4642 while (hp <= x_mouse_x);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4643
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4644 draw_or_not:
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4645 if (mouse_track_width) /* Over text; use text pointer shape. */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4646 {
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4647 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
4648 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
4649 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
4650 x_rectangle (f, f->output_data.x->cursor_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4651 mouse_track_left, mouse_track_top,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4652 mouse_track_width, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4653 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4654 else if (in_mode_line)
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4655 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
4656 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
4657 f->output_data.x->modeline_cursor);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4658 else
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4659 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
4660 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
4661 f->output_data.x->nontext_cursor);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4662 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4663
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4664 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4665 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4666
1096
d79192bacdce (Fx_track_pointer): Pass new args to read_char.
Richard M. Stallman <rms@gnu.org>
parents: 1050
diff changeset
4667 obj = read_char (-1, 0, 0, Qnil, 0);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4668 BLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4669 }
9103
948e8acb6990 (x_set_frame_parameters, x_set_menu_bar_lines, Fx_create_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9022
diff changeset
4670 while (CONSP (obj) /* Mouse event */
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
4671 && EQ (Fcar (Fcdr (Fcdr (obj))), Qnil) /* Not scroll bar */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4672 && EQ (Vmouse_depressed, Qnil) /* Only motion events */
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4673 && EQ (Vmouse_window, selected_window) /* In this window */
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4674 && x_mouse_frame);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4675
1601
a371ec79bc31 * xfns.c (unread_command_char): Change name in extern declaration
Jim Blandy <jimb@redhat.com>
parents: 1528
diff changeset
4676 unread_command_event = obj;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4677
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4678 if (mouse_track_width)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4679 {
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12656
diff changeset
4680 x_rectangle (f, f->output_data.x->reverse_gc,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4681 mouse_track_left, mouse_track_top,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4682 mouse_track_width, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4683 mouse_track_width = 0;
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4684 if ((mouse_track_left == f->phys_cursor_x
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4685 || mouse_track_left - 1 == f->phys_cursor_x)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4686 && mouse_track_top == f->phys_cursor_y)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4687 {
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4688 x_display_cursor (f, 1);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4689 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4690 }
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4691 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
4692 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
4693 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
4694 XFlush (FRAME_X_DISPLAY (f));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4695 UNBLOCK_INPUT;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4696
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4697 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4698 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4699 #endif
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4700
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4701 #if 0
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4702 #include "glyphs.h"
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4703
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4704 /* 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
4705 on the frame F at position X, Y. */
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4706
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4707 x_draw_pixmap (f, x, y, image_data, width, height)
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
4708 struct frame *f;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4709 int x, y, width, height;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4710 char *image_data;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4711 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4712 Pixmap image;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4713
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4714 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
4715 FRAME_X_WINDOW (f), image_data,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4716 width, height);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4717 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
4718 f->output_data.x->normal_gc, 0, 0, width, height, x, y);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4719 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4720 #endif
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4721
4309
c79a44360ed9 (Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents: 4279
diff changeset
4722 #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
4723 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
4724
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4725 #ifdef HAVE_X11
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4726 DEFUN ("x-rebind-key", Fx_rebind_key, Sx_rebind_key, 3, 3, 0,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4727 "Rebind X keysym KEYSYM, with MODIFIERS, to generate NEWSTRING.\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4728 KEYSYM is a string which conforms to the X keysym definitions found\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4729 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
4730 list of strings specifying modifier keys such as Control_L, which must\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4731 also be depressed for NEWSTRING to appear.")
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4732 (x_keysym, modifiers, newstring)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4733 register Lisp_Object x_keysym;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4734 register Lisp_Object modifiers;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4735 register Lisp_Object newstring;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4736 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4737 char *rawstring;
642
b0ddc138b0b5 *** empty log message ***
Joseph Arceneaux <jla@gnu.org>
parents: 641
diff changeset
4738 register KeySym keysym;
b0ddc138b0b5 *** empty log message ***
Joseph Arceneaux <jla@gnu.org>
parents: 641
diff changeset
4739 KeySym modifier_list[16];
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4740
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
4741 check_x ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4742 CHECK_STRING (x_keysym, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4743 CHECK_STRING (newstring, 3);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4744
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4745 keysym = XStringToKeysym ((char *) XSTRING (x_keysym)->data);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4746 if (keysym == NoSymbol)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4747 error ("Keysym does not exist");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4748
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 436
diff changeset
4749 if (NILP (modifiers))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4750 XRebindKeysym (x_current_display, keysym, modifier_list, 0,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4751 XSTRING (newstring)->data, XSTRING (newstring)->size);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4752 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4753 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4754 register Lisp_Object rest, mod;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4755 register int i = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4756
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 436
diff changeset
4757 for (rest = modifiers; !NILP (rest); rest = Fcdr (rest))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4758 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4759 if (i == 16)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4760 error ("Can't have more than 16 modifiers");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4761
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4762 mod = Fcar (rest);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4763 CHECK_STRING (mod, 3);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4764 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
4765 #ifndef HAVE_X11R5
589aaa4a815b * xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents: 3679
diff changeset
4766 if (modifier_list[i] == NoSymbol
589aaa4a815b * xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents: 3679
diff changeset
4767 || !(IsModifierKey (modifier_list[i])
589aaa4a815b * xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents: 3679
diff changeset
4768 || ((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
4769 || ((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
4770 #else
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4771 if (modifier_list[i] == NoSymbol
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4772 || !IsModifierKey (modifier_list[i]))
3692
589aaa4a815b * xfns.c [! HAVE_X11R5] (Fx_rebind_key): Recognize that
Jim Blandy <jimb@redhat.com>
parents: 3679
diff changeset
4773 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4774 error ("Element is not a modifier keysym");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4775 i++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4776 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4777
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4778 XRebindKeysym (x_current_display, keysym, modifier_list, i,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4779 XSTRING (newstring)->data, XSTRING (newstring)->size);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4780 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4781
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4782 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4783 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4784
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4785 DEFUN ("x-rebind-keys", Fx_rebind_keys, Sx_rebind_keys, 2, 2, 0,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4786 "Rebind KEYCODE to list of strings STRINGS.\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4787 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
4788 nil as element means don't change.\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4789 See the documentation of `x-rebind-key' for more information.")
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4790 (keycode, strings)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4791 register Lisp_Object keycode;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4792 register Lisp_Object strings;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4793 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4794 register Lisp_Object item;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4795 register unsigned char *rawstring;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4796 KeySym rawkey, modifier[1];
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4797 int strsize;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4798 register unsigned i;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4799
2999
33c820044087 (check_x): New function.
Richard M. Stallman <rms@gnu.org>
parents: 2964
diff changeset
4800 check_x ();
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4801 CHECK_NUMBER (keycode, 1);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4802 CHECK_CONS (strings, 2);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4803 rawkey = (KeySym) ((unsigned) (XINT (keycode))) & 255;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4804 for (i = 0; i <= 15; strings = Fcdr (strings), i++)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4805 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4806 item = Fcar (strings);
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 436
diff changeset
4807 if (!NILP (item))
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4808 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4809 CHECK_STRING (item, 2);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4810 strsize = XSTRING (item)->size;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4811 rawstring = (unsigned char *) xmalloc (strsize);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4812 bcopy (XSTRING (item)->data, rawstring, strsize);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4813 modifier[1] = 1 << i;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4814 XRebindKeysym (x_current_display, rawkey, modifier, 1,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4815 rawstring, strsize);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4816 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4817 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4818 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4819 }
3141
ffe66ae9bfb3 (Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents: 3134
diff changeset
4820 #endif /* HAVE_X11 */
4309
c79a44360ed9 (Fx_rebind_key, Fx_rebind_keys): Functions deleted.
Richard M. Stallman <rms@gnu.org>
parents: 4279
diff changeset
4821 #endif /* 0 */
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4822
4606
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4823 #ifndef HAVE_XSCREENNUMBEROFSCREEN
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4824 int
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4825 XScreenNumberOfScreen (scr)
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4826 register Screen *scr;
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4827 {
4771
d6ddaf79ea6a (XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents: 4696
diff changeset
4828 register Display *dpy;
d6ddaf79ea6a (XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents: 4696
diff changeset
4829 register Screen *dpyscr;
4606
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4830 register int i;
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4831
4771
d6ddaf79ea6a (XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents: 4696
diff changeset
4832 dpy = scr->display;
d6ddaf79ea6a (XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents: 4696
diff changeset
4833 dpyscr = dpy->screens;
d6ddaf79ea6a (XScreenNumberOfScreen): Move assignments out of declaration for (dpy,
Brian Fox <bfox@gnu.org>
parents: 4696
diff changeset
4834
4606
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4835 for (i = 0; i < dpy->nscreens; i++, dpyscr++)
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4836 if (scr == dpyscr)
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4837 return i;
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4838
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4839 return -1;
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4840 }
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4841 #endif /* not HAVE_XSCREENNUMBEROFSCREEN */
0866f021a2cc (XScreenNumberOfScreen): New function.
Richard M. Stallman <rms@gnu.org>
parents: 4571
diff changeset
4842
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4843 Visual *
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4844 select_visual (dpy, screen, depth)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4845 Display *dpy;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4846 Screen *screen;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4847 unsigned int *depth;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4848 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4849 Visual *v;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4850 XVisualInfo *vinfo, vinfo_template;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4851 int n_visuals;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4852
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4853 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
4854
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
4855 #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
4856 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
4857 #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
4858 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
4859 #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
4860
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
4861 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
4862
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4863 vinfo = XGetVisualInfo (dpy,
3048
96ff8e5744b2 * xfns.c (select_visual): Include the screen number in the
Jim Blandy <jimb@redhat.com>
parents: 3015
diff changeset
4864 VisualIDMask | VisualScreenMask, &vinfo_template,
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4865 &n_visuals);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4866 if (n_visuals != 1)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4867 fatal ("Can't get proper X visual info");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4868
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4869 if ((1 << vinfo->depth) == vinfo->colormap_size)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4870 *depth = vinfo->depth;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4871 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4872 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4873 int i = 0;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4874 int n = vinfo->colormap_size - 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4875 while (n)
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4876 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4877 n = n >> 1;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4878 i++;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4879 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4880 *depth = i;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4881 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4882
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4883 XFree ((char *) vinfo);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4884 return v;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4885 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4886
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4887 /* 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
4888 Open a new connection if necessary. */
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4889
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4890 struct x_display_info *
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4891 x_display_info_for_name (name)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4892 Lisp_Object name;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4893 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4894 Lisp_Object names;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4895 struct x_display_info *dpyinfo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4896
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4897 CHECK_STRING (name, 0);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4898
12381
67cb86bbdb55 (Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents: 12347
diff changeset
4899 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
4900 error ("Not using X Windows");
67cb86bbdb55 (Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents: 12347
diff changeset
4901
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4902 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
4903 dpyinfo;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4904 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
4905 {
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4906 Lisp_Object tem;
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4907 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
4908 if (!NILP (tem))
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4909 return dpyinfo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4910 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4911
11917
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
4912 /* 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
4913 Vx_resource_name = Vinvocation_name;
2314b62ca4ab (Fx_get_resource): Major rewrite to make it clearer.
Karl Heuer <kwzh@gnu.org>
parents: 11900
diff changeset
4914
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4915 validate_x_resource_name ();
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4916
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4917 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
4918 (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
4919
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4920 if (dpyinfo == 0)
12046
d23f2c9990b2 (x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents: 12036
diff changeset
4921 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
4922
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4923 x_in_use = 1;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4924 XSETFASTINT (Vwindow_system_version, 11);
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4925
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4926 return dpyinfo;
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4927 }
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4928
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4929 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
4930 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
4931 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
4932 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
4933 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
4934 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
4935 (display, xrm_string, must_succeed)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4936 Lisp_Object display, xrm_string, must_succeed;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4937 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4938 unsigned int n_planes;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4939 unsigned char *xrm_option;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4940 struct x_display_info *dpyinfo;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4941
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4942 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
4943 if (! NILP (xrm_string))
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
4944 CHECK_STRING (xrm_string, 1);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4945
12381
67cb86bbdb55 (Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents: 12347
diff changeset
4946 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
4947 error ("Not using X Windows");
67cb86bbdb55 (Fx_open_connection, x_display_info_for_name):
Richard M. Stallman <rms@gnu.org>
parents: 12347
diff changeset
4948
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
4949 if (! NILP (xrm_string))
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
4950 xrm_option = (unsigned char *) XSTRING (xrm_string)->data;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4951 else
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4952 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
4953
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
4954 validate_x_resource_name ();
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
4955
7802
d687e885fa6a (Fx_open_connection): Set up Vx_resource_name and xrm_option
Richard M. Stallman <rms@gnu.org>
parents: 7797
diff changeset
4956 /* 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
4957 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
4958 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
4959 (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
4960
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4961 if (dpyinfo == 0)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4962 {
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4963 if (!NILP (must_succeed))
12046
d23f2c9990b2 (x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents: 12036
diff changeset
4964 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
4965 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
4966 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
4967 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
4968 XSTRING (display)->data);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4969 else
12046
d23f2c9990b2 (x_display_info_for_name): Fix error message.
Karl Heuer <kwzh@gnu.org>
parents: 12036
diff changeset
4970 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
4971 }
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4972
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
4973 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
4974
9327
b3398cf56fba (Fx_open_connection): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents: 9285
diff changeset
4975 XSETFASTINT (Vwindow_system_version, 11);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4976 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4977 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4978
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4979 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
4980 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
4981 "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
4982 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
4983 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
4984 (display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4985 Lisp_Object display;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4986 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4987 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
4988 struct x_display_info *tail;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4989 int i;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4990
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4991 if (dpyinfo->reference_count > 0)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4992 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
4993
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4994 BLOCK_INPUT;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4995 /* 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
4996 for (i = 0; i < dpyinfo->n_fonts; i++)
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4997 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
4998 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
4999 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
5000 /* 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
5001 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
5002 XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5003 }
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5004 x_destroy_all_bitmaps (dpyinfo);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5005 XSetCloseDownMode (dpyinfo->display, DestroyAll);
9742
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
5006
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
5007 #ifdef USE_X_TOOLKIT
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
5008 XtCloseDisplay (dpyinfo->display);
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
5009 #else
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5010 XCloseDisplay (dpyinfo->display);
9742
fe7653791d28 (Fx_create_frame): Set xlwmenu_default_font.
Richard M. Stallman <rms@gnu.org>
parents: 9703
diff changeset
5011 #endif
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5012
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5013 x_delete_display (dpyinfo);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5014 UNBLOCK_INPUT;
8782
51241477cfc5 Delete X11 conditionals.
Richard M. Stallman <rms@gnu.org>
parents: 8780
diff changeset
5015
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5016 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5017 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5018
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5019 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
5020 "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
5021 ()
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5022 {
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5023 Lisp_Object tail, result;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5024
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5025 result = Qnil;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5026 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
5027 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
5028
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5029 return result;
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5030 }
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5031
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5032 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
5033 "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
5034 If ON is nil, allow buffering of requests.\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5035 Turning on synchronization prohibits the Xlib routines from buffering\n\
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5036 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
5037 easier.\n\
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5038 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
5039 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
5040 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
5041 (on, display)
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5042 Lisp_Object display, on;
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5043 {
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5044 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
5045
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5046 XSynchronize (dpyinfo->display, !EQ (on, Qnil));
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5047
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5048 return Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5049 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5050
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5051 /* 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
5052
f900f7bba4c2 (x_sync): New function.
Richard M. Stallman <rms@gnu.org>
parents: 5429
diff changeset
5053 void
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5054 x_sync (f)
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5055 FRAME_PTR f;
5536
f900f7bba4c2 (x_sync): New function.
Richard M. Stallman <rms@gnu.org>
parents: 5429
diff changeset
5056 {
5558
42ec75481b8b (x_sync): Block input.
Richard M. Stallman <rms@gnu.org>
parents: 5536
diff changeset
5057 BLOCK_INPUT;
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5058 XSync (FRAME_X_DISPLAY (f), False);
5558
42ec75481b8b (x_sync): Block input.
Richard M. Stallman <rms@gnu.org>
parents: 5536
diff changeset
5059 UNBLOCK_INPUT;
5536
f900f7bba4c2 (x_sync): New function.
Richard M. Stallman <rms@gnu.org>
parents: 5429
diff changeset
5060 }
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5061
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5062 syms_of_xfns ()
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5063 {
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5064 /* 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
5065 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
5066
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5067 /* 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
5068 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
5069 /*&&& init symbols here &&&*/
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5070 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
5071 staticpro (&Qauto_raise);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5072 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
5073 staticpro (&Qauto_lower);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5074 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
5075 staticpro (&Qbackground_color);
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
5076 Qbar = intern ("bar");
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
5077 staticpro (&Qbar);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5078 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
5079 staticpro (&Qborder_color);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5080 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
5081 staticpro (&Qborder_width);
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
5082 Qbox = intern ("box");
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
5083 staticpro (&Qbox);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5084 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
5085 staticpro (&Qcursor_color);
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
5086 Qcursor_type = intern ("cursor-type");
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1786
diff changeset
5087 staticpro (&Qcursor_type);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5088 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
5089 staticpro (&Qforeground_color);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5090 Qgeometry = intern ("geometry");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5091 staticpro (&Qgeometry);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5092 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
5093 staticpro (&Qicon_left);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5094 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
5095 staticpro (&Qicon_top);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5096 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
5097 staticpro (&Qicon_type);
12073
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
5098 Qicon_name = intern ("icon-name");
1b0018c43060 (Qicon_name): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 12051
diff changeset
5099 staticpro (&Qicon_name);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5100 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
5101 staticpro (&Qinternal_border_width);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5102 Qleft = intern ("left");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5103 staticpro (&Qleft);
16254
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
5104 Qright = intern ("right");
3e8b16badf3d (Fx_create_frame): Default Qvertical_scroll_bars to `left'.
Richard M. Stallman <rms@gnu.org>
parents: 16156
diff changeset
5105 staticpro (&Qright);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5106 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
5107 staticpro (&Qmouse_color);
1874
19cf50641d6c * frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
5108 Qnone = intern ("none");
19cf50641d6c * frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
5109 staticpro (&Qnone);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5110 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
5111 staticpro (&Qparent_id);
8942
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
5112 Qscroll_bar_width = intern ("scroll-bar-width");
a43f3b56ed47 (x_set_scroll_bar_width): New function.
Karl Heuer <kwzh@gnu.org>
parents: 8845
diff changeset
5113 staticpro (&Qscroll_bar_width);
2328
82e4fed9cdd6 * xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents: 2295
diff changeset
5114 Qsuppress_icon = intern ("suppress-icon");
82e4fed9cdd6 * xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents: 2295
diff changeset
5115 staticpro (&Qsuppress_icon);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5116 Qtop = intern ("top");
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5117 staticpro (&Qtop);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5118 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
5119 staticpro (&Qundefined_color);
1994
73ce9dd21093 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1932
diff changeset
5120 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
5121 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
5122 Qvisibility = intern ("visibility");
9bce20507666 Use the `visiblity' parameter to determine the initial state of
Jim Blandy <jimb@redhat.com>
parents: 2283
diff changeset
5123 staticpro (&Qvisibility);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5124 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
5125 staticpro (&Qwindow_id);
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5126 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
5127 staticpro (&Qx_frame_parameter);
5671
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
5128 Qx_resource_name = intern ("x-resource-name");
5c597b8fbabe Find lwlib.h in ../lwlib.
Richard M. Stallman <rms@gnu.org>
parents: 5558
diff changeset
5129 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
5130 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
5131 staticpro (&Quser_position);
02cc4eee5928 (x_figure_window_size): Set USPosition only if user-position
Richard M. Stallman <rms@gnu.org>
parents: 7209
diff changeset
5132 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
5133 staticpro (&Quser_size);
9653
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5134 Qdisplay = intern ("display");
cfc5e15e0baf (x_sync): Take frame ptr as arg.
Richard M. Stallman <rms@gnu.org>
parents: 9580
diff changeset
5135 staticpro (&Qdisplay);
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5136 /* 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
5137
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5138 Fput (Qundefined_color, Qerror_conditions,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5139 Fcons (Qundefined_color, Fcons (Qerror, Qnil)));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5140 Fput (Qundefined_color, Qerror_message,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5141 build_string ("Undefined color"));
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5142
974
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5143 init_x_parm_symbols ();
4f88a1b78a46 * xfns.c (x_get_arg): Return Qunbound for an unspecified
Jim Blandy <jimb@redhat.com>
parents: 833
diff changeset
5144
9563
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
5145 DEFVAR_LISP ("x-bitmap-file-path", &Vx_bitmap_file_path,
ca99ee51077f Include paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 9543
diff changeset
5146 "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
5147 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
5148
4328
3d43e65a593d (syms_of_xfns): Use DEFVAR_LISP, not DEFVAR_INT, for Vx_pointer_shape.
Roland McGrath <roland@gnu.org>
parents: 4309
diff changeset
5149 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
5150 "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
5151 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
5152 unless you set the mouse color.");
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5153 Vx_pointer_shape = Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5154
4146
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5155 DEFVAR_LISP ("x-resource-name", &Vx_resource_name,
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5156 "The name Emacs uses to look up X resources; for internal use only.\n\
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5157 `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
5158 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
5159 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
5160 was invoked, or to the value specified with the `-name' or `-rn'\n\
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5161 switches, if present.");
0c681748d0ce * xfns.c (Fx_open_connection): Don't trust HAVE_XRMSETDATABASE;
Jim Blandy <jimb@redhat.com>
parents: 3923
diff changeset
5162 Vx_resource_name = Qnil;
3170
647229114f47 * xfns.c: Make resource manager work correctly even when
Jim Blandy <jimb@redhat.com>
parents: 3141
diff changeset
5163
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5164 #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
5165 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
5166 "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
5167 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
5168 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
5169 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5170 Vx_nontext_pointer_shape = Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5171
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5172 #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
5173 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
5174 "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
5175 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
5176 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
5177 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5178 Vx_mode_pointer_shape = Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5179
16396
4e4cc27b2a2a (x_set_internal_border_width): Only change
Richard M. Stallman <rms@gnu.org>
parents: 16357
diff changeset
5180 DEFVAR_LISP ("x-sensitive-text-pointer-shape",
7683
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5181 &Vx_sensitive_text_pointer_shape,
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5182 "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
5183 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
5184 or when you set the mouse color.");
be3423efbdce (Vx_sensitive_text_pointer_shape):
Richard M. Stallman <rms@gnu.org>
parents: 7599
diff changeset
5185 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
5186
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5187 DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel,
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5188 "A string indicating the foreground color of the cursor box.");
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5189 Vx_cursor_fore_pixel = Qnil;
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5190
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5191 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
5192 "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
5193 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
5194 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
5195 /* 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
5196 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
5197 Vx_no_window_manager = Qnil;
8170
d92a24366b22 (x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8103
diff changeset
5198
d92a24366b22 (x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8103
diff changeset
5199 #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
5200 Fprovide (intern ("x-toolkit"));
8170
d92a24366b22 (x_toolkit): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8103
diff changeset
5201 #endif
12094
a9fda5417acf (syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents: 12080
diff changeset
5202 #ifdef USE_MOTIF
a9fda5417acf (syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents: 12080
diff changeset
5203 Fprovide (intern ("motif"));
a9fda5417acf (syms_of_xfns): Provide motif in Motif version.
Karl Heuer <kwzh@gnu.org>
parents: 12080
diff changeset
5204 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5205
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5206 defsubr (&Sx_get_resource);
689
45401d45581d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 687
diff changeset
5207 #if 0
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5208 defsubr (&Sx_draw_rectangle);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5209 defsubr (&Sx_erase_rectangle);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5210 defsubr (&Sx_contour_region);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5211 defsubr (&Sx_uncontour_region);
689
45401d45581d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 687
diff changeset
5212 #endif
8779
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
5213 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
5214 defsubr (&Sx_display_color_p);
8779
12c6296bbb4b (Fx_display_grayscale_p): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8758
diff changeset
5215 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
5216 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
5217 defsubr (&Sx_color_values);
4279
d69483b37e0a (MAXREQUEST): Defined.
Richard M. Stallman <rms@gnu.org>
parents: 4269
diff changeset
5218 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
5219 defsubr (&Sx_server_vendor);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5220 defsubr (&Sx_server_version);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5221 defsubr (&Sx_display_pixel_width);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5222 defsubr (&Sx_display_pixel_height);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5223 defsubr (&Sx_display_mm_width);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5224 defsubr (&Sx_display_mm_height);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5225 defsubr (&Sx_display_screens);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5226 defsubr (&Sx_display_planes);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5227 defsubr (&Sx_display_color_cells);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5228 defsubr (&Sx_display_visual_class);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5229 defsubr (&Sx_display_backing_store);
68328c3af38f (x_screen): Make this var file scope.
Richard M. Stallman <rms@gnu.org>
parents: 2197
diff changeset
5230 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
5231 #if 0
3141
ffe66ae9bfb3 (Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents: 3134
diff changeset
5232 defsubr (&Sx_rebind_key);
ffe66ae9bfb3 (Fx_rebind_key, Fx_rebind_keys): X10 definitions deleted.
Richard M. Stallman <rms@gnu.org>
parents: 3134
diff changeset
5233 defsubr (&Sx_rebind_keys);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5234 defsubr (&Sx_track_pointer);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5235 defsubr (&Sx_grab_pointer);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5236 defsubr (&Sx_ungrab_pointer);
436
6e0a136fca4f *** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents: 398
diff changeset
5237 #endif
2328
82e4fed9cdd6 * xfns.c (Fx_parse_geometry): Renamed from Fx_geometry.
Jim Blandy <jimb@redhat.com>
parents: 2295
diff changeset
5238 defsubr (&Sx_parse_geometry);
771
538c0bcb418e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
5239 defsubr (&Sx_create_frame);
687
e2b747dd6a6e *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 642
diff changeset
5240 #if 0
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5241 defsubr (&Sx_horizontal_line);
687
e2b747dd6a6e *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 642
diff changeset
5242 #endif
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5243 defsubr (&Sx_open_connection);
9690
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5244 defsubr (&Sx_close_connection);
f6d4e1acb5a1 (Fx_create_frame): Don't increment refernce_count
Richard M. Stallman <rms@gnu.org>
parents: 9653
diff changeset
5245 defsubr (&Sx_display_list);
389
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5246 defsubr (&Sx_synchronize);
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5247 }
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5248
6e0510766e66 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5249 #endif /* HAVE_X_WINDOWS */